File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
compiler/rustc_symbol_mangling/src Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -882,11 +882,11 @@ impl<'tcx> Printer<'tcx> for V0SymbolMangler<'tcx> {
882882 DefPathData :: OpaqueTy => 'i' ,
883883 DefPathData :: SyntheticCoroutineBody => 's' ,
884884 DefPathData :: NestedStatic => 'n' ,
885+ DefPathData :: GlobalAsm => 'a' ,
885886
886887 // These should never show up as `print_path_with_simple` arguments.
887888 DefPathData :: CrateRoot
888889 | DefPathData :: Use
889- | DefPathData :: GlobalAsm
890890 | DefPathData :: Impl
891891 | DefPathData :: MacroNs ( _)
892892 | DefPathData :: LifetimeNs ( _)
Original file line number Diff line number Diff line change 1+ //@ build-pass
2+ //@ compile-flags: -Clink-dead-code
3+ //@ needs-asm-support
4+
5+ #![ allow( unused) ]
6+
7+ // Test that a symbol in a `global_asm` namespace doesn't cause an ICE during v0 symbol mangling
8+ // due to a lack of missing namespace character for `global_asm`.
9+ //
10+ // FIXME: Can't use `#[rustc_symbol_name]` on the `foo` call to check its symbol, so just checking
11+ // the test compiles.
12+
13+ fn foo < const N : usize > ( ) { }
14+
15+ core:: arch:: global_asm!( "/* {} */" , sym foo:: <{
16+ || { } ;
17+ 0
18+ } >) ;
19+
20+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments