]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/diverging-fallback-method-chain.rs
1 #![allow(unused_imports)]
2 // Test a regression found when building compiler. The `produce()`
3 // error type `T` winds up getting unified with result of `x.parse()`;
4 // the type of the closure given to `unwrap_or_else` needs to be
5 // inferred to `usize`.
7 use std
::num
::ParseIntError
;
9 fn produce
<T
>() -> Result
<&'
static str, T
> {
14 let x
: usize = produce()
15 .and_then(|x
| x
.parse())
16 .unwrap_or_else(|_
| panic
!());