-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
fn change_opt(opt: &mut Option<String>){
opt = None
}
<anon>:2:11: 2:15 error: mismatched types:
expected `&mut core::option::Option<collections::string::String>`,
found `core::option::Option<_>`
(expected &-ptr,
found enum `core::option::Option`) [E0308]
<anon>:2 opt = None
^~~~
<anon>:2:11: 2:15 help: see the detailed explanation for E0308
error: aborting due to previous error
It'd be great if this had a hint:
Did you mean `*opt = None`
Someone on IRC just ran into this.
hanna-kruppe and oli-obk
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.