rust/src/test/ui/issues/issue-39984.rs
2018-12-25 21:08:33 -07:00

15 lines
316 B
Rust

// compile-pass
#![allow(dead_code)]
#![allow(unreachable_code)]
// Regression test for issue #39984.
//
// The key here is that the error type of the `Ok` call ought to be
// constrained to `String`, even though it is dead-code.
fn main() {}
fn t() -> Result<(), String> {
return Err("".into());
Ok(())
}