]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/mut-ref-reassignment.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / suggestions / mut-ref-reassignment.rs
CommitLineData
dc9dc135
XL
1fn suggestion(opt: &mut Option<String>) {
2 opt = None; //~ ERROR mismatched types
3}
4
5fn no_suggestion(opt: &mut Result<String, ()>) {
6 opt = None //~ ERROR mismatched types
7}
8
9fn suggestion2(opt: &mut Option<String>) {
10 opt = Some(String::new())//~ ERROR mismatched types
11}
12
13fn no_suggestion2(opt: &mut Option<String>) {
14 opt = Some(42)//~ ERROR mismatched types
15}
16
17fn main() {}