File tree 2 files changed +10
-4
lines changed
compiler/rustc_symbol_mangling/src
tests/codegen-units/item-collection
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ pub(super) fn mangle<'tcx>(
19
19
let def_id = instance. def_id ( ) ;
20
20
21
21
// We want to compute the "type" of this item. Unfortunately, some
22
- // kinds of items (e.g., closures) don't have an entry in the
23
- // item-type array. So walk back up the find the closest parent
24
- // that DOES have an entry .
22
+ // kinds of items (e.g., synthetic static allocations from const eval)
23
+ // don't have a proper implementation for the `type_of` query. So walk
24
+ // back up the find the closest parent that DOES have a type .
25
25
let mut ty_def_id = def_id;
26
26
let instance_ty;
27
27
loop {
28
28
let key = tcx. def_key ( ty_def_id) ;
29
29
match key. disambiguated_data . data {
30
- DefPathData :: TypeNs ( _) | DefPathData :: ValueNs ( _) => {
30
+ DefPathData :: TypeNs ( _) | DefPathData :: ValueNs ( _) | DefPathData :: Closure => {
31
31
instance_ty = tcx. type_of ( ty_def_id) . instantiate_identity ( ) ;
32
32
debug ! ( ?instance_ty) ;
33
33
break ;
Original file line number Diff line number Diff line change @@ -10,3 +10,9 @@ pub async fn async_fn() {}
10
10
pub fn closure ( ) {
11
11
let _ = || { } ;
12
12
}
13
+
14
+ //~ MONO_ITEM fn A::{constant#0}::{closure#0} @@
15
+ trait A where
16
+ [ ( ) ; ( || { } , 1 ) . 1 ] : Sized ,
17
+ {
18
+ }
You can’t perform that action at this time.
0 commit comments