2019-05-23 12:32:01 -05:00
|
|
|
fn suggestion(opt: &mut Option<String>) {
|
|
|
|
opt = None; //~ ERROR mismatched types
|
|
|
|
}
|
|
|
|
|
|
|
|
fn no_suggestion(opt: &mut Result<String, ()>) {
|
2019-05-22 15:10:38 -05:00
|
|
|
opt = None //~ ERROR mismatched types
|
|
|
|
}
|
|
|
|
|
2019-05-23 12:32:01 -05:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2019-05-22 15:10:38 -05:00
|
|
|
fn main() {}
|