Rollup merge of #102763 - compiler-errors:nits, r=cjgillot
Some diagnostic-related nits 1. Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` 2. Make `diag.span_suggestions` take an `IntoIterator` instead of `Iterator`, just to remove some `.into_iter` calls on the caller. idk if I should add a lint to make sure people use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` in cases where we're just, e.g., adding subdiagnostics to the diagnostic... maybe a followup.
This commit is contained in:
commit
e5ecf629dd
7 changed files with 26 additions and 32 deletions
|
@ -1116,7 +1116,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
err.span_suggestions(
|
||||
span.shrink_to_lo(),
|
||||
"consider borrowing here",
|
||||
["&".to_string(), "&mut ".to_string()].into_iter(),
|
||||
["&".to_string(), "&mut ".to_string()],
|
||||
Applicability::MaybeIncorrect,
|
||||
);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue