about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBoxy <supbscripter@gmail.com>2022-10-27 22:18:26 +0100
committerBoxy <supbscripter@gmail.com>2022-10-27 22:18:26 +0100
commitca5a6e43dd6fcfddf436d36f6907d8ef44c7105b (patch)
treef9018ba5918da8443177c4e580ac5ba8410c9483 /src
parentc00ff9c4d01e8ba64bf03aaf3bb7940874d3e094 (diff)
downloadrust-ca5a6e43dd6fcfddf436d36f6907d8ef44c7105b.tar.gz
rust-ca5a6e43dd6fcfddf436d36f6907d8ef44c7105b.zip
use proper spans
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/resolve/issue-23305.rs2
-rw-r--r--src/test/ui/resolve/issue-23305.stderr8
-rw-r--r--src/test/ui/resolve/resolve-self-in-impl.rs9
-rw-r--r--src/test/ui/resolve/resolve-self-in-impl.stderr40
4 files changed, 39 insertions, 20 deletions
diff --git a/src/test/ui/resolve/issue-23305.rs b/src/test/ui/resolve/issue-23305.rs
index 3e3d5ee2fda..6d7fe7c50a2 100644
--- a/src/test/ui/resolve/issue-23305.rs
+++ b/src/test/ui/resolve/issue-23305.rs
@@ -3,6 +3,6 @@ pub trait ToNbt<T> {
 }
 
 impl dyn ToNbt<Self> {}
-//~^ ERROR `Self` is not valid at this location
+//~^ ERROR `Self` is not valid in the self type of an impl block
 
 fn main() {}
diff --git a/src/test/ui/resolve/issue-23305.stderr b/src/test/ui/resolve/issue-23305.stderr
index 1b2745de321..aad1b583a32 100644
--- a/src/test/ui/resolve/issue-23305.stderr
+++ b/src/test/ui/resolve/issue-23305.stderr
@@ -1,8 +1,10 @@
-error: `Self` is not valid at this location
-  --> $DIR/issue-23305.rs:5:6
+error: `Self` is not valid in the self type of an impl block
+  --> $DIR/issue-23305.rs:5:16
    |
 LL | impl dyn ToNbt<Self> {}
-   |      ^^^^^^^^^^^^^^^
+   |                ^^^^
+   |
+   = note: replace `Self` with a different type
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/resolve/resolve-self-in-impl.rs b/src/test/ui/resolve/resolve-self-in-impl.rs
index f845e780bbf..d0872d1b76f 100644
--- a/src/test/ui/resolve/resolve-self-in-impl.rs
+++ b/src/test/ui/resolve/resolve-self-in-impl.rs
@@ -11,10 +11,11 @@ impl Tr for S where Self: Copy {} // OK
 impl Tr for S where S<Self>: Copy {} // OK
 impl Tr for S where Self::A: Copy {} // OK
 
-impl Tr for Self {} //~ ERROR `Self` is not valid at this location
-impl Tr for S<Self> {} //~ ERROR `Self` is not valid at this location
-impl Self {} //~ ERROR `Self` is not valid at this location
-impl S<Self> {} //~ ERROR `Self` is not valid at this location
+impl Tr for Self {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl Tr for S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl Self {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl (Self, Self) {} //~ ERROR `Self` is not valid in the self type of an impl block
 impl Tr<Self::A> for S {} //~ ERROR cycle detected
 
 fn main() {}
diff --git a/src/test/ui/resolve/resolve-self-in-impl.stderr b/src/test/ui/resolve/resolve-self-in-impl.stderr
index 93e2b4695fc..9f9ed68898f 100644
--- a/src/test/ui/resolve/resolve-self-in-impl.stderr
+++ b/src/test/ui/resolve/resolve-self-in-impl.stderr
@@ -1,34 +1,50 @@
-error: `Self` is not valid at this location
+error: `Self` is not valid in the self type of an impl block
   --> $DIR/resolve-self-in-impl.rs:14:13
    |
 LL | impl Tr for Self {}
    |             ^^^^
+   |
+   = note: replace `Self` with a different type
 
-error: `Self` is not valid at this location
-  --> $DIR/resolve-self-in-impl.rs:15:13
+error: `Self` is not valid in the self type of an impl block
+  --> $DIR/resolve-self-in-impl.rs:15:15
    |
 LL | impl Tr for S<Self> {}
-   |             ^^^^^^^
+   |               ^^^^
+   |
+   = note: replace `Self` with a different type
 
-error: `Self` is not valid at this location
+error: `Self` is not valid in the self type of an impl block
   --> $DIR/resolve-self-in-impl.rs:16:6
    |
 LL | impl Self {}
    |      ^^^^
+   |
+   = note: replace `Self` with a different type
 
-error: `Self` is not valid at this location
-  --> $DIR/resolve-self-in-impl.rs:17:6
+error: `Self` is not valid in the self type of an impl block
+  --> $DIR/resolve-self-in-impl.rs:17:8
    |
 LL | impl S<Self> {}
-   |      ^^^^^^^
+   |        ^^^^
+   |
+   = note: replace `Self` with a different type
+
+error: `Self` is not valid in the self type of an impl block
+  --> $DIR/resolve-self-in-impl.rs:18:7
+   |
+LL | impl (Self, Self) {}
+   |       ^^^^  ^^^^
+   |
+   = note: replace `Self` with a different type
 
-error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:23>`
-  --> $DIR/resolve-self-in-impl.rs:18:1
+error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:19:1: 19:23>`
+  --> $DIR/resolve-self-in-impl.rs:19:1
    |
 LL | impl Tr<Self::A> for S {}
    | ^^^^^^^^^^^^^^^^^^^^^^
    |
-   = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:23>` again
+   = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:19:1: 19:23>` again
 note: cycle used when collecting item types in top-level module
   --> $DIR/resolve-self-in-impl.rs:1:1
    |
@@ -41,6 +57,6 @@ LL | |
 LL | | fn main() {}
    | |____________^
 
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0391`.