File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
compiler/rustc_symbol_mangling/src
tests/codegen-units/item-collection Expand file tree Collapse file tree 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>(
1919 let def_id = instance. def_id ( ) ;
2020
2121 // 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 .
2525 let mut ty_def_id = def_id;
2626 let instance_ty;
2727 loop {
2828 let key = tcx. def_key ( ty_def_id) ;
2929 match key. disambiguated_data . data {
30- DefPathData :: TypeNs ( _) | DefPathData :: ValueNs ( _) => {
30+ DefPathData :: TypeNs ( _) | DefPathData :: ValueNs ( _) | DefPathData :: Closure => {
3131 instance_ty = tcx. type_of ( ty_def_id) . instantiate_identity ( ) ;
3232 debug ! ( ?instance_ty) ;
3333 break ;
Original file line number Diff line number Diff line change @@ -10,3 +10,9 @@ pub async fn async_fn() {}
1010pub fn closure ( ) {
1111 let _ = || { } ;
1212}
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