File tree Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 1+ // build-pass 
2+ // only-x86_64 
3+ 
4+ #![ feature( asm) ]  
5+ 
6+ fn  main ( )  { 
7+     unsafe  { 
8+         // "nop" :: "r"(x) : "eax" : "volatile" 
9+         let  x = 10 ; 
10+         asm ! ( "\x6E op"  ::  "\x72 " ( x)  :  "\x65 ax"  :  "\x76 olatile" ) ; 
11+     } 
12+ } 
Original file line number Diff line number Diff line change @@ -44,4 +44,14 @@ extern "C" fn baz() {
4444    0  //~ ERROR mismatched types 
4545} 
4646
47+ #[ recollect_attr]  
48+ extern  "Rust"  fn  rust_abi ( )  { 
49+     0  //~ ERROR mismatched types 
50+ } 
51+ 
52+ #[ recollect_attr]  
53+ extern  "\x43 "  fn  c_abi_escaped ( )  { 
54+     0  //~ ERROR mismatched types 
55+ } 
56+ 
4757fn  main ( )  { } 
Original file line number Diff line number Diff line change @@ -52,7 +52,29 @@ LL |     0
5252   = note: expected type `()`
5353              found type `{integer}`
5454
55- error: aborting due to 6 previous errors
55+ error[E0308]: mismatched types
56+   --> $DIR/span-preservation.rs:49:5
57+    |
58+ LL | extern "Rust" fn rust_abi() {
59+    |                             - possibly return type missing here?
60+ LL |     0
61+    |     ^ expected (), found integer
62+    |
63+    = note: expected type `()`
64+               found type `{integer}`
65+ 
66+ error[E0308]: mismatched types
67+   --> $DIR/span-preservation.rs:54:5
68+    |
69+ LL | extern "\x43" fn c_abi_escaped() {
70+    |                                  - possibly return type missing here?
71+ LL |     0
72+    |     ^ expected (), found integer
73+    |
74+    = note: expected type `()`
75+               found type `{integer}`
76+ 
77+ error: aborting due to 8 previous errors
5678
5779Some errors have detailed explanations: E0308, E0560.
5880For more information about an error, try `rustc --explain E0308`.
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments