about summary refs log tree commit diff
path: root/tests/ui/rfcs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-08-19 17:49:20 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-08-22 17:55:15 +0000
commit049c32797b5f797d5823cdc0e5aaeb0fd68175da (patch)
tree1fd5b318305954b5845a8794a33506bd3fa18e73 /tests/ui/rfcs
parentf5703d5dd3eec176f86a6e9bf7e668b48b84eabb (diff)
downloadrust-049c32797b5f797d5823cdc0e5aaeb0fd68175da.tar.gz
rust-049c32797b5f797d5823cdc0e5aaeb0fd68175da.zip
On E0277, point at type that doesn't implement bound
When encountering an unmet trait bound, point at local type that doesn't implement the trait:

```
error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied
  --> $DIR/issue-64855.rs:9:19
   |
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
   |                   ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
   |
help: the trait `Foo` is not implemented for `Bar<T>`
  --> $DIR/issue-64855.rs:9:1
   |
LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ;
   | ^^^^^^^^^^^^^^^^^
```
Diffstat (limited to 'tests/ui/rfcs')
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr7
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.stderr7
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr6
3 files changed, 17 insertions, 3 deletions
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr
index 6c3d576cfba..7baa09b02b8 100644
--- a/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr
@@ -2,10 +2,15 @@ error[E0277]: the trait bound `Something: Termination` is not satisfied
   --> $DIR/issue-103052-1.rs:10:13
    |
 LL |     receive(Something);
-   |     ------- ^^^^^^^^^ the trait `Termination` is not implemented for `Something`
+   |     ------- ^^^^^^^^^ unsatisfied trait bound
    |     |
    |     required by a bound introduced by this call
    |
+help: the trait `Termination` is not implemented for `Something`
+  --> $DIR/issue-103052-1.rs:7:1
+   |
+LL | struct Something;
+   | ^^^^^^^^^^^^^^^^
 note: required by a bound in `receive`
   --> $DIR/issue-103052-1.rs:5:20
    |
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.stderr
index 99fd83e7b6f..643e3d3b680 100644
--- a/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.stderr
@@ -2,8 +2,13 @@ error[E0277]: the trait bound `Something: Termination` is not satisfied
   --> $DIR/issue-103052-2.rs:9:22
    |
 LL |         fn main() -> Something {
-   |                      ^^^^^^^^^ the trait `Termination` is not implemented for `Something`
+   |                      ^^^^^^^^^ unsatisfied trait bound
    |
+help: the trait `Termination` is not implemented for `Something`
+  --> $DIR/issue-103052-2.rs:6:5
+   |
+LL |     struct Something;
+   |     ^^^^^^^^^^^^^^^^
 note: required by a bound in `Main::main::{anon_assoc#0}`
   --> $DIR/issue-103052-2.rs:3:27
    |
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr
index 1b842c206ee..e799ba3f1b9 100644
--- a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr
@@ -4,7 +4,11 @@ error[E0277]: `main` has invalid return type `ReturnType`
 LL | fn main() -> ReturnType {
    |              ^^^^^^^^^^ `main` can only return types that implement `Termination`
    |
-   = help: consider using `()`, or a `Result`
+help: consider using `()`, or a `Result`
+  --> $DIR/termination-trait-not-satisfied.rs:1:1
+   |
+LL | struct ReturnType {}
+   | ^^^^^^^^^^^^^^^^^
 
 error: aborting due to 1 previous error