File tree 1 file changed +3
-7
lines changed
compiler/rustc_symbol_mangling/src
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -596,13 +596,9 @@ impl<'tcx> Printer<'tcx> for SymbolMangler<'tcx> {
596
596
// Handle `str` as partial support for unsized constants
597
597
ty:: Str => {
598
598
let tcx = self . tcx ( ) ;
599
- let ref_ty = if matches ! ( ct_ty. kind( ) , ty:: Str ) {
600
- // HACK(jaic1): hide the `str` type behind a reference
601
- // for the following transformation from valtree to raw bytes
602
- Ty :: new_imm_ref ( tcx, tcx. lifetimes . re_static , ct_ty)
603
- } else {
604
- ct_ty
605
- } ;
599
+ // HACK(jaic1): hide the `str` type behind a reference
600
+ // for the following transformation from valtree to raw bytes
601
+ let ref_ty = Ty :: new_imm_ref ( tcx, tcx. lifetimes . re_static , ct_ty) ;
606
602
let slice = valtree. try_to_raw_bytes ( tcx, ref_ty) . unwrap_or_else ( || {
607
603
bug ! ( "expected to get raw bytes from valtree {:?} for type {:}" , valtree, ct_ty)
608
604
} ) ;
You can’t perform that action at this time.
0 commit comments