]> git.lizzy.rs Git - rust.git/blob - tests/ui/coherence/coherence-overlap-issue-23516-inherent.rs
Auto merge of #106853 - TimNN:undo-remap, r=oli-obk
[rust.git] / tests / ui / coherence / coherence-overlap-issue-23516-inherent.rs
1 // Tests that we consider `Box<U>: !Sugar` to be ambiguous, even
2 // though we see no impl of `Sugar` for `Box`. Therefore, an overlap
3 // error is reported for the following pair of impls (#23516).
4
5 pub trait Sugar {}
6
7 struct Cake<X>(X);
8
9 impl<T:Sugar> Cake<T> { fn dummy(&self) { } }
10 //~^ ERROR E0592
11 impl<U:Sugar> Cake<Box<U>> { fn dummy(&self) { } }
12
13 fn main() { }