2023-09-20 14:41:19 -05:00
|
|
|
// revisions: old next
|
|
|
|
//[next] compile-flags: -Ztrait-solver=next
|
|
|
|
|
2015-03-30 16:49:30 -05:00
|
|
|
// Tests that we consider `Box<U>: !Sugar` to be ambiguous, even
|
|
|
|
// though we see no impl of `Sugar` for `Box`. Therefore, an overlap
|
|
|
|
// error is reported for the following pair of impls (#23516).
|
|
|
|
|
|
|
|
pub trait Sugar { fn dummy(&self) { } }
|
|
|
|
pub trait Sweet { fn dummy(&self) { } }
|
2015-12-29 23:18:24 -06:00
|
|
|
impl<T:Sugar> Sweet for T { }
|
2017-07-25 01:46:26 -05:00
|
|
|
impl<U:Sugar> Sweet for Box<U> { }
|
2019-10-26 10:28:02 -05:00
|
|
|
//~^ ERROR E0119
|
2017-07-25 01:46:26 -05:00
|
|
|
|
2015-03-30 16:49:30 -05:00
|
|
|
fn main() { }
|