Use chaining in DiagnosticBuilder
construction.
To avoid the use of a mutable local variable, and because it reads more nicely.
This commit is contained in:
parent
b1b9278851
commit
589591efde
22 changed files with 223 additions and 369 deletions
|
@ -367,9 +367,8 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
&trace.cause.code().peel_derives()
|
||||
{
|
||||
let span = *span;
|
||||
let mut err = self.report_concrete_failure(placeholder_origin, sub, sup);
|
||||
err.span_note(span, "the lifetime requirement is introduced here");
|
||||
err
|
||||
self.report_concrete_failure(placeholder_origin, sub, sup)
|
||||
.span_note_mv(span, "the lifetime requirement is introduced here")
|
||||
} else {
|
||||
unreachable!(
|
||||
"control flow ensures we have a `BindingObligation` or `ExprBindingObligation` here..."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue