about summary refs log tree commit diff
path: root/tests/ui/unsafe-fields
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/unsafe-fields
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/unsafe-fields')
-rw-r--r--tests/ui/unsafe-fields/auto-traits.current.stderr7
-rw-r--r--tests/ui/unsafe-fields/auto-traits.next.stderr7
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/ui/unsafe-fields/auto-traits.current.stderr b/tests/ui/unsafe-fields/auto-traits.current.stderr
index 53a97458b7c..2483556b139 100644
--- a/tests/ui/unsafe-fields/auto-traits.current.stderr
+++ b/tests/ui/unsafe-fields/auto-traits.current.stderr
@@ -2,10 +2,15 @@ error[E0277]: the trait bound `UnsafeEnum: UnsafeAuto` is not satisfied
   --> $DIR/auto-traits.rs:24:22
    |
 LL |     impl_unsafe_auto(UnsafeEnum::Safe(42));
-   |     ---------------- ^^^^^^^^^^^^^^^^^^^^ the trait `UnsafeAuto` is not implemented for `UnsafeEnum`
+   |     ---------------- ^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
    |     |
    |     required by a bound introduced by this call
    |
+help: the trait `UnsafeAuto` is not implemented for `UnsafeEnum`
+  --> $DIR/auto-traits.rs:9:1
+   |
+LL | enum UnsafeEnum {
+   | ^^^^^^^^^^^^^^^
 note: required by a bound in `impl_unsafe_auto`
   --> $DIR/auto-traits.rs:20:29
    |
diff --git a/tests/ui/unsafe-fields/auto-traits.next.stderr b/tests/ui/unsafe-fields/auto-traits.next.stderr
index 53a97458b7c..2483556b139 100644
--- a/tests/ui/unsafe-fields/auto-traits.next.stderr
+++ b/tests/ui/unsafe-fields/auto-traits.next.stderr
@@ -2,10 +2,15 @@ error[E0277]: the trait bound `UnsafeEnum: UnsafeAuto` is not satisfied
   --> $DIR/auto-traits.rs:24:22
    |
 LL |     impl_unsafe_auto(UnsafeEnum::Safe(42));
-   |     ---------------- ^^^^^^^^^^^^^^^^^^^^ the trait `UnsafeAuto` is not implemented for `UnsafeEnum`
+   |     ---------------- ^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
    |     |
    |     required by a bound introduced by this call
    |
+help: the trait `UnsafeAuto` is not implemented for `UnsafeEnum`
+  --> $DIR/auto-traits.rs:9:1
+   |
+LL | enum UnsafeEnum {
+   | ^^^^^^^^^^^^^^^
 note: required by a bound in `impl_unsafe_auto`
   --> $DIR/auto-traits.rs:20:29
    |