]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/auto-traits/typeck-default-trait-impl-precedence.rs
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
3 // other words, the auto impl only applies if there are no existing
4 // impls whose types unify.
6 #![feature(auto_traits)]
7 #![feature(negative_impls)]
9 auto trait Defaulted { }
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
>() { }
15 impl Signed
for i32 { }
18 is_defaulted
::<&'
static i32>();
19 is_defaulted
::<&'
static u32>();
20 //~^ ERROR `u32: Signed` is not satisfied