Skip to content

Commit

Permalink
Use constness query to encode constness.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Jun 26, 2023
1 parent cbe1578 commit 3d9ba07
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions compiler/rustc_metadata/src/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1317,14 +1317,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
}
if let DefKind::Fn | DefKind::AssocFn = def_kind {
self.tables.asyncness.set_some(def_id.index, tcx.asyncness(def_id));
self.tables.constness.set_some(def_id.index, tcx.constness(def_id));
record_array!(self.tables.fn_arg_names[def_id] <- tcx.fn_arg_names(def_id));
let constness = if self.tcx.is_const_fn_raw(def_id) {
hir::Constness::Const
} else {
hir::Constness::NotConst
};
self.tables.constness.set_some(def_id.index, constness);

record!(self.tables.fn_sig[def_id] <- tcx.fn_sig(def_id));
self.tables.is_intrinsic.set(def_id.index, tcx.is_intrinsic(def_id));
}
Expand Down

0 comments on commit 3d9ba07

Please sign in to comment.