]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/reservation-impls/reservation-impl-no-use.rs
improve and add tests
[rust.git] / src / test / ui / traits / reservation-impls / reservation-impl-no-use.rs
1 // compile-fail
2
3 // check that reservation impls can't be used as normal impls in positive reasoning.
4
5 #![feature(rustc_attrs)]
6
7 trait MyTrait { fn foo(&self); }
8 #[rustc_reservation_impl]
9 impl MyTrait for () { fn foo(&self) {} }
10
11 fn main() {
12     <() as MyTrait>::foo(&());
13     //~^ ERROR the trait bound `(): MyTrait` is not satisfied
14 }