2012-02-05 18:06:54 -08:00
|
|
|
// Issue #876
|
|
|
|
|
2014-03-21 22:37:41 +11:00
|
|
|
use std::vec::Vec;
|
2014-03-05 15:28:08 -08:00
|
|
|
|
2014-03-05 14:02:44 -08:00
|
|
|
fn last<T>(v: Vec<&T> ) -> std::option::Option<T> {
|
2019-02-15 20:31:00 +09:00
|
|
|
::std::panic!();
|
2012-02-05 18:06:54 -08:00
|
|
|
}
|
2011-09-01 12:27:49 -07:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let y;
|
|
|
|
let x : char = last(y);
|
2015-01-12 01:01:44 -05:00
|
|
|
//~^ ERROR mismatched types
|
2016-04-20 14:42:13 -04:00
|
|
|
//~| expected type `char`
|
2020-09-02 10:40:56 +03:00
|
|
|
//~| found enum `Option<_>`
|
2023-01-02 18:00:33 -08:00
|
|
|
//~| expected `char`, found `Option<_>`
|
2011-09-01 12:27:49 -07:00
|
|
|
}
|