impl Trait
fails to resolve when returning !
(original) (raw)
I couldn't think of a better title.
This code doesn't compile on nightly :
#![feature(conservative_impl_trait)] use std::ops::Add ;
fn test() -> impl Add { unimplemented!() }
fn main() {}
rustc 1.13.0-nightly (378195665 2016-09-08)
error[E0277]: the trait bound `(): std::ops::Add<u32>` is not satisfied
while this does :
#![feature(conservative_impl_trait)] use std::ops::Add ;
fn test() -> impl Add { if true { unimplemented!() } else { 0 } }
fn main() {}