-
Notifications
You must be signed in to change notification settings - Fork 13.3k
regression: ICE: expr in place where literal is expected (builtin attr parsing) #140612
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
Comments
@theemathas's MCVE from #137687 (comment) reproduced here: Minimized from the levi repo (from the crater results): src/lib.rs: macro_rules! call_macro {
($text:expr) => {
#[derive(bar::Bar)]
#[arg($text)]
pub struct Foo;
};
}
call_macro!(1 + 1); bar/src/lib.rs extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_derive(Bar, attributes(arg))]
pub fn derive_bar(_: proc_macro::TokenStream) -> proc_macro::TokenStream {
TokenStream::new()
} Zip of all files required for reproduction: repro.zip |
@fmease's remark on #137687 (comment) edited to clarify which issue it refers to: Nota bene: ICE #137687 != the 3 ICEs from the crater regression (this issue #140612)! ICE #137687 triggers the This is relevant/important because PR #124141 unintentionally fixed these crater regressions (#140612) and ICE on master but not ICE #137687 (of which we don't know if it's likely to be hit by real users and thus worth hotfixing on beta). For that, subscribe to draft PR #140584. |
Discussed in #t-compiler/prioritization/alerts > #140612 regression: ICE: expr in place where literal is exp…, this regresses user macros and seems reasonably easy to hit, so @rustbot label: -I-prioritize +P-critical |
To make it easier to follow, there's a beta-targeting fix in #140601. Assigning fmease since they already have an open PR (thanks!). |
Tip
This is not a duplicate of #140219, this one is delayed at
compiler/rustc_attr_parsing/src/parser.rs:498:34
and was found via crater, that is known to impact user macros. This is extracted from #137687 (comment).Crater results
Crater #139827:
https://crater-reports.s3.amazonaws.com/beta-1.87-2/beta-2025-04-13/gh/0x4C656F.levi.rs/log.txt
ICE backtrace
https://crater-reports.s3.amazonaws.com/beta-1.87-2/beta-2025-04-13/gh/Hywan.weld/log.txt
ICE backtrace
https://crater-reports.s3.amazonaws.com/beta-1.87-2/beta-2025-04-13/gh/oberien.rebo/log.txt
ICE backtrace
Version it worked on
It most recently worked on:
1.86.0
Version with regression
rustc 1.87.0-beta.4 (a594829 2025-04-12) in crater #139827.
@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged
The text was updated successfully, but these errors were encountered: