]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-39984.rs
Auto merge of #106827 - alexcrichton:update-llvm-to-15.0.7, r=cuviper
[rust.git] / tests / 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 }