-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor + improve diagnostics for &mut T
/T
mismatch inside Option/Result
#114150
Refactor + improve diagnostics for &mut T
/T
mismatch inside Option/Result
#114150
Conversation
span, def_path | ||
} | ||
} else if let Some(expected_ty_expr) = expected_ty_expr | ||
// FIXME: suggest changes to both expressions to convert both to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly we could have a multipart suggestion to add .as_ref()
to one side and .as_deref()
to the other, but that somewhat duplicates an existing diagnostic that adds .as_deref()
, so not sure of the best solution here
use crate::errors::{ | ||
AddReturnTypeSuggestion, ExpectedReturnTypeLabel, SuggestBoxing, SuggestConvertViaMethod, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason to remove those imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be using errors::
in the code instead of importing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iirc the main reason being preventing merge conflicts as diagnostic imports tend to get changed a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
@bors r+ (I was sure I did this already but apparently not?) |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f9f674f): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 653.409s -> 651.072s (-0.36%) |
Follow up to #114052. This also makes the diagnostics structured + translatable.
r? @WaffleLapkin