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

Another macro ICE #68060

Closed
olegnn opened this issue Jan 9, 2020 · 5 comments · Fixed by #69154
Closed

Another macro ICE #68060

olegnn opened this issue Jan 9, 2020 · 5 comments · Fixed by #69154
Labels
A-closures Area: Closures (`|…| { … }`) A-codegen Area: Code generation A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-type-system Area: Type system C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@olegnn
Copy link
Contributor

olegnn commented Jan 9, 2020

This code

fn calc(width: usize) -> Vec<usize> {
    (0..width)
        .map(
            #[target_feature(enable = "avx2")]
            |y| y,
        )
        .collect()
}

fn main() {
    println!("ICE {:?}", calc(8));
}

(Playground)

Produces ICE on any channel

   Compiling playground v0.0.1 (/playground)
error: internal compiler error: src/librustc_typeck/collect.rs:1898: to get the signature of a closure, use `closure_sig()` not `fn_sig()`

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:931:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.40.0 (73528e339 2019-12-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error

error: could not compile `playground`.
@jonas-schievink jonas-schievink added A-closures Area: Closures (`|…| { … }`) A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 9, 2020
@petrochenkov
Copy link
Contributor

This is the same issue as #68058, attributes on expressions are not converted into HIR properly.

@olegnn
Copy link
Contributor Author

olegnn commented Jan 20, 2020

@petrochenkov I checked on latest nightly - #68058 isn't produced anymore while this one still throws ICE.

@olegnn
Copy link
Contributor Author

olegnn commented Jan 20, 2020

@jonas-schievink could you reopen this issue?

@Centril Centril added A-codegen Area: Code generation A-type-system Area: Type system labels Jan 23, 2020
@pnkfelix
Copy link
Member

triage: P-high. Removing nomination.

@pnkfelix pnkfelix added P-high High priority and removed I-nominated labels Jan 23, 2020
@Centril
Copy link
Contributor

Centril commented Jan 23, 2020

Reduced somewhat:

fn main() {
    (0..)
        .map(
            #[target_feature(enable = "")]
            |_| (),
        )
        .next();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-closures Area: Closures (`|…| { … }`) A-codegen Area: Code generation A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) A-type-system Area: Type system C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority 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.

6 participants