]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-39984.rs
New upstream version 1.41.1+dfsg1
[rustc.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 }