Skip to content

Commit 5bd1041

Browse files
committed
Make all auto trait suggestions message only
1 parent fb9f931 commit 5bd1041

File tree

9 files changed

+13
-57
lines changed

9 files changed

+13
-57
lines changed

compiler/rustc_ast_passes/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ pub(crate) struct ModuleNonAscii {
343343
#[diag(ast_passes_auto_generic, code = E0567)]
344344
pub(crate) struct AutoTraitGeneric {
345345
#[primary_span]
346-
#[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
346+
#[suggestion(code = "", applicability = "machine-applicable", style = "hidden")]
347347
pub span: Span,
348348
#[label]
349349
pub ident: Span,
@@ -354,7 +354,7 @@ pub(crate) struct AutoTraitGeneric {
354354
pub(crate) struct AutoTraitBounds {
355355
#[primary_span]
356356
pub span: Vec<Span>,
357-
#[suggestion(code = "", applicability = "machine-applicable", style = "verbose")]
357+
#[suggestion(code = "", applicability = "machine-applicable", style = "hidden")]
358358
pub removal: Span,
359359
#[label]
360360
pub ident: Span,

tests/ui/auto-traits/auto-trait-validation.stderr

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ LL | auto trait Generic<T> {}
66
| |
77
| auto trait cannot have generic parameters
88
|
9-
help: remove the parameters
10-
|
11-
LL - auto trait Generic<T> {}
12-
LL + auto trait Generic {}
13-
|
9+
= help: remove the parameters
1410

1511
error[E0568]: auto traits cannot have super traits or lifetime bounds
1612
--> $DIR/auto-trait-validation.rs:8:20
@@ -20,11 +16,7 @@ LL | auto trait Bound : Copy {}
2016
| |
2117
| auto traits cannot have super traits or lifetime bounds
2218
|
23-
help: remove the super traits or lifetime bounds
24-
|
25-
LL - auto trait Bound : Copy {}
26-
LL + auto trait Bound {}
27-
|
19+
= help: remove the super traits or lifetime bounds
2820

2921
error[E0568]: auto traits cannot have super traits or lifetime bounds
3022
--> $DIR/auto-trait-validation.rs:10:28
@@ -34,11 +26,7 @@ LL | auto trait LifetimeBound : 'static {}
3426
| |
3527
| auto traits cannot have super traits or lifetime bounds
3628
|
37-
help: remove the super traits or lifetime bounds
38-
|
39-
LL - auto trait LifetimeBound : 'static {}
40-
LL + auto trait LifetimeBound {}
41-
|
29+
= help: remove the super traits or lifetime bounds
4230

4331
error[E0380]: auto traits cannot have associated items
4432
--> $DIR/auto-trait-validation.rs:12:25

tests/ui/auto-traits/bad-generics-on-dyn.stderr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ LL | auto trait Trait1<'a> {}
66
| |
77
| auto trait cannot have generic parameters
88
|
9-
help: remove the parameters
10-
|
11-
LL - auto trait Trait1<'a> {}
12-
LL + auto trait Trait1 {}
13-
|
9+
= help: remove the parameters
1410

1511
error: aborting due to 1 previous error
1612

tests/ui/auto-traits/has-arguments.stderr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ LL | auto trait Trait1<'outer> {}
66
| |
77
| auto trait cannot have generic parameters
88
|
9-
help: remove the parameters
10-
|
11-
LL - auto trait Trait1<'outer> {}
12-
LL + auto trait Trait1 {}
13-
|
9+
= help: remove the parameters
1410

1511
error: aborting due to 1 previous error
1612

tests/ui/auto-traits/issue-117789.stderr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ LL | auto trait Trait<P> {}
66
| |
77
| auto trait cannot have generic parameters
88
|
9-
help: remove the parameters
10-
|
11-
LL - auto trait Trait<P> {}
12-
LL + auto trait Trait {}
13-
|
9+
= help: remove the parameters
1410

1511
error[E0658]: auto traits are experimental and possibly buggy
1612
--> $DIR/issue-117789.rs:1:1

tests/ui/auto-traits/issue-84075.stderr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ LL | auto trait Magic where Self: Copy {}
66
| |
77
| auto traits cannot have super traits or lifetime bounds
88
|
9-
help: remove the super traits or lifetime bounds
10-
|
11-
LL - auto trait Magic where Self: Copy {}
12-
LL + auto trait Magic {}
13-
|
9+
= help: remove the super traits or lifetime bounds
1410

1511
error: aborting due to 1 previous error
1612

tests/ui/auto-traits/typeck-auto-trait-no-supertraits-2.stderr

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ LL | auto trait Magic : Sized where Option<Self> : Magic {}
66
| |
77
| auto traits cannot have super traits or lifetime bounds
88
|
9-
help: remove the super traits or lifetime bounds
10-
|
11-
LL - auto trait Magic : Sized where Option<Self> : Magic {}
12-
LL + auto trait Magic where Option<Self> : Magic {}
13-
|
9+
= help: remove the super traits or lifetime bounds
1410

1511
error[E0568]: auto traits cannot have super traits or lifetime bounds
1612
--> $DIR/typeck-auto-trait-no-supertraits-2.rs:4:26
@@ -20,11 +16,7 @@ LL | auto trait Magic : Sized where Option<Self> : Magic {}
2016
| |
2117
| auto traits cannot have super traits or lifetime bounds
2218
|
23-
help: remove the super traits or lifetime bounds
24-
|
25-
LL - auto trait Magic : Sized where Option<Self> : Magic {}
26-
LL + auto trait Magic : Sized {}
27-
|
19+
= help: remove the super traits or lifetime bounds
2820

2921
error[E0382]: use of moved value: `x`
3022
--> $DIR/typeck-auto-trait-no-supertraits-2.rs:8:41

tests/ui/auto-traits/typeck-auto-trait-no-supertraits.stderr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ LL | auto trait Magic: Copy {}
66
| |
77
| auto traits cannot have super traits or lifetime bounds
88
|
9-
help: remove the super traits or lifetime bounds
10-
|
11-
LL - auto trait Magic: Copy {}
12-
LL + auto trait Magic {}
13-
|
9+
= help: remove the super traits or lifetime bounds
1410

1511
error: aborting due to 1 previous error
1612

tests/ui/traits/inductive-overflow/supertrait-auto-trait.stderr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ LL | auto trait Magic: Copy {}
66
| |
77
| auto traits cannot have super traits or lifetime bounds
88
|
9-
help: remove the super traits or lifetime bounds
10-
|
11-
LL - auto trait Magic: Copy {}
12-
LL + auto trait Magic {}
13-
|
9+
= help: remove the super traits or lifetime bounds
1410

1511
error[E0277]: the trait bound `NoClone: Magic` is not satisfied
1612
--> $DIR/supertrait-auto-trait.rs:16:23

0 commit comments

Comments
 (0)