rust/src/test/ui/never_type/feature-gate-never_type_fal...

13 lines
352 B
Rust
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// This is a feature gate test for `never_type_fallback`.
// It works by using a scenario where the type fall backs to `()` rather than ´!`
// in the case where `#![feature(never_type_fallback)]` would change it to `!`.
fn main() {}
trait T {}
fn should_ret_unit() -> impl T {
//~^ ERROR the trait bound `(): T` is not satisfied
panic!()
}