Skip to content

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

Description

@purpleposeidon
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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-NLLArea: Non-lexical lifetimes (NLL)A-lazy-normalizationArea: Lazy normalization (tracking issue: #60471)C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions