| //@ revisions: current next | |
| //@ ignore-compare-mode-next-solver (explicit revisions) | |
| //@[next] compile-flags: -Znext-solver | |
| //@[next] check-pass | |
| #![feature(type_alias_impl_trait)] | |
| type Foo = impl std::fmt::Debug; | |
| #[define_opaque(Foo)] | |
| fn foo(b: bool) -> Foo { | |
| if b { | |
| return 42; | |
| } | |
| let x: u32 = foo(false) + 42; //[current]~ ERROR cannot add | |
| 99 | |
| } | |
| fn bar(b: bool) -> impl std::fmt::Debug { | |
| if b { | |
| return 42; | |
| } | |
| let x: u32 = bar(false) + 42; //[current]~ ERROR cannot add | |
| 99 | |
| } | |
| fn main() {} |