Skip to content
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

ICE in rollup #94523

Closed
Dylan-DPC opened this issue Mar 2, 2022 · 2 comments · Fixed by #94554
Closed

ICE in rollup #94523

Dylan-DPC opened this issue Mar 2, 2022 · 2 comments · Fixed by #94554
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Dylan-DPC
Copy link
Member

ICE encountered in a rollup, will post more details when i trace it further:

@Dylan-DPC Dylan-DPC added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Mar 2, 2022
@Urgau
Copy link
Member

Urgau commented Mar 2, 2022

I am able to reproduce the issue with this code and rustc -Z unstable-options --check-cfg=names():

macro_rules! aa {
    () => {
        fn gg() {
            #[cfg(crossbeam_loom)]
            {
                let _ = val;
                unimplemented!("loom does not support non-atomic atomic ops");
            }
        }
    };
}

fn main() {
    aa!();
}

And it's combination of #94433 ("introduce" the ICE, preexisting issue) and #94298 (trigger the lint which trigger the ICE).

@Urgau
Copy link
Member

Urgau commented Mar 2, 2022

Further reduced to:

fn main() {
    #[cfg(crossbeam_loom)]
    {}
}

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Mar 3, 2022
Fix invalid lint_node_id being put on a removed stmt

This pull-request remove a invalid `assign_id!` being put on an stmt node.

The problem is that this node is being removed away by a cfg making it unreachable when triggering a buffered lint.
The comment in the other match arm already tell to not assign a id because it could have a `#[cfg()]` so this is just respecting the comment.

Fixes rust-lang#94523
r? `@petrochenkov`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Mar 3, 2022
Fix invalid lint_node_id being put on a removed stmt

This pull-request remove a invalid `assign_id!` being put on an stmt node.

The problem is that this node is being removed away by a cfg making it unreachable when triggering a buffered lint.
The comment in the other match arm already tell to not assign a id because it could have a `#[cfg()]` so this is just respecting the comment.

Fixes rust-lang#94523
r? `````@petrochenkov`````
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 3, 2022
Fix invalid lint_node_id being put on a removed stmt

This pull-request remove a invalid `assign_id!` being put on an stmt node.

The problem is that this node is being removed away by a cfg making it unreachable when triggering a buffered lint.
The comment in the other match arm already tell to not assign a id because it could have a `#[cfg()]` so this is just respecting the comment.

Fixes rust-lang#94523
r? ``````@petrochenkov``````
@bors bors closed this as completed in 26cbf91 Mar 4, 2022
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. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants