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