about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-15 12:46:04 +0100
committerGitHub <noreply@github.com>2022-12-15 12:46:04 +0100
commitc0862f30bd0fa60370709a2f6e7eb4238aaf53fa (patch)
tree6c764153bd4a3160a9a5c4ef11eb3707258d61ff /compiler/rustc_errors/src
parentcb9bcafe0d5128d6381a836f7640c4de74ad64b3 (diff)
parentde59844c98f7925242a798a72c59dc3610dd0e2c (diff)
downloadrust-c0862f30bd0fa60370709a2f6e7eb4238aaf53fa.tar.gz
rust-c0862f30bd0fa60370709a2f6e7eb4238aaf53fa.zip
Rollup merge of #105722 - matthiaskrgr:compl2, r=compiler-errors
more clippy::complexity fixes

r? ```@compiler-errors```
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/emitter.rs2
-rw-r--r--compiler/rustc_errors/src/lib.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index c62e358e804..e2a0e436fd5 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -2313,7 +2313,7 @@ impl FileWithAnnotatedLines {
         }
 
         // Find overlapping multiline annotations, put them at different depths
-        multiline_annotations.sort_by_key(|&(_, ref ml)| (ml.line_start, usize::MAX - ml.line_end));
+        multiline_annotations.sort_by_key(|(_, ml)| (ml.line_start, usize::MAX - ml.line_end));
         for (_, ann) in multiline_annotations.clone() {
             for (_, a) in multiline_annotations.iter_mut() {
                 // Move all other multiline annotations overlapping with this one
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index eb0506c459a..518b5ec10f8 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -324,7 +324,7 @@ impl CodeSuggestion {
                         // Account for the difference between the width of the current code and the
                         // snippet being suggested, so that the *later* suggestions are correctly
                         // aligned on the screen.
-                        acc += len as isize - (cur_hi.col.0 - cur_lo.col.0) as isize;
+                        acc += len - (cur_hi.col.0 - cur_lo.col.0) as isize;
                     }
                     prev_hi = cur_hi;
                     prev_line = sf.get_line(prev_hi.line - 1);