about summary refs log tree commit diff
path: root/tests/ui/methods
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-02-28 23:37:37 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-08-04 17:20:07 +0000
commit91e606b715ac4e8f59fac86d42ec2ad23f4ef169 (patch)
tree78664d6652a1c1d5fde0dc0e1882544b24cef2c9 /tests/ui/methods
parente5e79f8bd428d0b8d26e8240d718b134ef297459 (diff)
downloadrust-91e606b715ac4e8f59fac86d42ec2ad23f4ef169.tar.gz
rust-91e606b715ac4e8f59fac86d42ec2ad23f4ef169.zip
Tweak auto trait errors
Make suggestions to remove params and super traits tool-only, and make
the suggestion span more accurate.

```
error[E0567]: auto traits cannot have generic parameters
  --> $DIR/auto-trait-validation.rs:6:19
   |
LL | auto trait Generic<T> {}
   |            -------^^^
   |            |
   |            auto trait cannot have generic parameters

error[E0568]: auto traits cannot have super traits or lifetime bounds
  --> $DIR/auto-trait-validation.rs:8:20
   |
LL | auto trait Bound : Copy {}
   |            -----   ^^^^
   |            |
   |            auto traits cannot have super traits or lifetime bounds
```

```
error[E0380]: auto traits cannot have associated items
  --> $DIR/issue-23080.rs:5:8
   |
LL | unsafe auto trait Trait {
   |                   ----- auto traits cannot have associated items
LL |     fn method(&self) {
   |        ^^^^^^
```
Diffstat (limited to 'tests/ui/methods')
-rw-r--r--tests/ui/methods/issues/issue-105732.stderr2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/ui/methods/issues/issue-105732.stderr b/tests/ui/methods/issues/issue-105732.stderr
index 6244f983550..93ce695f27b 100644
--- a/tests/ui/methods/issues/issue-105732.stderr
+++ b/tests/ui/methods/issues/issue-105732.stderr
@@ -4,7 +4,7 @@ error[E0380]: auto traits cannot have associated items
 LL | auto trait Foo {
    |            --- auto traits cannot have associated items
 LL |     fn g(&self);
-   |     ---^-------- help: remove these associated items
+   |        ^
 
 error[E0599]: no method named `g` found for reference `&Self` in the current scope
   --> $DIR/issue-105732.rs:10:14