Closed
Description
rustc crashes ungracefully when given the following input (found by fuzz-rustc):
asm!(f(assert_eq!(f/
$ rustc -vV
rustc 1.38.0-nightly (273f42b59 2019-07-21)
binary: rustc
commit-hash: 273f42b5964c29dda2c5a349dd4655529767b07f
commit-date: 2019-07-21
host: x86_64-unknown-linux-gnu
release: 1.38.0-nightly
LLVM version: 9.0
$ cat crash.rs
asm!(f(assert_eq!(f/
$ rustc crash.rs
error: this file contains an un-closed delimiter
--> crash.rs:1:22
|
1 | asm!(f(assert_eq!(f/
| - - - ^
| | | |
| | | un-closed delimiter
| | un-closed delimiter
| un-closed delimiter
error: macros that expand to items must be delimited with braces or followed by a semicolon
--> crash.rs:1:5
|
1 | asm!(f(assert_eq!(f/
| ^^^^^^^^^^^^^^^^^
help: change the delimiters to curly braces
|
1 | asm! {f(assert_eq!(f/}
| ^ ^
help: add a semicolon
|
1 | asm!(f(assert_eq!(f/;
| ^
error[E0658]: use of unstable library feature 'asm': inline assembly is not stable enough for use and is subject to change
--> crash.rs:1:1
|
1 | asm!(f(assert_eq!(f/
| ^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29722
= help: add `#![feature(asm)]` to the crate attributes to enable
error: expected expression, found end of macro arguments
--> crash.rs:1:21
|
1 | asm!(f(assert_eq!(f/
| ^ expected expression
Aborted (core dumped)
I'm seeing this behavior on stable, beta, and nightly.
Metadata
Metadata
Assignees
Labels
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: The lexing & parsing of Rust source code to an ASTCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Relevant to the compiler team, which will review and decide on the PR/issue.