about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorteymour-aldridge <teymour.aldridge@icloud.com>2021-04-18 20:38:23 +0100
committerteymour-aldridge <teymour.aldridge@icloud.com>2021-04-18 20:38:23 +0100
commit567de4a20268432d8ea27befea3091af9ba38fcd (patch)
treee7871c5fce0c894182e40fe84fc9ff3259a2acc4 /src
parentd7c338641466d54bf8d4b2eae5d6865483e1d3f4 (diff)
downloadrust-567de4a20268432d8ea27befea3091af9ba38fcd.tar.gz
rust-567de4a20268432d8ea27befea3091af9ba38fcd.zip
Improve an error message.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/never_type/defaulted-never-note.rs4
-rw-r--r--src/test/ui/never_type/defaulted-never-note.stderr4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/test/ui/never_type/defaulted-never-note.rs b/src/test/ui/never_type/defaulted-never-note.rs
index c96c4784dcf..6979c3ec443 100644
--- a/src/test/ui/never_type/defaulted-never-note.rs
+++ b/src/test/ui/never_type/defaulted-never-note.rs
@@ -26,7 +26,9 @@ fn smeg() {
     foo(_x);
     //~^ ERROR the trait bound
     //~| NOTE the trait `ImplementedForUnitButNotNever` is not implemented
-    //~| NOTE the trait is implemented for `()`
+    //~| NOTE this trait is implemented for `()`
+    //~| NOTE this error might have been caused
+    //~| HELP did you intend
 }
 
 fn main() {
diff --git a/src/test/ui/never_type/defaulted-never-note.stderr b/src/test/ui/never_type/defaulted-never-note.stderr
index 69691883de1..99738375022 100644
--- a/src/test/ui/never_type/defaulted-never-note.stderr
+++ b/src/test/ui/never_type/defaulted-never-note.stderr
@@ -7,7 +7,9 @@ LL | fn foo<T: ImplementedForUnitButNotNever>(_t: T) {}
 LL |     foo(_x);
    |     ^^^ the trait `ImplementedForUnitButNotNever` is not implemented for `!`
    |
-   = note: the trait is implemented for `()`. Possibly this error has been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information). Consider whether you meant to use the type `()` here instead.
+   = note: this trait is implemented for `()`.
+   = note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information).
+   = help: did you intend to use the type `()` here instead?
 
 error: aborting due to previous error