Closed
Description
rustc crashes ungracefully when given the following input (found by fuzz-rustc):
struct B{C:[);{#![cfg_attr(r(c:
$ rustc -vV
rustc 1.56.0-nightly (25b764849 2021-08-04)
binary: rustc
commit-hash: 25b764849625cb090e8b81d12d2bb2295d073788
commit-date: 2021-08-04
host: x86_64-unknown-linux-gnu
release: 1.56.0-nightly
LLVM version: 12.0.1
$ rustc bug.rs
error: this file contains an unclosed delimiter
--> bug.rs:1:33
|
1 | struct B{C:[);{#![cfg_attr(r(c:
| - - - - - ^
| | | | | |
| | | | | unclosed delimiter
| | | | unclosed delimiter
| | | unclosed delimiter
| | unclosed delimiter
| unclosed delimiter
error: expected type, found `]`
--> bug.rs:1:13
|
1 | struct B{C:[);{#![cfg_attr(r(c:
| ^ expected type
error: expected one of `.`, `?`, `]`, or an operator, found `}`
--> bug.rs:1:33
|
1 | struct B{C:[);{#![cfg_attr(r(c:
| - unclosed delimiter ^ help: `]` may belong here
error[E0658]: attributes on expressions are experimental
--> bug.rs:1:16
|
1 | struct B{C:[);{#![cfg_attr(r(c:
| ^^^^^^^^^^^^^^^^^
|
= note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
error: expected one of `(`, `)`, `,`, `::`, or `=`, found `:`
--> bug.rs:1:31
|
1 | struct B{C:[);{#![cfg_attr(r(c:
| ^ expected one of `(`, `)`, `,`, `::`, or `=`
Aborted (core dumped)