about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-02-12 18:49:54 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2023-02-14 20:26:03 +0000
commitfacecf6e1b96f3dc1c2a3f1bcfb56caa018e78cf (patch)
tree6ba8053c2997fd877f0d9d3928d1362c7f52f5c6 /tests
parente9e12266ced4c43f07c53017f5ed094e93157a18 (diff)
downloadrust-facecf6e1b96f3dc1c2a3f1bcfb56caa018e78cf.tar.gz
rust-facecf6e1b96f3dc1c2a3f1bcfb56caa018e78cf.zip
Fetch less HIR in signature check.
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc-ui/issue-105742.rs21
-rw-r--r--tests/rustdoc-ui/issue-105742.stderr362
-rw-r--r--tests/ui/error-codes/E0520.stderr2
-rw-r--r--tests/ui/specialization/defaultimpl/specialization-no-default.stderr10
-rw-r--r--tests/ui/specialization/issue-50452-fail.stderr2
-rw-r--r--tests/ui/specialization/non-defaulted-item-fail.stderr12
-rw-r--r--tests/ui/specialization/specialization-no-default.stderr10
-rw-r--r--tests/ui/traits/negative-impls/no-items.stderr2
8 files changed, 25 insertions, 396 deletions
diff --git a/tests/rustdoc-ui/issue-105742.rs b/tests/rustdoc-ui/issue-105742.rs
index cb1de7433cf..9f36e5315ec 100644
--- a/tests/rustdoc-ui/issue-105742.rs
+++ b/tests/rustdoc-ui/issue-105742.rs
@@ -3,38 +3,17 @@
 use std::ops::Index;
 
 pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
     let _ = s;
 }
 
 pub trait SVec: Index<
     <Self as SVec>::Item,
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
     Output = <Index<<Self as SVec>::Item,
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
     Output = <Self as SVec>::Item> as SVec>::Item,
-//~^ ERROR
-//~^^ ERROR
-//~^^^ ERROR
-//~^^^^ ERROR
-//~^^^^^ ERROR
-//~^^^^^^ ERROR
-//~^^^^^^^ ERROR
-//~^^^^^^^^ ERROR
 > {
     type Item<'a, T>;
 
     fn len(&self) -> <Self as SVec>::Item;
     //~^ ERROR
     //~^^ ERROR
-    //~^^^ ERROR
-    //~^^^^ ERROR
 }
diff --git a/tests/rustdoc-ui/issue-105742.stderr b/tests/rustdoc-ui/issue-105742.stderr
index ffb602cf861..4d2ee972689 100644
--- a/tests/rustdoc-ui/issue-105742.stderr
+++ b/tests/rustdoc-ui/issue-105742.stderr
@@ -1,360 +1,11 @@
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:13:21
-   |
-LL |     <Self as SVec>::Item,
-   |                     ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     <Self as SVec>::Item<'a>,
-   |                         ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:13:21
-   |
-LL |     <Self as SVec>::Item,
-   |                     ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     <Self as SVec>::Item<T>,
-   |                         +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:18:37
-   |
-LL |     Output = <Index<<Self as SVec>::Item,
-   |                                     ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     Output = <Index<<Self as SVec>::Item<'a>,
-   |                                         ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:18:37
-   |
-LL |     Output = <Index<<Self as SVec>::Item,
-   |                                     ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     Output = <Index<<Self as SVec>::Item<T>,
-   |                                         +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:23:30
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item,
-   |                              ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     Output = <Self as SVec>::Item<'a>> as SVec>::Item,
-   |                                  ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:23:30
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item,
-   |                              ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     Output = <Self as SVec>::Item<T>> as SVec>::Item,
-   |                                  +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:23:46
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item,
-   |                                              ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item<'a>,
-   |                                                  ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:23:46
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item,
-   |                                              ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item<T>,
-   |                                                  +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:5:40
-   |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
-   |                                        ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item<'_> = T, Output = T>) {
-   |                                            ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:5:40
-   |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
-   |                                        ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item<T> = T, Output = T>) {
-   |                                            +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:13:21
-   |
-LL |     <Self as SVec>::Item,
-   |                     ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     <Self as SVec>::Item<'a>,
-   |                         ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:13:21
-   |
-LL |     <Self as SVec>::Item,
-   |                     ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     <Self as SVec>::Item<T>,
-   |                         +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:18:37
-   |
-LL |     Output = <Index<<Self as SVec>::Item,
-   |                                     ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     Output = <Index<<Self as SVec>::Item<'a>,
-   |                                         ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:18:37
-   |
-LL |     Output = <Index<<Self as SVec>::Item,
-   |                                     ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     Output = <Index<<Self as SVec>::Item<T>,
-   |                                         +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:23:30
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item,
-   |                              ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     Output = <Self as SVec>::Item<'a>> as SVec>::Item,
-   |                                  ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:23:30
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item,
-   |                              ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     Output = <Self as SVec>::Item<T>> as SVec>::Item,
-   |                                  +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:23:46
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item,
-   |                                              ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item<'a>,
-   |                                                  ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:23:46
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item,
-   |                                              ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     Output = <Self as SVec>::Item> as SVec>::Item<T>,
-   |                                                  +++
-
-error[E0038]: the trait `SVec` cannot be made into an object
-  --> $DIR/issue-105742.rs:5:31
-   |
-LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
-   |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SVec` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/issue-105742.rs:12:17
-   |
-LL |    pub trait SVec: Index<
-   |  ____________----__^
-   | |            |
-   | |            this trait cannot be made into an object...
-LL | |      <Self as SVec>::Item,
-LL | |
-LL | |
-...  |
-LL | |/     Output = <Index<<Self as SVec>::Item,
-LL | ||
-LL | ||
-LL | ||
-LL | ||
-LL | ||     Output = <Self as SVec>::Item> as SVec>::Item,
-   | ||_________________________________________________^ ...because it uses `Self` as a type parameter
-...  |
-LL | |
-LL | |  > {
-   | |__^ ...because it uses `Self` as a type parameter
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:35:38
-   |
-LL |     fn len(&self) -> <Self as SVec>::Item;
-   |                                      ^^^^ expected 1 lifetime argument
-   |
-note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^ --
-help: add missing lifetime argument
-   |
-LL |     fn len(&self) -> <Self as SVec>::Item<'_>;
-   |                                          ++++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:35:38
-   |
-LL |     fn len(&self) -> <Self as SVec>::Item;
-   |                                      ^^^^ expected 1 generic argument
-   |
-note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
-   |
-LL |     type Item<'a, T>;
-   |          ^^^^     -
-help: add missing generic argument
-   |
-LL |     fn len(&self) -> <Self as SVec>::Item<T>;
-   |                                          +++
-
-error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:35:38
+  --> $DIR/issue-105742.rs:16:38
    |
 LL |     fn len(&self) -> <Self as SVec>::Item;
    |                                      ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/issue-105742.rs:33:10
+  --> $DIR/issue-105742.rs:14:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -364,13 +15,13 @@ LL |     fn len(&self) -> <Self as SVec>::Item<'_>;
    |                                          ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/issue-105742.rs:35:38
+  --> $DIR/issue-105742.rs:16:38
    |
 LL |     fn len(&self) -> <Self as SVec>::Item;
    |                                      ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/issue-105742.rs:33:10
+  --> $DIR/issue-105742.rs:14:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -379,7 +30,6 @@ help: add missing generic argument
 LL |     fn len(&self) -> <Self as SVec>::Item<T>;
    |                                          +++
 
-error: aborting due to 23 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0038, E0107.
-For more information about an error, try `rustc --explain E0038`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/tests/ui/error-codes/E0520.stderr b/tests/ui/error-codes/E0520.stderr
index 12ecead13de..06658a49b83 100644
--- a/tests/ui/error-codes/E0520.stderr
+++ b/tests/ui/error-codes/E0520.stderr
@@ -15,7 +15,7 @@ LL | impl<T: Clone> SpaceLlama for T {
    | ------------------------------- parent `impl` is here
 ...
 LL |     default fn fly(&self) {}
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `fly`
+   |     ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `fly`
    |
    = note: to specialize, `fly` in the parent `impl` must be marked `default`
 
diff --git a/tests/ui/specialization/defaultimpl/specialization-no-default.stderr b/tests/ui/specialization/defaultimpl/specialization-no-default.stderr
index 770be2af281..f9e62a99bae 100644
--- a/tests/ui/specialization/defaultimpl/specialization-no-default.stderr
+++ b/tests/ui/specialization/defaultimpl/specialization-no-default.stderr
@@ -15,7 +15,7 @@ LL | impl<T> Foo for T {
    | ----------------- parent `impl` is here
 ...
 LL |     fn foo(&self) {}
-   |     ^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+   |     ^^^^^^^^^^^^^ cannot specialize default item `foo`
    |
    = note: to specialize, `foo` in the parent `impl` must be marked `default`
 
@@ -26,7 +26,7 @@ LL | impl<T> Foo for T {
    | ----------------- parent `impl` is here
 ...
 LL |     fn bar(&self) {}
-   |     ^^^^^^^^^^^^^^^^ cannot specialize default item `bar`
+   |     ^^^^^^^^^^^^^ cannot specialize default item `bar`
    |
    = note: to specialize, `bar` in the parent `impl` must be marked `default`
 
@@ -37,7 +37,7 @@ LL | impl<T> Bar for T {
    | ----------------- parent `impl` is here
 ...
 LL |     type T = ();
-   |     ^^^^^^^^^^^^ cannot specialize default item `T`
+   |     ^^^^^^ cannot specialize default item `T`
    |
    = note: to specialize, `T` in the parent `impl` must be marked `default`
 
@@ -48,7 +48,7 @@ LL | impl<T: Clone> Baz for T {
    | ------------------------ parent `impl` is here
 ...
 LL |     fn baz(&self) {}
-   |     ^^^^^^^^^^^^^^^^ cannot specialize default item `baz`
+   |     ^^^^^^^^^^^^^ cannot specialize default item `baz`
    |
    = note: to specialize, `baz` in the parent `impl` must be marked `default`
 
@@ -59,7 +59,7 @@ LL | impl<T: Clone> Redundant for T {
    | ------------------------------ parent `impl` is here
 ...
 LL |     fn redundant(&self) {}
-   |     ^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant`
+   |     ^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant`
    |
    = note: to specialize, `redundant` in the parent `impl` must be marked `default`
 
diff --git a/tests/ui/specialization/issue-50452-fail.stderr b/tests/ui/specialization/issue-50452-fail.stderr
index 5c136adc451..3fc29fff230 100644
--- a/tests/ui/specialization/issue-50452-fail.stderr
+++ b/tests/ui/specialization/issue-50452-fail.stderr
@@ -12,7 +12,7 @@ error[E0520]: `foo` specializes an item from a parent `impl`, but that item is n
   --> $DIR/issue-50452-fail.rs:10:5
    |
 LL |     fn foo() {}
-   |     ^^^^^^^^^^^ cannot specialize default item `foo`
+   |     ^^^^^^^^ cannot specialize default item `foo`
 ...
 LL | impl<T> Foo for T {
    | ----------------- parent `impl` is here
diff --git a/tests/ui/specialization/non-defaulted-item-fail.stderr b/tests/ui/specialization/non-defaulted-item-fail.stderr
index faa14555a4f..9d62a353da7 100644
--- a/tests/ui/specialization/non-defaulted-item-fail.stderr
+++ b/tests/ui/specialization/non-defaulted-item-fail.stderr
@@ -15,7 +15,7 @@ LL | impl<T> Foo for Box<T> {
    | ---------------------- parent `impl` is here
 ...
 LL |     type Ty = Vec<()>;
-   |     ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
+   |     ^^^^^^^ cannot specialize default item `Ty`
    |
    = note: to specialize, `Ty` in the parent `impl` must be marked `default`
 
@@ -26,7 +26,7 @@ LL | impl<T> Foo for Box<T> {
    | ---------------------- parent `impl` is here
 ...
 LL |     const CONST: u8 = 42;
-   |     ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
+   |     ^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
    |
    = note: to specialize, `CONST` in the parent `impl` must be marked `default`
 
@@ -37,7 +37,7 @@ LL | impl<T> Foo for Box<T> {
    | ---------------------- parent `impl` is here
 ...
 LL |     fn foo(&self) -> bool { true }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+   |     ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
    |
    = note: to specialize, `foo` in the parent `impl` must be marked `default`
 
@@ -48,7 +48,7 @@ LL | impl<T> Foo for Vec<T> {}
    | ---------------------- parent `impl` is here
 ...
 LL |     type Ty = Vec<()>;
-   |     ^^^^^^^^^^^^^^^^^^ cannot specialize default item `Ty`
+   |     ^^^^^^^ cannot specialize default item `Ty`
    |
    = note: to specialize, `Ty` in the parent `impl` must be marked `default`
 
@@ -59,7 +59,7 @@ LL | impl<T> Foo for Vec<T> {}
    | ---------------------- parent `impl` is here
 ...
 LL |     const CONST: u8 = 42;
-   |     ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
+   |     ^^^^^^^^^^^^^^^ cannot specialize default item `CONST`
    |
    = note: to specialize, `CONST` in the parent `impl` must be marked `default`
 
@@ -70,7 +70,7 @@ LL | impl<T> Foo for Vec<T> {}
    | ---------------------- parent `impl` is here
 ...
 LL |     fn foo(&self) -> bool { true }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+   |     ^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
    |
    = note: to specialize, `foo` in the parent `impl` must be marked `default`
 
diff --git a/tests/ui/specialization/specialization-no-default.stderr b/tests/ui/specialization/specialization-no-default.stderr
index 842cec9c79f..695a3f6cc45 100644
--- a/tests/ui/specialization/specialization-no-default.stderr
+++ b/tests/ui/specialization/specialization-no-default.stderr
@@ -15,7 +15,7 @@ LL | impl<T> Foo for T {
    | ----------------- parent `impl` is here
 ...
 LL |     fn foo(&self) {}
-   |     ^^^^^^^^^^^^^^^^ cannot specialize default item `foo`
+   |     ^^^^^^^^^^^^^ cannot specialize default item `foo`
    |
    = note: to specialize, `foo` in the parent `impl` must be marked `default`
 
@@ -26,7 +26,7 @@ LL | impl<T> Foo for T {
    | ----------------- parent `impl` is here
 ...
 LL |     fn bar(&self) {}
-   |     ^^^^^^^^^^^^^^^^ cannot specialize default item `bar`
+   |     ^^^^^^^^^^^^^ cannot specialize default item `bar`
    |
    = note: to specialize, `bar` in the parent `impl` must be marked `default`
 
@@ -37,7 +37,7 @@ LL | impl<T> Bar for T {
    | ----------------- parent `impl` is here
 ...
 LL |     type T = ();
-   |     ^^^^^^^^^^^^ cannot specialize default item `T`
+   |     ^^^^^^ cannot specialize default item `T`
    |
    = note: to specialize, `T` in the parent `impl` must be marked `default`
 
@@ -48,7 +48,7 @@ LL | impl<T: Clone> Baz for T {
    | ------------------------ parent `impl` is here
 ...
 LL |     fn baz(&self) {}
-   |     ^^^^^^^^^^^^^^^^ cannot specialize default item `baz`
+   |     ^^^^^^^^^^^^^ cannot specialize default item `baz`
    |
    = note: to specialize, `baz` in the parent `impl` must be marked `default`
 
@@ -59,7 +59,7 @@ LL | impl<T: Clone> Redundant for T {
    | ------------------------------ parent `impl` is here
 ...
 LL |     default fn redundant(&self) {}
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant`
    |
    = note: to specialize, `redundant` in the parent `impl` must be marked `default`
 
diff --git a/tests/ui/traits/negative-impls/no-items.stderr b/tests/ui/traits/negative-impls/no-items.stderr
index 67b94bba121..040d9d14503 100644
--- a/tests/ui/traits/negative-impls/no-items.stderr
+++ b/tests/ui/traits/negative-impls/no-items.stderr
@@ -2,7 +2,7 @@ error[E0749]: negative impls cannot have any items
   --> $DIR/no-items.rs:8:5
    |
 LL |     type Foo = i32;
-   |     ^^^^^^^^^^^^^^^
+   |     ^^^^^^^^
 
 error: aborting due to previous error