Closed
Description
$ echo 'unsafe extern { pub unsafe static STATIC: (); }' | rustc -Zunpretty=expanded -
#![feature(prelude_import)]
#![no_std]
#[prelude_import]
use ::std::prelude::rust_2015::*;
#[macro_use]
extern crate std;
unsafe extern {
unsafe pub static STATIC: ();
}
The syntax printed by rustc is not valid Rust syntax.
error: expected one of `extern` or `fn`, found keyword `pub`
--> <anon>:8:12
|
7 | unsafe extern {
| - while parsing this item list starting here
8 | unsafe pub static STATIC: ();
| -------^^^
| | |
| | expected one of `extern` or `fn`
| help: visibility `pub` must come before `unsafe`: `pub unsafe`
9 | }
| - the item list ends here
Meta
rustc --version --verbose
:
rustc 1.84.0-nightly (86d69c705 2024-10-22)
binary: rustc
commit-hash: 86d69c705a552236a622eee3fdea94bf13c5f102
commit-date: 2024-10-22
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.1