-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better error message for invalid octal digit #15903
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
Comments
Fixing this will break some (arguably dodgy) code: #![feature(macro_rules)]
macro_rules! test
{
($a: expr $b: expr) =>
{
$a as u32 + $b as u32
}
}
fn main()
{
println!("{}", test!(0o19));
} |
@SiegeLord Egad, that code deserves to be broken. |
steveklabnik
added
A-parser
Area: The parsing of Rust source code to an AST
A-diagnostics
Area: Messages for errors, warnings, and lints
labels
Jan 24, 2015
Same error today. |
I think this has been fixed by #23872 |
It is indeed fixed in master and there is also a testcase src/test/parse-fail/lex-bad-octal-literal.rs, so I think this issue can be closed. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Nov 16, 2023
Fix builtin line! expansion `concat` expects only literals, not whole syntax nodes, so we need to expand as such
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
Gives me:
It would be better to say something like:
The text was updated successfully, but these errors were encountered: