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 @@ -258,15 +258,16 @@ impl<'tcx> SymbolMangler<'tcx> {
258
258
fn print_pat ( & mut self , pat : ty:: Pattern < ' tcx > ) -> Result < ( ) , std:: fmt:: Error > {
259
259
Ok ( match * pat {
260
260
ty:: PatternKind :: Range { start, end } => {
261
- let consts = [ start, end] ;
262
- for ct in consts {
263
- Ty :: new_array_with_const_len ( self . tcx , self . tcx . types . unit , ct) . print ( self ) ?;
264
- }
261
+ self . push ( "R" ) ;
262
+ self . print_const ( start) ?;
263
+ self . print_const ( end) ?;
265
264
}
266
265
ty:: PatternKind :: Or ( patterns) => {
266
+ self . push ( "O" ) ;
267
267
for pat in patterns {
268
268
self . print_pat ( pat) ?;
269
269
}
270
+ self . push ( "E" ) ;
270
271
}
271
272
} )
272
273
}
@@ -494,12 +495,9 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> {
494
495
}
495
496
496
497
ty:: Pat ( ty, pat) => {
497
- // HACK: Represent as tuple until we have something better.
498
- // HACK: constants are used in arrays, even if the types don't match.
499
- self . push ( "T" ) ;
498
+ self . push ( "W" ) ;
500
499
ty. print ( self ) ?;
501
500
self . print_pat ( pat) ?;
502
- self . push ( "E" ) ;
503
501
}
504
502
505
503
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