Skip to content

ICE: !ty.has_late_bound_regions() #115647

Closed
Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

rustc file.rs -Ztrait-solver=next-coherence -Zdrop-tracking-mir=yes

type OpaqueGenerator = impl Sized;
fn defining_use() -> OpaqueGenerator {
    |_f: Box<dyn for<'a> FnMut()>| {
        for i in 0..10 {
            yield i;
        }
    }
}

struct Wrapper<T>(T);
trait Trait {}
impl Trait for Wrapper<OpaqueGenerator> {}
impl<T: Sync> Trait for Wrapper<T> {}

Meta

rustc --version --verbose:

a0c28cd9dc99d9acb015d06f6b27c640adad3550

Error output

error[E0119]: conflicting implementations of trait `Trait` for type `Wrapper<OpaqueGenerator>`
  --> 9A730F9B7BDC30247AB1AB4E0ED6E1DBD6C609435F42A43B63141521154CA13E.rs:21:1
   |
20 | impl Trait for Wrapper<OpaqueGenerator> {}
   | --------------------------------------- first implementation here
21 | impl<T: Sync> Trait for Wrapper<T> {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Wrapper<OpaqueGenerator>`
   |
   = note: upstream crates may add a new impl of trait `std::marker::Sync` for type `dyn for<'a> std::ops::FnMut(&'a isize)` in future versions

error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.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.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions