1 // We need to opt into the `!` feature in order to trigger the
2 // requirement that this is testing.
3 #![feature(never_type)]
7 trait Deserialize: Sized {
8 fn deserialize() -> Result<Self, String>;
11 impl Deserialize for () {
12 fn deserialize() -> Result<(), String> {
17 trait ImplementedForUnitButNotNever {}
19 impl ImplementedForUnitButNotNever for () {}
21 fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
22 //~^ NOTE required by `foo`
27 //~^ ERROR the trait bound
28 //~| NOTE the trait `ImplementedForUnitButNotNever` is not implemented
29 //~| NOTE the trait is implemented for `()`