about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/astconv/generics.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-01-03 17:03:10 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-01-08 15:45:29 +1100
commitbd4e623485f383b478fae662a767a3129bb4b989 (patch)
treefe4207cae336d51d0c29fd430b1d402d1de8339e /compiler/rustc_hir_analysis/src/astconv/generics.rs
parent589591efde6c54baa8b7932ec3be6f45dc9d781f (diff)
downloadrust-bd4e623485f383b478fae662a767a3129bb4b989.tar.gz
rust-bd4e623485f383b478fae662a767a3129bb4b989.zip
Use chaining for `DiagnosticBuilder` construction and `emit`.
To avoid the use of a mutable local variable, and because it reads more
nicely.
Diffstat (limited to 'compiler/rustc_hir_analysis/src/astconv/generics.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/astconv/generics.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/generics.rs b/compiler/rustc_hir_analysis/src/astconv/generics.rs
index 257b108471f..adc6a9de808 100644
--- a/compiler/rustc_hir_analysis/src/astconv/generics.rs
+++ b/compiler/rustc_hir_analysis/src/astconv/generics.rs
@@ -650,9 +650,9 @@ pub(crate) fn prohibit_explicit_late_bound_lifetimes(
         if position == GenericArgPosition::Value
             && args.num_lifetime_params() != param_counts.lifetimes
         {
-            let mut err = struct_span_err!(tcx.dcx(), span, E0794, "{}", msg);
-            err.span_note(span_late, note);
-            err.emit();
+            struct_span_err!(tcx.dcx(), span, E0794, "{}", msg)
+                .span_note_mv(span_late, note)
+                .emit();
         } else {
             let mut multispan = MultiSpan::from_span(span);
             multispan.push_span_label(span_late, note);