]>
Commit | Line | Data |
---|---|---|
60c5eb7d | 1 | // check-pass |
0bf4aa26 XL |
2 | #![allow(dead_code)] |
3 | #![allow(unreachable_code)] | |
8bb4bdeb XL |
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. | |
32a655c1 | 8 | |
8bb4bdeb | 9 | fn main() {} |
32a655c1 | 10 | |
8bb4bdeb XL |
11 | fn t() -> Result<(), String> { |
12 | return Err("".into()); | |
13 | Ok(()) | |
54a0048b | 14 | } |