Skip to content

Commit

Permalink
Add some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Nov 16, 2019
1 parent 11580ce commit 28aec1b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/test/ui/asm/asm-literal-escaping.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// build-pass
// only-x86_64

#![feature(asm)]

fn main() {
unsafe {
// "nop" :: "r"(x) : "eax" : "volatile"
let x = 10;
asm!("\x6Eop" :: "\x72"(x) : "\x65ax" : "\x76olatile");
}
}
10 changes: 10 additions & 0 deletions src/test/ui/proc-macro/span-preservation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,14 @@ extern "C" fn baz() {
0 //~ ERROR mismatched types
}

#[recollect_attr]
extern "Rust" fn rust_abi() {
0 //~ ERROR mismatched types
}

#[recollect_attr]
extern "\x43" fn c_abi_escaped() {
0 //~ ERROR mismatched types
}

fn main() {}
24 changes: 23 additions & 1 deletion src/test/ui/proc-macro/span-preservation.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,29 @@ LL | 0
= note: expected type `()`
found type `{integer}`

error: aborting due to 6 previous errors
error[E0308]: mismatched types
--> $DIR/span-preservation.rs:49:5
|
LL | extern "Rust" fn rust_abi() {
| - possibly return type missing here?
LL | 0
| ^ expected (), found integer
|
= note: expected type `()`
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/span-preservation.rs:54:5
|
LL | extern "\x43" fn c_abi_escaped() {
| - possibly return type missing here?
LL | 0
| ^ expected (), found integer
|
= note: expected type `()`
found type `{integer}`

error: aborting due to 8 previous errors

Some errors have detailed explanations: E0308, E0560.
For more information about an error, try `rustc --explain E0308`.

0 comments on commit 28aec1b

Please sign in to comment.