about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-23 18:13:20 +0000
committerbors <bors@rust-lang.org>2017-07-23 18:13:20 +0000
commitf3e26a02ebc64d4593d42d6fbcea844e03cd7ad6 (patch)
tree3f3c3681068646aabe7ec27808ccb6e3a63e0426 /src/test
parent6270257f4ef6e65213631d6b5a2a85807b8b2364 (diff)
parent401ab612c26d7568f949f2f26710283cd05ca761 (diff)
Auto merge of #43386 - oli-obk:suggestions, r=nikomatsakis
Adjust new suggestions to the suggestion guidelines

Addresses https://github.com/rust-lang/rust/pull/42033#discussion_r127694915

guidelines are https://github.com/rust-lang/rust/blob/master//src/librustc_errors/diagnostic.rs#L212-L224
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/block-result/unexpected-return-on-unit.stderr4
-rw-r--r--src/test/ui/did_you_mean/issue-42764.stderr2
-rw-r--r--src/test/ui/issue-22644.stderr64
-rw-r--r--src/test/ui/issue-42954.stderr12
-rw-r--r--src/test/ui/mismatched_types/issue-19109.stderr2
-rw-r--r--src/test/ui/resolve/token-error-correct-3.stderr2
-rw-r--r--src/test/ui/type-check/assignment-in-if.stderr8
7 files changed, 35 insertions, 59 deletions
diff --git a/src/test/ui/block-result/unexpected-return-on-unit.stderr b/src/test/ui/block-result/unexpected-return-on-unit.stderr
index c8743c72e31..f0528838152 100644
--- a/src/test/ui/block-result/unexpected-return-on-unit.stderr
+++ b/src/test/ui/block-result/unexpected-return-on-unit.stderr
@@ -6,11 +6,11 @@ error[E0308]: mismatched types
    |
    = note: expected type `()`
               found type `usize`
-help: did you mean to add a semicolon here?
+help: try adding a semicolon
    |
 19 |     foo();
    |          ^
-help: possibly return type missing here?
+help: try adding a return type
    |
 18 | fn bar() -> usize {
    |          ^^^^^^^^
diff --git a/src/test/ui/did_you_mean/issue-42764.stderr b/src/test/ui/did_you_mean/issue-42764.stderr
index 7ba129039bc..0cc157aa5bb 100644
--- a/src/test/ui/did_you_mean/issue-42764.stderr
+++ b/src/test/ui/did_you_mean/issue-42764.stderr
@@ -6,7 +6,7 @@ error[E0308]: mismatched types
    |
    = note: expected type `DoubleOption<_>`
               found type `usize`
-help: perhaps you meant to use a variant of the expected type
+help: try using a variant of the expected type
    |
 21 |     this_function_expects_a_double_option(DoubleOption::FirstSome(n));
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/issue-22644.stderr b/src/test/ui/issue-22644.stderr
index 144c5ef1ed6..c497db00c10 100644
--- a/src/test/ui/issue-22644.stderr
+++ b/src/test/ui/issue-22644.stderr
@@ -2,66 +2,46 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
   --> $DIR/issue-22644.rs:16:31
    |
 16 |     println!("{}", a as usize < long_name);
-   |                               ^ --------- interpreted as generic arguments
-   |                               |
-   |                               not interpreted as comparison
-   |
-help: if you want to compare the casted value then write:
-   |
-16 |     println!("{}", (a as usize) < long_name);
-   |                    ^^^^^^^^^^^^
+   |                    ---------- ^ --------- interpreted as generic arguments
+   |                    |          |
+   |                    |          not interpreted as comparison
+   |                    help: try comparing the casted value: `(a as usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
   --> $DIR/issue-22644.rs:17:33
    |
 17 |     println!("{}{}", a as usize < long_name, long_name);
-   |                                 ^ -------------------- interpreted as generic arguments
-   |                                 |
-   |                                 not interpreted as comparison
-   |
-help: if you want to compare the casted value then write:
-   |
-17 |     println!("{}{}", (a as usize) < long_name, long_name);
-   |                      ^^^^^^^^^^^^
+   |                      ---------- ^ -------------------- interpreted as generic arguments
+   |                      |          |
+   |                      |          not interpreted as comparison
+   |                      help: try comparing the casted value: `(a as usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
   --> $DIR/issue-22644.rs:18:31
    |
 18 |     println!("{}", a as usize < 4);
-   |                               ^ - interpreted as generic arguments
-   |                               |
-   |                               not interpreted as comparison
-   |
-help: if you want to compare the casted value then write:
-   |
-18 |     println!("{}", (a as usize) < 4);
-   |                    ^^^^^^^^^^^^
+   |                    ---------- ^ - interpreted as generic arguments
+   |                    |          |
+   |                    |          not interpreted as comparison
+   |                    help: try comparing the casted value: `(a as usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
   --> $DIR/issue-22644.rs:20:31
    |
 20 |     println!("{}{}", a: usize < long_name, long_name);
-   |                               ^ -------------------- interpreted as generic arguments
-   |                               |
-   |                               not interpreted as comparison
-   |
-help: if you want to compare the casted value then write:
-   |
-20 |     println!("{}{}", (a: usize) < long_name, long_name);
-   |                      ^^^^^^^^^^
+   |                      -------- ^ -------------------- interpreted as generic arguments
+   |                      |        |
+   |                      |        not interpreted as comparison
+   |                      help: try comparing the casted value: `(a: usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
   --> $DIR/issue-22644.rs:21:29
    |
 21 |     println!("{}", a: usize < 4);
-   |                             ^ - interpreted as generic arguments
-   |                             |
-   |                             not interpreted as comparison
-   |
-help: if you want to compare the casted value then write:
-   |
-21 |     println!("{}", (a: usize) < 4);
-   |                    ^^^^^^^^^^
+   |                    -------- ^ - interpreted as generic arguments
+   |                    |        |
+   |                    |        not interpreted as comparison
+   |                    help: try comparing the casted value: `(a: usize)`
 
 error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
   --> $DIR/issue-22644.rs:26:20
@@ -71,7 +51,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
 27 |                    4);
    |                    - interpreted as generic arguments
    |
-help: if you want to compare the casted value then write:
+help: try comparing the casted value
    |
 23 |     println!("{}", (a
 24 |                    as
@@ -86,7 +66,7 @@ error: `<` is interpreted as a start of generic arguments for `usize`, not a com
 36 |                    5);
    |                    - interpreted as generic arguments
    |
-help: if you want to compare the casted value then write:
+help: try comparing the casted value
    |
 28 |     println!("{}", (a
 29 | 
diff --git a/src/test/ui/issue-42954.stderr b/src/test/ui/issue-42954.stderr
index 35995749d3b..7287c8f37eb 100644
--- a/src/test/ui/issue-42954.stderr
+++ b/src/test/ui/issue-42954.stderr
@@ -2,17 +2,13 @@ error: `<` is interpreted as a start of generic arguments for `u32`, not a compa
   --> $DIR/issue-42954.rs:13:19
    |
 13 |         $i as u32 < 0
-   |                   ^ - interpreted as generic arguments
-   |                   |
-   |                   not interpreted as comparison
+   |         --------- ^ - interpreted as generic arguments
+   |         |         |
+   |         |         not interpreted as comparison
+   |         help: try comparing the casted value: `($i as u32)`
 ...
 19 |     is_plainly_printable!(c);
    |     ------------------------- in this macro invocation
-   |
-help: if you want to compare the casted value then write:
-   |
-13 |         ($i as u32) < 0
-   |         ^^^^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/mismatched_types/issue-19109.stderr b/src/test/ui/mismatched_types/issue-19109.stderr
index 2d8d557d9f3..714d1b39733 100644
--- a/src/test/ui/mismatched_types/issue-19109.stderr
+++ b/src/test/ui/mismatched_types/issue-19109.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-19109.rs:14:5
    |
 13 | fn function(t: &mut Trait) {
-   |                            - help: possibly return type missing here?: `-> *mut Trait `
+   |                            - help: try adding a return type: `-> *mut Trait `
 14 |     t as *mut Trait
    |     ^^^^^^^^^^^^^^^ expected (), found *-ptr
    |
diff --git a/src/test/ui/resolve/token-error-correct-3.stderr b/src/test/ui/resolve/token-error-correct-3.stderr
index 2e8cc40dc51..c8e19db3707 100644
--- a/src/test/ui/resolve/token-error-correct-3.stderr
+++ b/src/test/ui/resolve/token-error-correct-3.stderr
@@ -35,7 +35,7 @@ error[E0308]: mismatched types
   --> $DIR/token-error-correct-3.rs:25:13
    |
 25 |             fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: did you mean to add a semicolon here?: `;`
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try adding a semicolon: `;`
    |             |
    |             expected (), found enum `std::result::Result`
    |
diff --git a/src/test/ui/type-check/assignment-in-if.stderr b/src/test/ui/type-check/assignment-in-if.stderr
index 4b8a3744bcf..6052b3091c7 100644
--- a/src/test/ui/type-check/assignment-in-if.stderr
+++ b/src/test/ui/type-check/assignment-in-if.stderr
@@ -5,7 +5,7 @@ error[E0308]: mismatched types
    |        ^^^^^
    |        |
    |        expected bool, found ()
-   |        help: did you mean to compare equality?: `x == x`
+   |        help: try comparing for equality: `x == x`
    |
    = note: expected type `bool`
               found type `()`
@@ -17,7 +17,7 @@ error[E0308]: mismatched types
    |        ^^^^^^^
    |        |
    |        expected bool, found ()
-   |        help: did you mean to compare equality?: `x == x`
+   |        help: try comparing for equality: `x == x`
    |
    = note: expected type `bool`
               found type `()`
@@ -29,7 +29,7 @@ error[E0308]: mismatched types
    |        ^^^^^^^^^^^^^^^^^^^^
    |        |
    |        expected bool, found ()
-   |        help: did you mean to compare equality?: `y == (Foo { foo: x })`
+   |        help: try comparing for equality: `y == (Foo { foo: x })`
    |
    = note: expected type `bool`
               found type `()`
@@ -41,7 +41,7 @@ error[E0308]: mismatched types
    |        ^^^^^
    |        |
    |        expected bool, found ()
-   |        help: did you mean to compare equality?: `3 == x`
+   |        help: try comparing for equality: `3 == x`
    |
    = note: expected type `bool`
               found type `()`