Auto merge of #119225 - Mark-Simulacrum:remove-option, r=compiler-errors

Avoid redundant Option for cross_crate_inlinable
This commit is contained in:
bors 2023-12-23 18:37:40 +00:00
commit 520e30be83
3 changed files with 3 additions and 3 deletions

View File

@ -1266,7 +1266,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
}
fn cross_crate_inlinable(self, id: DefIndex) -> bool {
self.root.tables.cross_crate_inlinable.get(self, id).unwrap_or(false)
self.root.tables.cross_crate_inlinable.get(self, id)
}
fn get_fn_has_self_parameter(self, id: DefIndex, sess: &'a Session) -> bool {

View File

@ -1607,7 +1607,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
record!(self.tables.optimized_mir[def_id.to_def_id()] <- tcx.optimized_mir(def_id));
self.tables
.cross_crate_inlinable
.set(def_id.to_def_id().index, Some(self.tcx.cross_crate_inlinable(def_id)));
.set(def_id.to_def_id().index, self.tcx.cross_crate_inlinable(def_id));
record!(self.tables.closure_saved_names_of_captured_variables[def_id.to_def_id()]
<- tcx.closure_saved_names_of_captured_variables(def_id));

View File

@ -398,6 +398,7 @@ define_tables! {
// That's why the encoded list needs to contain `ModChild` structures describing all the names
// individually instead of `DefId`s.
module_children_reexports: Table<DefIndex, LazyArray<ModChild>>,
cross_crate_inlinable: Table<DefIndex, bool>,
- optional:
attributes: Table<DefIndex, LazyArray<ast::Attribute>>,
@ -428,7 +429,6 @@ define_tables! {
object_lifetime_default: Table<DefIndex, LazyValue<ObjectLifetimeDefault>>,
optimized_mir: Table<DefIndex, LazyValue<mir::Body<'static>>>,
mir_for_ctfe: Table<DefIndex, LazyValue<mir::Body<'static>>>,
cross_crate_inlinable: Table<DefIndex, bool>,
closure_saved_names_of_captured_variables: Table<DefIndex, LazyValue<IndexVec<FieldIdx, Symbol>>>,
mir_coroutine_witnesses: Table<DefIndex, LazyValue<mir::CoroutineLayout<'static>>>,
promoted_mir: Table<DefIndex, LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>,