summary refs log tree commit diff
path: root/src/test/ui/traits/reservation-impls/reservation-impl-no-use.rs
blob: 3391daaabe975a663c62f3f44a8a6ae14f0198b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// compile-fail

// check that reservation impls can't be used as normal impls in positive reasoning.

#![feature(rustc_attrs)]

trait MyTrait { fn foo(&self); }
#[rustc_reservation_impl = "foo"]
impl MyTrait for () { fn foo(&self) {} }

fn main() {
    <() as MyTrait>::foo(&());
    //~^ ERROR the trait bound `(): MyTrait` is not satisfied
}