1 // revisions: nofallback fallback
2 //[nofallback] run-pass
3 //[fallback] check-fail
5 // We need to opt into the `never_type_fallback` feature
6 // to trigger the requirement that this is testing.
7 #![cfg_attr(fallback, feature(never_type, never_type_fallback))]
11 trait Deserialize: Sized {
12 fn deserialize() -> Result<Self, String>;
15 impl Deserialize for () {
16 fn deserialize() -> Result<(), String> {
21 trait ImplementedForUnitButNotNever {}
23 impl ImplementedForUnitButNotNever for () {}
25 fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
26 //[fallback]~^ NOTE required by this bound in `foo`
27 //[fallback]~| NOTE required by a bound in `foo`
31 //[fallback]~^ ERROR the trait bound
32 //[fallback]~| NOTE the trait `ImplementedForUnitButNotNever` is not implemented
33 //[fallback]~| HELP trait `ImplementedForUnitButNotNever` is implemented for `()`
34 //[fallback]~| NOTE this error might have been caused
35 //[fallback]~| NOTE required by a bound introduced by this call
36 //[fallback]~| HELP did you intend