mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
18 lines
391 B
Rust
18 lines
391 B
Rust
fn suggestion(opt: &mut Option<String>) {
|
|
opt = None; //~ ERROR mismatched types
|
|
}
|
|
|
|
fn no_suggestion(opt: &mut Result<String, ()>) {
|
|
opt = None //~ ERROR mismatched types
|
|
}
|
|
|
|
fn suggestion2(opt: &mut Option<String>) {
|
|
opt = Some(String::new())//~ ERROR mismatched types
|
|
}
|
|
|
|
fn no_suggestion2(opt: &mut Option<String>) {
|
|
opt = Some(42)//~ ERROR mismatched types
|
|
}
|
|
|
|
fn main() {}
|