Closed
Description
I tried this code:
mod foo {
pub static A: i32 = 0;
pub static B: i32 = 0;
pub static C: i32 = 0;
}
fn main() {
let _arr = [ &raw foo::A, &raw foo::B, &raw foo::C ];
}
I expected to see this happen: Code compiles normally
Instead, this happened: A parser error.
error: expected one of `!`, `,`, `.`, `::`, `;`, `?`, `]`, `{`, or an operator, found `foo`
--> src/main.rs:9:23
|
9 | let _arr = [ &raw foo::A, &raw foo::B, &raw foo::C ];
| ^^^ expected one of 9 possible tokens
Meta
rustc --version --verbose
:
rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTArea: raw pointers, MaybeUninit, NonNullDiagnostics: An error or lint that doesn't give enough information about the problem at hand.`#![feature(raw_ref_op)]`Relevant to the compiler team, which will review and decide on the PR/issue.