File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
compiler/rustc_symbol_mangling/src Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -262,15 +262,16 @@ impl<'tcx> SymbolMangler<'tcx> {
262
262
fn print_pat ( & mut self , pat : ty:: Pattern < ' tcx > ) -> Result < ( ) , std:: fmt:: Error > {
263
263
Ok ( match * pat {
264
264
ty:: PatternKind :: Range { start, end } => {
265
- let consts = [ start, end] ;
266
- for ct in consts {
267
- Ty :: new_array_with_const_len ( self . tcx , self . tcx . types . unit , ct) . print ( self ) ?;
268
- }
265
+ self . push ( "R" ) ;
266
+ self . print_const ( start) ?;
267
+ self . print_const ( end) ?;
269
268
}
270
269
ty:: PatternKind :: Or ( patterns) => {
270
+ self . push ( "O" ) ;
271
271
for pat in patterns {
272
272
self . print_pat ( pat) ?;
273
273
}
274
+ self . push ( "E" ) ;
274
275
}
275
276
} )
276
277
}
@@ -498,12 +499,9 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> {
498
499
}
499
500
500
501
ty:: Pat ( ty, pat) => {
501
- // HACK: Represent as tuple until we have something better.
502
- // HACK: constants are used in arrays, even if the types don't match.
503
- self . push ( "T" ) ;
502
+ self . push ( "W" ) ;
504
503
ty. print ( self ) ?;
505
504
self . print_pat ( pat) ?;
506
- self . push ( "E" ) ;
507
505
}
508
506
509
507
ty:: Array ( ty, len) => {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ pub fn bar() {
16
16
// CHECK: call pattern_type_symbols::foo::<u32>
17
17
// CHECK: call void @_RINvC[[CRATE_IDENT:[a-zA-Z0-9]{12}]]_20pattern_type_symbols3foomEB2_
18
18
foo :: < u32 > ( ) ;
19
- // CHECK: call pattern_type_symbols::foo::<( u32, [(); 0], [(); 999999999]) >
20
- // CHECK: call void @_RINvC[[CRATE_IDENT]]_20pattern_type_symbols3fooTmAum0_Aum3b9ac9ff_EEB2_
19
+ // CHECK: call pattern_type_symbols::foo::<u32 is 0..= 999999999>
20
+ // CHECK: call void @_RINvC[[CRATE_IDENT]]_20pattern_type_symbols3fooWmRm0_m3b9ac9ff_EB2_
21
21
foo :: < NanoU32 > ( ) ;
22
22
}
You can’t perform that action at this time.
0 commit comments