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
|
2019-11-13 16:16:56 -06:00
|
|
|
//~| expected enum `std::option::Option<{integer}>`
|
|
|
|
//~| found enum `std::result::Result<_, _>`
|
2016-04-20 13:42:13 -05:00
|
|
|
//~| expected enum `std::option::Option`, found enum `std::result::Result`
|
2015-01-12 00:01:44 -06:00
|
|
|
|
|
|
|
Err(e) => panic!(e)
|
|
|
|
//~^ ERROR mismatched types
|
2019-11-13 16:16:56 -06:00
|
|
|
//~| expected enum `std::option::Option<{integer}>`
|
|
|
|
//~| found enum `std::result::Result<_, _>`
|
2016-04-20 13:42:13 -05:00
|
|
|
//~| expected enum `std::option::Option`, found enum `std::result::Result`
|
2014-04-12 03:16:37 -05:00
|
|
|
};
|
|
|
|
}
|