Skip to content

Commit 63b17d5

Browse files
committed
Use constness query to encode constness.
1 parent 46695b7 commit 63b17d5

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,13 +1183,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
11831183
}
11841184
if let DefKind::Fn | DefKind::AssocFn = def_kind {
11851185
self.tables.asyncness.set(def_id.index, tcx.asyncness(def_id));
1186+
self.tables.constness.set(def_id.index, tcx.constness(def_id));
11861187
record_array!(self.tables.fn_arg_names[def_id] <- tcx.fn_arg_names(def_id));
1187-
let constness = if self.tcx.is_const_fn_raw(def_id) {
1188-
hir::Constness::Const
1189-
} else {
1190-
hir::Constness::NotConst
1191-
};
1192-
self.tables.constness.set(def_id.index, constness);
11931188

11941189
record!(self.tables.fn_sig[def_id] <- tcx.fn_sig(def_id));
11951190
if tcx.is_intrinsic(def_id) {

0 commit comments

Comments
 (0)