mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
10 lines
255 B
Rust
10 lines
255 B
Rust
fn takes_option(_arg: Option<&String>) {}
|
|
|
|
fn main() {
|
|
takes_option(&None); //~ ERROR 4:18: 4:23: mismatched types [E0308]
|
|
|
|
let x = String::from("x");
|
|
let res = Some(x);
|
|
takes_option(&res); //~ ERROR 8:18: 8:22: mismatched types [E0308]
|
|
}
|