File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
librustc_mir/monomorphize Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -1166,8 +1166,13 @@ fn create_mono_items_for_default_impls<'tcx>(
11661166 }
11671167 } ) ;
11681168
1169+ let param_env = ty:: ParamEnv :: reveal_all ( ) ;
1170+ let substs = tcx. normalize_erasing_regions (
1171+ param_env,
1172+ substs,
1173+ ) ;
11691174 let instance = ty:: Instance :: resolve ( tcx,
1170- ty :: ParamEnv :: reveal_all ( ) ,
1175+ param_env ,
11711176 method. def_id ,
11721177 substs) . unwrap ( ) ;
11731178
Original file line number Diff line number Diff line change 1+ // Make sure that the mono-item collector does not crash when trying to
2+ // instantiate a default impl for DecodeUtf16<<u8 as A>::Item>
3+ // See https://github.com/rust-lang/rust/issues/58375
4+ // compile-flags:-C link-dead-code
5+
6+ #![ crate_type = "rlib" ]
7+
8+ pub struct DecodeUtf16 < I > ( I ) ;
9+
10+ pub trait Arbitrary {
11+ fn arbitrary ( ) { }
12+ }
13+
14+ pub trait A {
15+ type Item ;
16+ }
17+
18+ impl A for u8 {
19+ type Item = char ;
20+ }
21+
22+ impl Arbitrary for DecodeUtf16 < <u8 as A >:: Item > {
23+ }
You can’t perform that action at this time.
0 commit comments