rust-lang / trait-system-refactor-initiative

The Rustc Trait System Refactor Initiative
21 stars 0 forks source link

try-block results in error #87

Open lcnr opened 8 months ago

lcnr commented 8 months ago

-Znext-solver

#![feature(try_blocks)]

fn consume<T>(_: Result<T, T>) -> T { todo!() }

fn main() {
    consume(try {});
}

currently results in

error[E0284]: type annotations needed: cannot satisfy `<Result<(), _> as Try>::Output == ()`
 --> <source>:7:18
  |
7 |     consume(try {});
  |                  ^ cannot satisfy `<Result<(), _> as Try>::Output == ()`