From 61bc38ecaad8d2dae451f88b87e8d1ddd3735307 Mon Sep 17 00:00:00 2001 From: AnthonyMikh Date: Tue, 1 Oct 2019 02:38:35 +0300 Subject: [PATCH] Fix errors --- src/librustc_errors/emitter.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index 967b98b9b459..a9599edab4f3 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -949,9 +949,9 @@ impl EmitterWriter { // | | | // | | something about `foo` // | something about `fn foo()` - annotations_position.sort_by_key(|x| { - // Decreasing order. When `a` and `b` are the same length, prefer `Primary`. - (Reverse(a.1.len()), a.1.is_primary) + annotations_position.sort_by_key(|(_, ann)| { + // Decreasing order. When annotations share the same length, prefer `Primary`. + (Reverse(ann.len()), ann.is_primary) }); // Write the underlines. @@ -1006,14 +1006,14 @@ impl EmitterWriter { for primary_span in msp.primary_spans() { if !primary_span.is_dummy() { let hi = sm.lookup_char_pos(primary_span.hi()); - max = max(max, hi.line); + max = (hi.line).max(max); } } if !self.short_message { for span_label in msp.span_labels() { if !span_label.span.is_dummy() { let hi = sm.lookup_char_pos(span_label.span.hi()); - max = max(max, hi.line); + max = (hi.line).max(max); } } } @@ -1057,9 +1057,9 @@ impl EmitterWriter { let padding = " ".repeat(padding + label.len() + 5); /// Returns `override` if it is present and `style` is `NoStyle` or `style` otherwise - fn style_or_override(style: Style, override: Option