File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/librustc_metadata/rmeta Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1360,11 +1360,15 @@ impl<'a, 'tcx> CrateMetadata {
13601360 }
13611361 }
13621362
1363+ // This replicates some of the logic of the crate-local `is_const_fn_raw` query, because we
1364+ // don't serialize constness for tuple variant and tuple struct constructors.
13631365 fn is_const_fn_raw ( & self , id : DefIndex ) -> bool {
13641366 let constness = match self . kind ( id) {
13651367 EntryKind :: Method ( data) => data. decode ( self ) . fn_data . constness ,
13661368 EntryKind :: Fn ( data) => data. decode ( self ) . constness ,
1367- // Some intrinsics can be const fn
1369+ // Some intrinsics can be const fn. While we could recompute this (at least until we
1370+ // stop having hardcoded whitelists and move to stability attributes), it seems cleaner
1371+ // to treat all const fns equally.
13681372 EntryKind :: ForeignFn ( data) => data. decode ( self ) . constness ,
13691373 EntryKind :: Variant ( ..) | EntryKind :: Struct ( ..) => hir:: Constness :: Const ,
13701374 _ => hir:: Constness :: NotConst ,
You can’t perform that action at this time.
0 commit comments