2014-04-12 03:16:37 -05:00
|
|
|
// Regression test for #13466
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
// The expected arm type `Option<T>` has one type parameter, while
|
|
|
|
// the actual arm `Result<T, E>` has two. typeck should not be
|
|
|
|
// tricked into looking up a non-existing second type parameter.
|
2015-03-03 02:42:26 -06:00
|
|
|
let _x: usize = match Some(1) {
|
2015-01-12 00:01:44 -06:00
|
|
|
Ok(u) => u,
|
|
|
|
//~^ ERROR mismatched types
|
2020-09-02 02:40:56 -05:00
|
|
|
//~| expected enum `Option<{integer}>`
|
2021-01-28 10:01:36 -06:00
|
|
|
//~| found enum `Result<_, _>`
|
2023-01-02 20:00:33 -06:00
|
|
|
//~| expected `Option<{integer}>`, found `Result<_, _>`
|
2015-01-12 00:01:44 -06:00
|
|
|
|
|
|
|
Err(e) => panic!(e)
|
|
|
|
//~^ ERROR mismatched types
|
2020-09-02 02:40:56 -05:00
|
|
|
//~| expected enum `Option<{integer}>`
|
2021-01-28 10:01:36 -06:00
|
|
|
//~| found enum `Result<_, _>`
|
2023-01-02 20:00:33 -06:00
|
|
|
//~| expected `Option<{integer}>`, found `Result<_, _>`
|
2014-04-12 03:16:37 -05:00
|
|
|
};
|
|
|
|
}
|