File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
compiler/rustc_smir/src/rustc_smir Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 44//! monomorphic body using internal representation.
55//! After that, we convert the internal representation into a stable one.
66use crate :: rustc_smir:: { Stable , Tables } ;
7+ use rustc_hir:: def:: DefKind ;
78use rustc_middle:: mir;
89use rustc_middle:: mir:: visit:: MutVisitor ;
910use rustc_middle:: ty:: { self , TyCtxt } ;
@@ -29,10 +30,12 @@ impl<'tcx> BodyBuilder<'tcx> {
2930 /// All constants are also evaluated.
3031 pub fn build ( mut self , tables : & mut Tables < ' tcx > ) -> stable_mir:: mir:: Body {
3132 let body = tables. tcx . instance_mir ( self . instance . def ) . clone ( ) ;
32- let mono_body = if self . tcx . def_kind ( self . instance . def_id ( ) ) . is_fn_like ( )
33- || !self . instance . args . is_empty ( )
33+ let mono_body = if !self . instance . args . is_empty ( )
34+ // Without the `generic_const_exprs` feature gate, anon consts in signatures do not
35+ // get generic parameters. Which is wrong, but also not a problem without
36+ // generic_const_exprs
37+ || self . tcx . def_kind ( self . instance . def_id ( ) ) != DefKind :: AnonConst
3438 {
35- // This call will currently will ICE in some shims which are already monomorphic.
3639 let mut mono_body = self . instance . instantiate_mir_and_normalize_erasing_regions (
3740 tables. tcx ,
3841 ty:: ParamEnv :: reveal_all ( ) ,
You can’t perform that action at this time.
0 commit comments