rust/tests/ui/issues/issue-13466.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
720 B
Rust
Raw Normal View History

// 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.
let _x: usize = match Some(1) {
2015-01-12 06:01:44 +00:00
Ok(u) => u,
//~^ ERROR mismatched types
//~| expected enum `Option<{integer}>`
2021-01-28 16:01:36 +00:00
//~| found enum `Result<_, _>`
//~| expected `Option<{integer}>`, found `Result<_, _>`
2015-01-12 06:01:44 +00:00
Err(e) => panic!(e)
//~^ ERROR mismatched types
//~| expected enum `Option<{integer}>`
2021-01-28 16:01:36 +00:00
//~| found enum `Result<_, _>`
//~| expected `Option<{integer}>`, found `Result<_, _>`
};
}