From e7f4a9bb465fd7694d9a25c56a7c8eebf73893d1 Mon Sep 17 00:00:00 2001
From: Laurent Mazare <mazare@google.com>
Date: Mon, 20 Nov 2017 07:47:28 +0000
Subject: [PATCH] Fix for the new nightly version.

---
 tests/ui/booleans.stderr               |  3 ---
 tests/ui/collapsible_if.stderr         | 12 ------------
 tests/ui/for_loop.stderr               | 21 ---------------------
 tests/ui/implicit_hasher.stderr        |  9 ---------
 tests/ui/int_plus_one.stderr           |  3 ---
 tests/ui/large_enum_variant.stderr     |  2 --
 tests/ui/literals.stderr               |  1 -
 tests/ui/matches.stderr                |  2 --
 tests/ui/methods.stderr                |  1 -
 tests/ui/needless_pass_by_value.stderr |  4 ----
 tests/ui/needless_range_loop.stderr    |  2 --
 tests/ui/new_without_default.stderr    |  1 -
 tests/ui/ptr_arg.stderr                |  3 ---
 13 files changed, 64 deletions(-)

diff --git a/tests/ui/booleans.stderr b/tests/ui/booleans.stderr
index 37b9b3941df..6367ba0348c 100644
--- a/tests/ui/booleans.stderr
+++ b/tests/ui/booleans.stderr
@@ -72,7 +72,6 @@ error: this boolean expression can be simplified
    |
 34 |     let _ = a == b && c == 5 && a == b;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: try
    |
 34 |     let _ = a == b && c == 5;
@@ -85,7 +84,6 @@ error: this boolean expression can be simplified
    |
 35 |     let _ = a == b && c == 5 && b == a;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: try
    |
 35 |     let _ = a == b && c == 5;
@@ -122,7 +120,6 @@ error: this boolean expression can be simplified
    |
 39 |     let _ = a != b || !(a != b || c == d);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: try
    |
 39 |     let _ = c != d || a != b;
diff --git a/tests/ui/collapsible_if.stderr b/tests/ui/collapsible_if.stderr
index e726a36282b..bc10afcedb3 100644
--- a/tests/ui/collapsible_if.stderr
+++ b/tests/ui/collapsible_if.stderr
@@ -25,7 +25,6 @@ error: this if statement can be collapsed
 17 | |         }
 18 | |     }
    | |_____^
-   |
 help: try
    |
 14 |     if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
@@ -42,7 +41,6 @@ error: this if statement can be collapsed
 23 | |         }
 24 | |     }
    | |_____^
-   |
 help: try
    |
 20 |     if x == "hello" && x == "world" && (y == "world" || y == "hello") {
@@ -59,7 +57,6 @@ error: this if statement can be collapsed
 29 | |         }
 30 | |     }
    | |_____^
-   |
 help: try
    |
 26 |     if (x == "hello" || x == "world") && y == "world" && y == "hello" {
@@ -76,7 +73,6 @@ error: this if statement can be collapsed
 35 | |         }
 36 | |     }
    | |_____^
-   |
 help: try
    |
 32 |     if x == "hello" && x == "world" && y == "world" && y == "hello" {
@@ -93,7 +89,6 @@ error: this if statement can be collapsed
 41 | |         }
 42 | |     }
    | |_____^
-   |
 help: try
    |
 38 |     if 42 == 1337 && 'a' != 'A' {
@@ -111,7 +106,6 @@ error: this `else { if .. }` block can be collapsed
 50 | |         }
 51 | |     }
    | |_____^
-   |
 help: try
    |
 47 |     } else if y == "world" {
@@ -129,7 +123,6 @@ error: this `else { if .. }` block can be collapsed
 58 | |         }
 59 | |     }
    | |_____^
-   |
 help: try
    |
 55 |     } else if let Some(42) = Some(42) {
@@ -149,7 +142,6 @@ error: this `else { if .. }` block can be collapsed
 69 | |         }
 70 | |     }
    | |_____^
-   |
 help: try
    |
 63 |     } else if y == "world" {
@@ -172,7 +164,6 @@ error: this `else { if .. }` block can be collapsed
 80 | |         }
 81 | |     }
    | |_____^
-   |
 help: try
    |
 74 |     } else if let Some(42) = Some(42) {
@@ -195,7 +186,6 @@ error: this `else { if .. }` block can be collapsed
 91 | |         }
 92 | |     }
    | |_____^
-   |
 help: try
    |
 85 |     } else if let Some(42) = Some(42) {
@@ -218,7 +208,6 @@ error: this `else { if .. }` block can be collapsed
 102 | |         }
 103 | |     }
     | |_____^
-    |
 help: try
     |
 96  |     } else if x == "hello" {
@@ -241,7 +230,6 @@ error: this `else { if .. }` block can be collapsed
 113 | |         }
 114 | |     }
     | |_____^
-    |
 help: try
     |
 107 |     } else if let Some(42) = Some(42) {
diff --git a/tests/ui/for_loop.stderr b/tests/ui/for_loop.stderr
index f968e088866..b09350970fc 100644
--- a/tests/ui/for_loop.stderr
+++ b/tests/ui/for_loop.stderr
@@ -91,7 +91,6 @@ error: the loop variable `i` is only used to index `vec`.
 96 | |         let _ = vec[i];
 97 | |     }
    | |_____^
-   |
 help: consider using an iterator
    |
 95 |     for <item> in &vec {
@@ -104,7 +103,6 @@ error: the loop variable `j` is only used to index `STATIC`.
 101 | |         println!("{:?}", STATIC[j]);
 102 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 100 |     for <item> in STATIC.iter().take(4) {
@@ -117,7 +115,6 @@ error: the loop variable `j` is only used to index `CONST`.
 105 | |         println!("{:?}", CONST[j]);
 106 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 104 |     for <item> in CONST.iter().take(4) {
@@ -130,7 +127,6 @@ error: the loop variable `i` is used to index `vec`
 109 | |         println!("{} {}", vec[i], i);
 110 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 108 |     for (i, <item>) in vec.iter().enumerate() {
@@ -143,7 +139,6 @@ error: the loop variable `i` is only used to index `vec2`.
 117 | |         println!("{}", vec2[i]);
 118 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 116 |     for <item> in vec2.iter().take(vec.len()) {
@@ -156,7 +151,6 @@ error: the loop variable `i` is only used to index `vec`.
 121 | |         println!("{}", vec[i]);
 122 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 120 |     for <item> in vec.iter().skip(5) {
@@ -169,7 +163,6 @@ error: the loop variable `i` is only used to index `vec`.
 125 | |         println!("{}", vec[i]);
 126 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 124 |     for <item> in vec.iter().take(MAX_LEN) {
@@ -182,7 +175,6 @@ error: the loop variable `i` is only used to index `vec`.
 129 | |         println!("{}", vec[i]);
 130 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 128 |     for <item> in vec.iter().take(MAX_LEN + 1) {
@@ -195,7 +187,6 @@ error: the loop variable `i` is only used to index `vec`.
 133 | |         println!("{}", vec[i]);
 134 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 132 |     for <item> in vec.iter().take(10).skip(5) {
@@ -208,7 +199,6 @@ error: the loop variable `i` is only used to index `vec`.
 137 | |         println!("{}", vec[i]);
 138 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 136 |     for <item> in vec.iter().take(10 + 1).skip(5) {
@@ -221,7 +211,6 @@ error: the loop variable `i` is used to index `vec`
 141 | |         println!("{} {}", vec[i], i);
 142 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 140 |     for (i, <item>) in vec.iter().enumerate().skip(5) {
@@ -234,7 +223,6 @@ error: the loop variable `i` is used to index `vec`
 145 | |         println!("{} {}", vec[i], i);
 146 | |     }
     | |_____^
-    |
 help: consider using an iterator
     |
 144 |     for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
@@ -261,7 +249,6 @@ error: this range is empty so this for loop will never run
 153 | |         println!("{}", i);
 154 | |     }
     | |_____^
-    |
 help: consider using the following if you are attempting to iterate over this range in reverse
     |
 152 |     for i in (0...10).rev() {
@@ -274,7 +261,6 @@ error: this range is empty so this for loop will never run
 157 | |         println!("{}", i);
 158 | |     }
     | |_____^
-    |
 help: consider using the following if you are attempting to iterate over this range in reverse
     |
 156 |     for i in (0..MAX_LEN).rev() {
@@ -295,7 +281,6 @@ error: this range is empty so this for loop will never run
 186 | |         println!("{}", i);
 187 | |     }
     | |_____^
-    |
 help: consider using the following if you are attempting to iterate over this range in reverse
     |
 185 |     for i in (5 + 4..10).rev() {
@@ -308,7 +293,6 @@ error: this range is empty so this for loop will never run
 190 | |         println!("{}", i);
 191 | |     }
     | |_____^
-    |
 help: consider using the following if you are attempting to iterate over this range in reverse
     |
 189 |     for i in ((3 - 1)..(5 + 2)).rev() {
@@ -460,7 +444,6 @@ error: you seem to want to iterate on a map's values
 394 | |         // `in *m.values()` as we used to
 395 | |     }
     | |_____^
-    |
 help: use the corresponding method
     |
 390 |     for v in (*m).values() {
@@ -473,7 +456,6 @@ error: you seem to want to iterate on a map's values
 399 | |         let _v = v;
 400 | |     }
     | |_____^
-    |
 help: use the corresponding method
     |
 398 |     for v in m.values_mut() {
@@ -486,7 +468,6 @@ error: you seem to want to iterate on a map's values
 404 | |         let _v = v;
 405 | |     }
     | |_____^
-    |
 help: use the corresponding method
     |
 403 |     for v in (*m).values_mut() {
@@ -499,7 +480,6 @@ error: you seem to want to iterate on a map's keys
 410 | |         let _k = k;
 411 | |     }
     | |_____^
-    |
 help: use the corresponding method
     |
 409 |     for k in rm.keys() {
@@ -555,7 +535,6 @@ error: it looks like you're manually copying between slices
 497 | |         dst2[i + 500] = src[i]
 498 | |     }
     | |_____^
-    |
 help: try replacing the loop by
     |
 495 |     dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])
diff --git a/tests/ui/implicit_hasher.stderr b/tests/ui/implicit_hasher.stderr
index 52b686bf8ae..aaa1e37ca82 100644
--- a/tests/ui/implicit_hasher.stderr
+++ b/tests/ui/implicit_hasher.stderr
@@ -19,7 +19,6 @@ error: impl for `HashMap` should be generalized over different hashers
    |
 20 | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
    |                                    ^^^^^^^^^^^^^
-   |
 help: consider adding a type parameter
    |
 20 | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
@@ -34,7 +33,6 @@ error: impl for `HashMap` should be generalized over different hashers
    |
 25 | impl Foo<i16> for HashMap<String, String> {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: consider adding a type parameter
    |
 25 | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
@@ -49,7 +47,6 @@ error: impl for `HashSet` should be generalized over different hashers
    |
 43 | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
    |                                ^^^^^^^^^^
-   |
 help: consider adding a type parameter
    |
 43 | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
@@ -64,7 +61,6 @@ error: impl for `HashSet` should be generalized over different hashers
    |
 48 | impl Foo<i16> for HashSet<String> {
    |                   ^^^^^^^^^^^^^^^
-   |
 help: consider adding a type parameter
    |
 48 | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
@@ -79,7 +75,6 @@ error: parameter of type `HashMap` should be generalized over different hashers
    |
 65 | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
    |                       ^^^^^^^^^^^^^^^^^
-   |
 help: consider adding a type parameter
    |
 65 | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {
@@ -90,7 +85,6 @@ error: parameter of type `HashSet` should be generalized over different hashers
    |
 65 | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {
    |                                                     ^^^^^^^^^^^^
-   |
 help: consider adding a type parameter
    |
 65 | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {
@@ -104,7 +98,6 @@ error: impl for `HashMap` should be generalized over different hashers
 ...
 83 | gen!(impl);
    | ----------- in this macro invocation
-   |
 help: consider adding a type parameter
    |
 70 |         impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
@@ -122,7 +115,6 @@ error: parameter of type `HashMap` should be generalized over different hashers
 ...
 84 | gen!(fn bar);
    | ------------- in this macro invocation
-   |
 help: consider adding a type parameter
    |
 78 |         pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {
@@ -136,7 +128,6 @@ error: parameter of type `HashSet` should be generalized over different hashers
 ...
 84 | gen!(fn bar);
    | ------------- in this macro invocation
-   |
 help: consider adding a type parameter
    |
 78 |         pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {
diff --git a/tests/ui/int_plus_one.stderr b/tests/ui/int_plus_one.stderr
index 5d42ebb8986..69a8621fb16 100644
--- a/tests/ui/int_plus_one.stderr
+++ b/tests/ui/int_plus_one.stderr
@@ -15,7 +15,6 @@ error: Unnecessary `>= y + 1` or `x - 1 >=`
    |
 11 |     y + 1 <= x;
    |     ^^^^^^^^^^
-   |
 help: change `>= y + 1` to `> y` as shown
    |
 11 |     y < x;
@@ -26,7 +25,6 @@ error: Unnecessary `>= y + 1` or `x - 1 >=`
    |
 13 |     x - 1 >= y;
    |     ^^^^^^^^^^
-   |
 help: change `>= y + 1` to `> y` as shown
    |
 13 |     x > y;
@@ -37,7 +35,6 @@ error: Unnecessary `>= y + 1` or `x - 1 >=`
    |
 14 |     y <= x - 1;
    |     ^^^^^^^^^^
-   |
 help: change `>= y + 1` to `> y` as shown
    |
 14 |     y < x;
diff --git a/tests/ui/large_enum_variant.stderr b/tests/ui/large_enum_variant.stderr
index 899a84edeaa..5c6aac7d4ee 100644
--- a/tests/ui/large_enum_variant.stderr
+++ b/tests/ui/large_enum_variant.stderr
@@ -27,7 +27,6 @@ error: large size difference between variants
    |
 34 |     ContainingLargeEnum(LargeEnum),
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: consider boxing the large fields to reduce the total size of the enum
    |
 34 |     ContainingLargeEnum(Box<LargeEnum>),
@@ -62,7 +61,6 @@ error: large size difference between variants
    |
 49 |     StructLikeLarge2 { x: [i32; 8000] },
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: consider boxing the large fields to reduce the total size of the enum
    |
 49 |     StructLikeLarge2 { x: Box<[i32; 8000]> },
diff --git a/tests/ui/literals.stderr b/tests/ui/literals.stderr
index 82c651e6290..bcb9dbd136b 100644
--- a/tests/ui/literals.stderr
+++ b/tests/ui/literals.stderr
@@ -77,7 +77,6 @@ error: this is a decimal constant
    |
 30 |     let fail8 = 0123;
    |                 ^^^^
-   |
 help: if you mean to use a decimal constant, remove the `0` to remove confusion
    |
 30 |     let fail8 = 123;
diff --git a/tests/ui/matches.stderr b/tests/ui/matches.stderr
index 7ff38a35341..e44a4dd7894 100644
--- a/tests/ui/matches.stderr
+++ b/tests/ui/matches.stderr
@@ -143,7 +143,6 @@ error: you don't need to add `&` to all patterns
 150 | |         _ => println!("none"),
 151 | |     }
     | |_____^
-    |
 help: instead of prefixing all patterns with `&`, you can dereference the expression
     |
 148 |     match *tup { .. }
@@ -165,7 +164,6 @@ error: you don't need to add `&` to all patterns
 166 | |         println!("none");
 167 | |     }
     | |_____^
-    |
 help: instead of prefixing all patterns with `&`, you can dereference the expression
     |
 165 |     if let .. = *a { .. }
diff --git a/tests/ui/methods.stderr b/tests/ui/methods.stderr
index 469f81c657a..65d8b82da14 100644
--- a/tests/ui/methods.stderr
+++ b/tests/ui/methods.stderr
@@ -212,7 +212,6 @@ error: called `map_or(None, f)` on an Option value. This can be done more direct
 151 | |                        }
 152 | |                 );
     | |_________________^
-    |
 help: try using and_then instead
     |
 149 |     let _ = opt.and_then(|x| {
diff --git a/tests/ui/needless_pass_by_value.stderr b/tests/ui/needless_pass_by_value.stderr
index a6c0c0454cb..2ca96b127e5 100644
--- a/tests/ui/needless_pass_by_value.stderr
+++ b/tests/ui/needless_pass_by_value.stderr
@@ -29,7 +29,6 @@ error: this argument is passed by value, but not consumed in the function body
    |
 44 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
    |                  ^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: consider taking a reference instead
    |
 44 | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
@@ -47,7 +46,6 @@ error: this argument is passed by value, but not consumed in the function body
    |
 57 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
    |                                    ^^^^^^^
-   |
 help: consider taking a reference instead
    |
 57 | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
@@ -73,7 +71,6 @@ error: this argument is passed by value, but not consumed in the function body
    |
 75 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
    |                             ^^^^^^
-   |
 help: consider changing the type to
    |
 75 | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
@@ -94,7 +91,6 @@ error: this argument is passed by value, but not consumed in the function body
    |
 75 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
    |                                                     ^^^^^^^^
-   |
 help: consider changing the type to
    |
 75 | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
diff --git a/tests/ui/needless_range_loop.stderr b/tests/ui/needless_range_loop.stderr
index 94ee5f613fc..af78b370a12 100644
--- a/tests/ui/needless_range_loop.stderr
+++ b/tests/ui/needless_range_loop.stderr
@@ -19,7 +19,6 @@ error: the loop variable `i` is only used to index `ms`.
 30 | |         ms[i] *= 2;
 31 | |     }
    | |_____^
-   |
 help: consider using an iterator
    |
 29 |     for <item> in &mut ms {
@@ -33,7 +32,6 @@ error: the loop variable `i` is only used to index `ms`.
 37 | |         *x *= 2;
 38 | |     }
    | |_____^
-   |
 help: consider using an iterator
    |
 35 |     for <item> in &mut ms {
diff --git a/tests/ui/new_without_default.stderr b/tests/ui/new_without_default.stderr
index 0ced183b1e0..1f14b13306f 100644
--- a/tests/ui/new_without_default.stderr
+++ b/tests/ui/new_without_default.stderr
@@ -15,7 +15,6 @@ error: you should consider deriving a `Default` implementation for `Bar`
    |
 16 |     pub fn new() -> Self { Bar }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
 help: try this
    |
 13 | #[derive(Default)]
diff --git a/tests/ui/ptr_arg.stderr b/tests/ui/ptr_arg.stderr
index 9c6804cd9a0..4fbf73183c4 100644
--- a/tests/ui/ptr_arg.stderr
+++ b/tests/ui/ptr_arg.stderr
@@ -23,7 +23,6 @@ error: writing `&Vec<_>` instead of `&[_]` involves one more reference and canno
    |
 40 | fn cloned(x: &Vec<u8>) -> Vec<u8> {
    |              ^^^^^^^^
-   |
 help: change this to
    |
 40 | fn cloned(x: &[u8]) -> Vec<u8> {
@@ -42,7 +41,6 @@ error: writing `&String` instead of `&str` involves a new object where a slice w
    |
 49 | fn str_cloned(x: &String) -> String {
    |                  ^^^^^^^
-   |
 help: change this to
    |
 49 | fn str_cloned(x: &str) -> String {
@@ -65,7 +63,6 @@ error: writing `&String` instead of `&str` involves a new object where a slice w
    |
 59 | fn false_positive_capacity(x: &Vec<u8>, y: &String) {
    |                                            ^^^^^^^
-   |
 help: change this to
    |
 59 | fn false_positive_capacity(x: &Vec<u8>, y: &str) {