Skip to content
/ rust Public
forked from rust-lang/rust

Commit 47b559d

Browse files
committed
rustc_borrowck: suggest_ampmut(): Inline unneeded local var
Since the previos commit renamed `assignment_rhs_span` to just `rhs_span` there is no need for a variable just to shorten the expression on the next line. Inline the variable.
1 parent bfb027a commit 47b559d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1500,9 +1500,8 @@ fn suggest_ampmut<'tcx>(
15001500
// if the reference is already mutable then there is nothing we can do
15011501
// here.
15021502
if !is_mut {
1503-
let span = rhs_span;
15041503
// shrink the span to just after the `&` in `&variable`
1505-
let span = span.with_lo(span.lo() + BytePos(1)).shrink_to_lo();
1504+
let span = rhs_span.with_lo(rhs_span.lo() + BytePos(1)).shrink_to_lo();
15061505

15071506
// FIXME(Ezrashaw): returning is bad because we still might want to
15081507
// update the annotated type, see #106857.

0 commit comments

Comments
 (0)