2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unreachable_code)]
|
2017-03-18 11:28:34 -05:00
|
|
|
// 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(())
|
|
|
|
}
|