]>
Commit | Line | Data |
---|---|---|
c34b1796 AL |
1 | // Test that declaring that `&T` is `Defaulted` if `T:Signed` implies |
2 | // that other `&T` is NOT `Defaulted` if `T:Signed` does not hold. In | |
2c00a5a8 | 3 | // other words, the auto impl only applies if there are no existing |
c34b1796 AL |
4 | // impls whose types unify. |
5 | ||
6 | #![feature(optin_builtin_traits)] | |
ba9703b0 | 7 | #![feature(negative_impls)] |
c34b1796 | 8 | |
2c00a5a8 | 9 | auto trait Defaulted { } |
c34b1796 AL |
10 | impl<'a,T:Signed> Defaulted for &'a T { } |
11 | impl<'a,T:Signed> Defaulted for &'a mut T { } | |
12 | fn is_defaulted<T:Defaulted>() { } | |
13 | ||
9346a6ac | 14 | trait Signed { } |
c34b1796 AL |
15 | impl Signed for i32 { } |
16 | ||
17 | fn main() { | |
18 | is_defaulted::<&'static i32>(); | |
19 | is_defaulted::<&'static u32>(); | |
54a0048b | 20 | //~^ ERROR `u32: Signed` is not satisfied |
c34b1796 | 21 | } |