about summary refs log tree commit diff
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-11-25 06:00:26 -0800
committerEsteban Küber <esteban@kuber.com.ar>2017-12-01 10:44:29 -0800
commit36faafee8d836983754005df4e6b7709829aa5ab (patch)
tree73a4fa4f0e0dfc8ba35d65d776057e361442baa2 /src/test/ui/span
parente3ed21272d5f50c37c09f2a7f06c40f56b6ac298 (diff)
downloadrust-36faafee8d836983754005df4e6b7709829aa5ab.tar.gz
rust-36faafee8d836983754005df4e6b7709829aa5ab.zip
Use suggestions instead of notes ref mismatches
On type mismatch errors, use a suggestion when encountering minimal
differences in type differences due to refs, instead of a note.
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/coerce-suggestions.rs2
-rw-r--r--src/test/ui/span/coerce-suggestions.stderr12
2 files changed, 9 insertions, 5 deletions
diff --git a/src/test/ui/span/coerce-suggestions.rs b/src/test/ui/span/coerce-suggestions.rs
index a1a250b0e9a..0a3e18043fe 100644
--- a/src/test/ui/span/coerce-suggestions.rs
+++ b/src/test/ui/span/coerce-suggestions.rs
@@ -23,7 +23,7 @@ fn main() {
     //~^ ERROR E0308
     //~| NOTE expected &str, found struct `std::string::String`
     //~| NOTE expected type `&str`
-    //~| HELP try with `&String::new()`
+    //~| HELP consider borrowing here
     let y = String::new();
     test(&y);
     //~^ ERROR E0308
diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr
index 98ea34fd992..604b38bef6c 100644
--- a/src/test/ui/span/coerce-suggestions.stderr
+++ b/src/test/ui/span/coerce-suggestions.stderr
@@ -14,11 +14,13 @@ error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:22:19
    |
 22 |     let x: &str = String::new();
-   |                   ^^^^^^^^^^^^^ expected &str, found struct `std::string::String`
+   |                   ^^^^^^^^^^^^^
+   |                   |
+   |                   expected &str, found struct `std::string::String`
+   |                   help: consider borrowing here: `&String::new()`
    |
    = note: expected type `&str`
               found type `std::string::String`
-   = help: try with `&String::new()`
 
 error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:28:10
@@ -48,11 +50,13 @@ error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:42:9
    |
 42 |     s = format!("foo");
-   |         ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String`
+   |         ^^^^^^^^^^^^^^
+   |         |
+   |         expected mutable reference, found struct `std::string::String`
+   |         help: consider mutably borrowing here: `&mut format!("foo")`
    |
    = note: expected type `&mut std::string::String`
               found type `std::string::String`
-   = help: try with `&mut format!("foo")`
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
 
 error: aborting due to 6 previous errors