about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-15 17:00:55 +0000
committerbors <bors@rust-lang.org>2024-02-15 17:00:55 +0000
commitcbddf31863495050e840571d2730c95b29dcc27f (patch)
tree6316e411f126cfeefe1ef0e6de18b5147eeab96d /tests/ui/parser
parent62fb0db9a5a2a381f81ce0474c9bbd9ad385dd88 (diff)
parent06f53dd3166f068435ee2f08e108d2d1e0d5db50 (diff)
Auto merge of #121142 - GuillaumeGomez:rollup-5qmksjw, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #120449 (Document requirements for unsized {Rc,Arc}::from_raw)
 - #120505 (Fix BTreeMap's Cursor::remove_{next,prev})
 - #120672 (std::thread update freebsd stack guard handling.)
 - #121088 (Implicitly enable evex512 if avx512 is enabled)
 - #121104 (Ignore unsized types when trying to determine the size of the original type)
 - #121107 (Fix msg for verbose suggestions with confusable capitalization)
 - #121113 (Continue compilation even if inherent impl checks fail)
 - #121120 (Add `ErrorGuaranteed` to `ast::LitKind::Err`, `token::LitKind::Err`.)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/impl-item-type-no-body-semantic-fail.rs2
-rw-r--r--tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr40
-rw-r--r--tests/ui/parser/kw-in-trait-bounds.stderr8
-rw-r--r--tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr4
-rw-r--r--tests/ui/parser/typod-const-in-const-param-def.stderr8
5 files changed, 46 insertions, 16 deletions
diff --git a/tests/ui/parser/impl-item-type-no-body-semantic-fail.rs b/tests/ui/parser/impl-item-type-no-body-semantic-fail.rs
index 5582e82d11d..bbd207be06d 100644
--- a/tests/ui/parser/impl-item-type-no-body-semantic-fail.rs
+++ b/tests/ui/parser/impl-item-type-no-body-semantic-fail.rs
@@ -14,8 +14,10 @@ impl X {
     //~^ ERROR associated type in `impl` without body
     //~| ERROR bounds on `type`s in `impl`s have no effect
     //~| ERROR inherent associated types are unstable
+    //~| ERROR `X: Eq` is not satisfied
     type W where Self: Eq;
     //~^ ERROR associated type in `impl` without body
     //~| ERROR inherent associated types are unstable
     //~| ERROR duplicate definitions
+    //~| ERROR `X: Eq` is not satisfied
 }
diff --git a/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr b/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr
index d23e6027473..1c71cdacd89 100644
--- a/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr
+++ b/tests/ui/parser/impl-item-type-no-body-semantic-fail.stderr
@@ -35,7 +35,7 @@ LL |     type W: Ord where Self: Eq;
    |             ^^^
 
 error: associated type in `impl` without body
-  --> $DIR/impl-item-type-no-body-semantic-fail.rs:17:5
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5
    |
 LL |     type W where Self: Eq;
    |     ^^^^^^^^^^^^^^^^^^^^^-
@@ -73,7 +73,7 @@ LL |     type W: Ord where Self: Eq;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: inherent associated types are unstable
-  --> $DIR/impl-item-type-no-body-semantic-fail.rs:17:5
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5
    |
 LL |     type W where Self: Eq;
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -83,7 +83,7 @@ LL |     type W where Self: Eq;
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0592]: duplicate definitions with name `W`
-  --> $DIR/impl-item-type-no-body-semantic-fail.rs:17:5
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:5
    |
 LL |     type W: Ord where Self: Eq;
    |     ------ other definition for `W`
@@ -91,7 +91,35 @@ LL |     type W: Ord where Self: Eq;
 LL |     type W where Self: Eq;
    |     ^^^^^^ duplicate definitions for `W`
 
-error: aborting due to 11 previous errors
+error[E0277]: the trait bound `X: Eq` is not satisfied
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:13:23
+   |
+LL |     type W: Ord where Self: Eq;
+   |                       ^^^^^^^^ the trait `Eq` is not implemented for `X`
+   |
+   = help: see issue #48214
+   = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
+help: consider annotating `X` with `#[derive(Eq)]`
+   |
+LL + #[derive(Eq)]
+LL | struct X;
+   |
+
+error[E0277]: the trait bound `X: Eq` is not satisfied
+  --> $DIR/impl-item-type-no-body-semantic-fail.rs:18:18
+   |
+LL |     type W where Self: Eq;
+   |                  ^^^^^^^^ the trait `Eq` is not implemented for `X`
+   |
+   = help: see issue #48214
+   = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
+help: consider annotating `X` with `#[derive(Eq)]`
+   |
+LL + #[derive(Eq)]
+LL | struct X;
+   |
+
+error: aborting due to 13 previous errors
 
-Some errors have detailed explanations: E0592, E0658.
-For more information about an error, try `rustc --explain E0592`.
+Some errors have detailed explanations: E0277, E0592, E0658.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/parser/kw-in-trait-bounds.stderr b/tests/ui/parser/kw-in-trait-bounds.stderr
index 2d3aad4d6ba..3c54e031950 100644
--- a/tests/ui/parser/kw-in-trait-bounds.stderr
+++ b/tests/ui/parser/kw-in-trait-bounds.stderr
@@ -4,7 +4,7 @@ error: expected identifier, found keyword `fn`
 LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
    |          ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn _f<F: Fn(), G>(_: impl fn(), _: &dyn fn())
    |          ~~
@@ -15,7 +15,7 @@ error: expected identifier, found keyword `fn`
 LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
    |                           ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn _f<F: fn(), G>(_: impl Fn(), _: &dyn fn())
    |                           ~~
@@ -26,7 +26,7 @@ error: expected identifier, found keyword `fn`
 LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
    |                                         ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn Fn())
    |                                         ~~
@@ -37,7 +37,7 @@ error: expected identifier, found keyword `fn`
 LL | G: fn(),
    |    ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | G: Fn(),
    |    ~~
diff --git a/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr b/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr
index 17138a6f079..aee31d08fe0 100644
--- a/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr
+++ b/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.stderr
@@ -4,7 +4,7 @@ error: expected identifier, found keyword `fn`
 LL | fn foo(_: impl fn() -> i32) {}
    |                ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn foo(_: impl Fn() -> i32) {}
    |                ~~
@@ -15,7 +15,7 @@ error: expected identifier, found keyword `fn`
 LL | fn foo2<T: fn(i32)>(_: T) {}
    |            ^^
    |
-help: use `Fn` to refer to the trait
+help: use `Fn` to refer to the trait (notice the capitalization difference)
    |
 LL | fn foo2<T: Fn(i32)>(_: T) {}
    |            ~~
diff --git a/tests/ui/parser/typod-const-in-const-param-def.stderr b/tests/ui/parser/typod-const-in-const-param-def.stderr
index 75d73c6ea87..80c0f1deae6 100644
--- a/tests/ui/parser/typod-const-in-const-param-def.stderr
+++ b/tests/ui/parser/typod-const-in-const-param-def.stderr
@@ -4,7 +4,7 @@ error: `const` keyword was mistyped as `Const`
 LL | pub fn foo<Const N: u8>() {}
    |            ^^^^^
    |
-help: use the `const` keyword
+help: use the `const` keyword (notice the capitalization difference)
    |
 LL | pub fn foo<const N: u8>() {}
    |            ~~~~~
@@ -15,7 +15,7 @@ error: `const` keyword was mistyped as `Const`
 LL | pub fn baz<Const N: u8, T>() {}
    |            ^^^^^
    |
-help: use the `const` keyword
+help: use the `const` keyword (notice the capitalization difference)
    |
 LL | pub fn baz<const N: u8, T>() {}
    |            ~~~~~
@@ -26,7 +26,7 @@ error: `const` keyword was mistyped as `Const`
 LL | pub fn qux<T, Const N: u8>() {}
    |               ^^^^^
    |
-help: use the `const` keyword
+help: use the `const` keyword (notice the capitalization difference)
    |
 LL | pub fn qux<T, const N: u8>() {}
    |               ~~~~~
@@ -37,7 +37,7 @@ error: `const` keyword was mistyped as `Const`
 LL | pub fn quux<T, Const N: u8, U>() {}
    |                ^^^^^
    |
-help: use the `const` keyword
+help: use the `const` keyword (notice the capitalization difference)
    |
 LL | pub fn quux<T, const N: u8, U>() {}
    |                ~~~~~