-
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!). |
…olated_BETA, r=nnethercote [beta] [also fit for beta rollup] [HOTFIX] Don't delay a bug on malformed meta items involving interpolated tokens Directly fixes rust-lang#140612. <details><summary>Outdated Information</summary> Directly fixes the 3 crater regressions reported in rust-lang#137687 (comment) (NB: The containing issue rust-lang#137687 is in fact *not* an instance of these regressions, see rust-lang#137687 (comment)). </details> **Why is this a separate PR for `beta`**? Well, the crater regressions were already fixed on master albeit unintentionally so, namely by PR rust-lang#124141 which we **certainly** don't want to backport! So this is simply a hotfix. PR rust-lang#140584 will then provide the regression test for master, too, so it doesn't get 'lost'. [`@]T-release,` if/once accepted by T-compiler, this PR will be fit for beta rollup and can be cherry-picked. <details><summary>Slightly Outdated & Irrelevant Information</summary> FYI, we may also want to (separately) backport PR rust-lang#140584 to [fix] rust-lang#137687 (which, again, is not an instance of the crater regressions) but it's unclear if it's really necessary (since it's fuzzer-generated and I don't know of any real users who are impacted). </details> cc `@jdonszelmann` r? fmease
Stable fix/backport in #140859. Closing as completed. |
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: