2014-04-12 08:16:37 +00: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 08:42:26 +00:00
|
|
|
let _x: usize = match Some(1) {
|
2015-01-12 06:01:44 +00:00
|
|
|
Ok(u) => u,
|
|
|
|
//~^ ERROR mismatched types
|
2020-09-02 07:40:56 +00:00
|
|
|
//~| expected enum `Option<{integer}>`
|
2021-01-28 16:01:36 +00:00
|
|
|
//~| found enum `Result<_, _>`
|
2023-01-03 02:00:33 +00:00
|
|
|
//~| expected `Option<{integer}>`, found `Result<_, _>`
|
2015-01-12 06:01:44 +00:00
|
|
|
|
|
|
|
Err(e) => panic!(e)
|
|
|
|
//~^ ERROR mismatched types
|
2020-09-02 07:40:56 +00:00
|
|
|
//~| expected enum `Option<{integer}>`
|
2021-01-28 16:01:36 +00:00
|
|
|
//~| found enum `Result<_, _>`
|
2023-01-03 02:00:33 +00:00
|
|
|
//~| expected `Option<{integer}>`, found `Result<_, _>`
|
2014-04-12 08:16:37 +00:00
|
|
|
};
|
|
|
|
}
|