-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-result-optionArea: Result and Option combinatorsArea: Result and Option combinatorsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
It would be really nice if the mismatched type diagnostic would work for as_deref
. Currently, trying to use Option<Vec<String>>
where Option<&[String]>
is expected doesn't give a method call suggestion the way one gets a suggestion to borrow when trying to use Vec<String>
where &[String]
is expected.
= note: expected enum `std::option::Option<&[std::string::String]>`
found enum `std::option::Option<Vec<std::string::String>>`
^ no suggestion
Metadata
Metadata
Assignees
Labels
A-result-optionArea: Result and Option combinatorsArea: Result and Option combinatorsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.