Skip to content

ICE with impl_trait_in_bindings #69840

Closed
@JohnTitor

Description

@JohnTitor

Code

This snippet is found in #60473.

Reduced:

#![feature(impl_trait_in_bindings)]
#![allow(incomplete_features)]

struct A<'a>(&'a ());

trait Trait<T> {}

impl<T> Trait<T> for () {}

pub fn foo<'a>() {
    let _x: impl Trait<A<'a>> = ();
}

fn main() {}

playground

playground (original)

Meta

rustc --version --verbose:

1.43.0-nightly (823ff8cf1 2020-03-07)

Error output

error: internal compiler error: opaque type with non-universal region substs
  --> src/main.rs:10:1
   |
10 | / pub fn foo<'a>() {
11 | |     let _x: impl Trait<A<'a>> = ();
12 | | }
   | |_^

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-impl_trait_in_bindings`#![feature(impl_trait_in_bindings)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions