File tree 1 file changed +6
-3
lines changed
compiler/rustc_smir/src/rustc_smir
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 4
4
//! monomorphic body using internal representation.
5
5
//! After that, we convert the internal representation into a stable one.
6
6
use crate :: rustc_smir:: { Stable , Tables } ;
7
+ use rustc_hir:: def:: DefKind ;
7
8
use rustc_middle:: mir;
8
9
use rustc_middle:: mir:: visit:: MutVisitor ;
9
10
use rustc_middle:: ty:: { self , TyCtxt } ;
@@ -29,10 +30,12 @@ impl<'tcx> BodyBuilder<'tcx> {
29
30
/// All constants are also evaluated.
30
31
pub fn build ( mut self , tables : & mut Tables < ' tcx > ) -> stable_mir:: mir:: Body {
31
32
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
34
38
{
35
- // This call will currently will ICE in some shims which are already monomorphic.
36
39
let mut mono_body = self . instance . instantiate_mir_and_normalize_erasing_regions (
37
40
tables. tcx ,
38
41
ty:: ParamEnv :: reveal_all ( ) ,
You can’t perform that action at this time.
0 commit comments