Open
Description
Reported by @xfix in #33417 (comment).
trait MyTrait {
type Output;
}
impl<T> MyTrait for fn() -> T {
type Output = T;
}
type Void = <fn() -> ! as MyTrait>::Output;
fn main() {
let _a: Void;
}
The never type is unstable (#35121) but the code above (which doesn’t use any feature gate) compiles in Rust 1.12.0 (which I think is the first with #35162), 1.32.0, and 1.34.0-nightly (aadbc45 2019-02-23). In 1.11.0, it errors with:
error: the trait bound `fn() -> !: MyTrait` is not satisfied [--explain E0277]
--> a.rs:12:13
|>
12 |> let _a: Void;
|> ^^^^
help: the following implementations were found:
help: <fn() -> T as MyTrait>
error: aborting due to previous error