summary refs log tree commit diff
path: root/src/test/ui/issues/issue-39984.rs
blob: 5018b1c62c770d1d79b8a8ee7ff5163e0286582d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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(())
}