]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-overlap-issue-23516.rs
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync
[rust.git] / src / test / ui / coherence / coherence-overlap-issue-23516.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 { fn dummy(&self) { } }
6 pub trait Sweet { fn dummy(&self) { } }
7 impl<T:Sugar> Sweet for T { }
8 impl<U:Sugar> Sweet for Box<U> { }
9 //~^ ERROR E0119
10
11 fn main() { }