Skip to content

broken MIR (NoSolution) in closure with a parameter whose type is an alias for a reference to an associated type #68090

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
purpleposeidon opened this issue Jan 10, 2020 · 6 comments
Labels
A-lazy-normalization Area: Lazy normalization (tracking issue: #60471) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-NLL Area: Non-lexical lifetimes (NLL) 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 regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@purpleposeidon
Copy link

pub fn main() {
    |_: ARef| ();
}

type ARef<'a> = &'a <() as ArrayLength>::ArrayType;

trait ArrayLength {
    type ArrayType;
}

impl ArrayLength for () {
    type ArrayType = u8;
}

(Playground (+ comments))

error: internal compiler error: broken MIR in DefId(0:13 ~ playground[a34e]::main[0]::{{closure}}[0]) (bb0[0]): equate_normalized_input_or_output: `&[closure@src/main.rs:5:5: 5:17]==&[closure@src/main.rs:5:5: 5:17]` failed with `NoSolution`
 --> src/main.rs:5:17
  |
5 |     |_: ARef| ();
  |                 ^

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:391:17

In prior versions, this error used to happen only very rarely, but now it happens every time.

@jonas-schievink jonas-schievink added A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html 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. C-bug Category: This is a bug. labels Jan 10, 2020
@purpleposeidon
Copy link
Author

Rustc bisect says no commits between 31a75a1 and 6d59933 within last 167 days.

It appears to have happened between 1.35 and 1.36.

@Centril Centril added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Jan 11, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jan 15, 2020
@pnkfelix
Copy link
Member

Specifically:

% git log 31a75a172..6d599337f --author=bors --format=oneline
6d599337fa7047307ba72786bbabe6b9c9e4daac Auto merge of #60168 - varkor:tidy-leading-newline, r=alexcrichton
c21fbfe7e310b9055ed6b7c46b7d37b831a516e3 Auto merge of #59114 - matthewjasper:enable-migate-2015, r=pnkfelix
a850a426491e14186af2250549bf41256b5938d2 Auto merge of #60133 - phansch:deny_rust_2018_idioms, r=Centril
8f06188991e8e7c764f0775a35432d39e2596c9a Auto merge of #60053 - Xanewok:serde-save-analysis, r=nrc
247b505099ce96b0fbf686249ff410a893793ed7 Auto merge of #60158 - Xanewok:update-clippy, r=matthiaskrgr

Its because of the NLL migration in #59114

If you rerun the test with --edition 2018 to enable NLL, you'll hit the ICE earlier than 31a75a1

@pnkfelix
Copy link
Member

T-compiler triage: P-high, removing nomination, adding A-NLL.

@pnkfelix pnkfelix added A-NLL Area: Non-lexical lifetimes (NLL) P-high High priority and removed I-nominated labels Jan 16, 2020
@pnkfelix
Copy link
Member

(I do wonder whether #65989 would address this...)

@pnkfelix
Copy link
Member

(or it might just be another case where we need lazy normalization ...)

@jackh726
Copy link
Member

Closing since there's a similar regression test in#85499

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-lazy-normalization Area: Lazy normalization (tracking issue: #60471) A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html A-NLL Area: Non-lexical lifetimes (NLL) 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 regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants