Closed
Description
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
Labels
Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.The Rustc Trait System Refactor Initiative (-Znext-solver)This issue requires a build of rustc or tooling with debug-assertions in some way