-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Non-literal arguments to unreachable!()
are rejected starting with v1.59.0
#94475
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
Labels
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Shnatsel
added a commit
to rustsec/rustsec
that referenced
this issue
Mar 1, 2022
This appears to have been an intentional bugfix to bring |
zslayton
added a commit
to amazon-ion/ion-cli
that referenced
this issue
Mar 2, 2022
Starting in Rust 1.59, calls to the `unreachable!` macro no longer accept string variables as their first parameter. This brings their behavior in line with macros like `println!`, `format!`, and `write!`. See: rust-lang/rust#94475
zslayton
added a commit
to amazon-ion/ion-cli
that referenced
this issue
Mar 2, 2022
Starting in Rust 1.59, calls to the `unreachable!` macro no longer accept string variables as their first parameter. This brings their behavior in line with macros like `println!`, `format!`, and `write!`. See: rust-lang/rust#94475
Why was there no future-incompat warning for this? The first time I saw it was when a stable compiler upgrade broke my code. |
Closing this issue as intended behavior. |
tarcieri
pushed a commit
to rustsec/rustsec
that referenced
this issue
Apr 16, 2022
boustrophedon
added a commit
to boustrophedon/rss-actions
that referenced
this issue
Oct 13, 2022
- use format string directly in unreachable! call
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
I tried this code:
In 2021 edition.
On 1.58.1 this compiles, but on 1.59.0 and later it fails to build:
Version it worked on
It most recently worked on: 1.58.1
Version with regression
1.59.0 stable on Rust playground, as well as the following nightly version:
The text was updated successfully, but these errors were encountered: