]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-39984.rs
Auto merge of #78066 - bugadani:wat, r=jonas-schievink
[rust.git] / src / test / ui / issues / issue-39984.rs
1 // check-pass
2 #![allow(dead_code)]
3 #![allow(unreachable_code)]
4 // Regression test for issue #39984.
5 //
6 // The key here is that the error type of the `Ok` call ought to be
7 // constrained to `String`, even though it is dead-code.
8
9 fn main() {}
10
11 fn t() -> Result<(), String> {
12     return Err("".into());
13     Ok(())
14 }