Skip to content

Commit 24ba1ad

Browse files
authored
Rollup merge of rust-lang#137242 - ehuss:reference-do_not_recommend, r=compiler-errors
Add reference annotations for the `do_not_recommend` attribute This adds reference rule identifiers for the tests of the `diagnostic::do_not_recommend` attribute.
2 parents e51fae5 + 0a09419 commit 24ba1ad

27 files changed

+59
-50
lines changed

tests/ui/diagnostic_namespace/do_not_recommend/as_expression.current.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `&str: AsExpression<Integer>` is not satisfied
2-
--> $DIR/as_expression.rs:55:15
2+
--> $DIR/as_expression.rs:56:15
33
|
44
LL | SelectInt.check("bar");
55
| ^^^^^ the trait `AsExpression<Integer>` is not implemented for `&str`

tests/ui/diagnostic_namespace/do_not_recommend/as_expression.next.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `&str: AsExpression<<SelectInt as Expression>::SqlType>` is not satisfied
2-
--> $DIR/as_expression.rs:55:21
2+
--> $DIR/as_expression.rs:56:21
33
|
44
LL | SelectInt.check("bar");
55
| ----- ^^^^^ the trait `AsExpression<<SelectInt as Expression>::SqlType>` is not implemented for `&str`
@@ -8,7 +8,7 @@ LL | SelectInt.check("bar");
88
|
99
= help: the trait `AsExpression<Text>` is implemented for `&str`
1010
note: required by a bound in `Foo::check`
11-
--> $DIR/as_expression.rs:46:12
11+
--> $DIR/as_expression.rs:47:12
1212
|
1313
LL | fn check<T>(&self, _: T) -> <T as AsExpression<<Self as Expression>::SqlType>>::Expression
1414
| ----- required by a bound in this associated function
@@ -17,7 +17,7 @@ LL | T: AsExpression<Self::SqlType>,
1717
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo::check`
1818

1919
error[E0271]: type mismatch resolving `<SelectInt as Expression>::SqlType == Text`
20-
--> $DIR/as_expression.rs:55:5
20+
--> $DIR/as_expression.rs:56:5
2121
|
2222
LL | SelectInt.check("bar");
2323
| ^^^^^^^^^^^^^^^^^^^^^^ expected `Text`, found `Integer`

tests/ui/diagnostic_namespace/do_not_recommend/as_expression.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: current next
22
//@ ignore-compare-mode-next-solver (explicit revisions)
33
//@[next] compile-flags: -Znext-solver
4+
//@ reference: attributes.diagnostic.do_not_recommend.intro
45

56
pub trait Expression {
67
type SqlType;

tests/ui/diagnostic_namespace/do_not_recommend/does_not_acccept_args.current.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
2-
--> $DIR/does_not_acccept_args.rs:10:1
2+
--> $DIR/does_not_acccept_args.rs:11:1
33
|
44
LL | #[diagnostic::do_not_recommend(not_accepted)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
10-
--> $DIR/does_not_acccept_args.rs:14:1
10+
--> $DIR/does_not_acccept_args.rs:15:1
1111
|
1212
LL | #[diagnostic::do_not_recommend(not_accepted = "foo")]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
16-
--> $DIR/does_not_acccept_args.rs:18:1
16+
--> $DIR/does_not_acccept_args.rs:19:1
1717
|
1818
LL | #[diagnostic::do_not_recommend(not_accepted(42))]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/diagnostic_namespace/do_not_recommend/does_not_acccept_args.next.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
2-
--> $DIR/does_not_acccept_args.rs:10:1
2+
--> $DIR/does_not_acccept_args.rs:11:1
33
|
44
LL | #[diagnostic::do_not_recommend(not_accepted)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
10-
--> $DIR/does_not_acccept_args.rs:14:1
10+
--> $DIR/does_not_acccept_args.rs:15:1
1111
|
1212
LL | #[diagnostic::do_not_recommend(not_accepted = "foo")]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
warning: `#[diagnostic::do_not_recommend]` does not expect any arguments
16-
--> $DIR/does_not_acccept_args.rs:18:1
16+
--> $DIR/does_not_acccept_args.rs:19:1
1717
|
1818
LL | #[diagnostic::do_not_recommend(not_accepted(42))]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/diagnostic_namespace/do_not_recommend/does_not_acccept_args.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@ revisions: current next
33
//@ ignore-compare-mode-next-solver (explicit revisions)
44
//@[next] compile-flags: -Znext-solver
5+
//@ reference: attributes.diagnostic.do_not_recommend.syntax
56

67
trait Foo {}
78
trait Bar {}

tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.current.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
2-
--> $DIR/incorrect-locations.rs:6:1
2+
--> $DIR/incorrect-locations.rs:7:1
33
|
44
LL | #[diagnostic::do_not_recommend]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
10-
--> $DIR/incorrect-locations.rs:10:1
10+
--> $DIR/incorrect-locations.rs:11:1
1111
|
1212
LL | #[diagnostic::do_not_recommend]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
16-
--> $DIR/incorrect-locations.rs:14:1
16+
--> $DIR/incorrect-locations.rs:15:1
1717
|
1818
LL | #[diagnostic::do_not_recommend]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020

2121
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
22-
--> $DIR/incorrect-locations.rs:18:1
22+
--> $DIR/incorrect-locations.rs:19:1
2323
|
2424
LL | #[diagnostic::do_not_recommend]
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2626

2727
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
28-
--> $DIR/incorrect-locations.rs:22:1
28+
--> $DIR/incorrect-locations.rs:23:1
2929
|
3030
LL | #[diagnostic::do_not_recommend]
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232

3333
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
34-
--> $DIR/incorrect-locations.rs:26:1
34+
--> $DIR/incorrect-locations.rs:27:1
3535
|
3636
LL | #[diagnostic::do_not_recommend]
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3838

3939
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
40-
--> $DIR/incorrect-locations.rs:30:1
40+
--> $DIR/incorrect-locations.rs:31:1
4141
|
4242
LL | #[diagnostic::do_not_recommend]
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4444

4545
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
46-
--> $DIR/incorrect-locations.rs:34:1
46+
--> $DIR/incorrect-locations.rs:35:1
4747
|
4848
LL | #[diagnostic::do_not_recommend]
4949
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5050

5151
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
52-
--> $DIR/incorrect-locations.rs:38:1
52+
--> $DIR/incorrect-locations.rs:39:1
5353
|
5454
LL | #[diagnostic::do_not_recommend]
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.next.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
2-
--> $DIR/incorrect-locations.rs:6:1
2+
--> $DIR/incorrect-locations.rs:7:1
33
|
44
LL | #[diagnostic::do_not_recommend]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
10-
--> $DIR/incorrect-locations.rs:10:1
10+
--> $DIR/incorrect-locations.rs:11:1
1111
|
1212
LL | #[diagnostic::do_not_recommend]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
16-
--> $DIR/incorrect-locations.rs:14:1
16+
--> $DIR/incorrect-locations.rs:15:1
1717
|
1818
LL | #[diagnostic::do_not_recommend]
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2020

2121
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
22-
--> $DIR/incorrect-locations.rs:18:1
22+
--> $DIR/incorrect-locations.rs:19:1
2323
|
2424
LL | #[diagnostic::do_not_recommend]
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2626

2727
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
28-
--> $DIR/incorrect-locations.rs:22:1
28+
--> $DIR/incorrect-locations.rs:23:1
2929
|
3030
LL | #[diagnostic::do_not_recommend]
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232

3333
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
34-
--> $DIR/incorrect-locations.rs:26:1
34+
--> $DIR/incorrect-locations.rs:27:1
3535
|
3636
LL | #[diagnostic::do_not_recommend]
3737
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3838

3939
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
40-
--> $DIR/incorrect-locations.rs:30:1
40+
--> $DIR/incorrect-locations.rs:31:1
4141
|
4242
LL | #[diagnostic::do_not_recommend]
4343
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4444

4545
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
46-
--> $DIR/incorrect-locations.rs:34:1
46+
--> $DIR/incorrect-locations.rs:35:1
4747
|
4848
LL | #[diagnostic::do_not_recommend]
4949
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5050

5151
warning: `#[diagnostic::do_not_recommend]` can only be placed on trait implementations
52-
--> $DIR/incorrect-locations.rs:38:1
52+
--> $DIR/incorrect-locations.rs:39:1
5353
|
5454
LL | #[diagnostic::do_not_recommend]
5555
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/diagnostic_namespace/do_not_recommend/incorrect-locations.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@ revisions: current next
33
//@ ignore-compare-mode-next-solver (explicit revisions)
44
//@[next] compile-flags: -Znext-solver
5+
//@ reference: attributes.diagnostic.do_not_recommend.allowed-positions
56

67
#[diagnostic::do_not_recommend]
78
//~^WARN `#[diagnostic::do_not_recommend]` can only be placed

tests/ui/diagnostic_namespace/do_not_recommend/nested.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `(): Root` is not satisfied
2-
--> $DIR/nested.rs:21:18
2+
--> $DIR/nested.rs:22:18
33
|
44
LL | needs_root::<()>();
55
| ^^ the trait `Root` is not implemented for `()`
66
|
77
note: required by a bound in `needs_root`
8-
--> $DIR/nested.rs:18:18
8+
--> $DIR/nested.rs:19:18
99
|
1010
LL | fn needs_root<T: Root>() {}
1111
| ^^^^ required by this bound in `needs_root`

tests/ui/diagnostic_namespace/do_not_recommend/nested.next.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `(): Root` is not satisfied
2-
--> $DIR/nested.rs:21:18
2+
--> $DIR/nested.rs:22:18
33
|
44
LL | needs_root::<()>();
55
| ^^ the trait `Root` is not implemented for `()`
66
|
77
note: required by a bound in `needs_root`
8-
--> $DIR/nested.rs:18:18
8+
--> $DIR/nested.rs:19:18
99
|
1010
LL | fn needs_root<T: Root>() {}
1111
| ^^^^ required by this bound in `needs_root`

tests/ui/diagnostic_namespace/do_not_recommend/nested.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: current next
22
//@ ignore-compare-mode-next-solver (explicit revisions)
33
//@[next] compile-flags: -Znext-solver
4+
//@ reference: attributes.diagnostic.do_not_recommend.intro
45

56
trait Root {}
67
trait DontRecommend {}

tests/ui/diagnostic_namespace/do_not_recommend/simple.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `*mut (): Foo` is not satisfied
2-
--> $DIR/simple.rs:15:17
2+
--> $DIR/simple.rs:16:17
33
|
44
LL | needs_foo::<*mut ()>();
55
| ^^^^^^^ the trait `Foo` is not implemented for `*mut ()`
66
|
77
note: required by a bound in `needs_foo`
8-
--> $DIR/simple.rs:10:17
8+
--> $DIR/simple.rs:11:17
99
|
1010
LL | fn needs_foo<T: Foo>() {}
1111
| ^^^ required by this bound in `needs_foo`

tests/ui/diagnostic_namespace/do_not_recommend/simple.next.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `*mut (): Foo` is not satisfied
2-
--> $DIR/simple.rs:15:17
2+
--> $DIR/simple.rs:16:17
33
|
44
LL | needs_foo::<*mut ()>();
55
| ^^^^^^^ the trait `Foo` is not implemented for `*mut ()`
66
|
77
note: required by a bound in `needs_foo`
8-
--> $DIR/simple.rs:10:17
8+
--> $DIR/simple.rs:11:17
99
|
1010
LL | fn needs_foo<T: Foo>() {}
1111
| ^^^ required by this bound in `needs_foo`

tests/ui/diagnostic_namespace/do_not_recommend/simple.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: current next
22
//@ ignore-compare-mode-next-solver (explicit revisions)
33
//@[next] compile-flags: -Znext-solver
4+
//@ reference: attributes.diagnostic.do_not_recommend.intro
45

56
trait Foo {}
67

tests/ui/diagnostic_namespace/do_not_recommend/stacked.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `(): Root` is not satisfied
2-
--> $DIR/stacked.rs:17:18
2+
--> $DIR/stacked.rs:18:18
33
|
44
LL | needs_root::<()>();
55
| ^^ the trait `Root` is not implemented for `()`
66
|
77
note: required by a bound in `needs_root`
8-
--> $DIR/stacked.rs:14:18
8+
--> $DIR/stacked.rs:15:18
99
|
1010
LL | fn needs_root<T: Root>() {}
1111
| ^^^^ required by this bound in `needs_root`

tests/ui/diagnostic_namespace/do_not_recommend/stacked.next.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `(): Root` is not satisfied
2-
--> $DIR/stacked.rs:17:18
2+
--> $DIR/stacked.rs:18:18
33
|
44
LL | needs_root::<()>();
55
| ^^ the trait `Root` is not implemented for `()`
66
|
77
note: required by a bound in `needs_root`
8-
--> $DIR/stacked.rs:14:18
8+
--> $DIR/stacked.rs:15:18
99
|
1010
LL | fn needs_root<T: Root>() {}
1111
| ^^^^ required by this bound in `needs_root`

tests/ui/diagnostic_namespace/do_not_recommend/stacked.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: current next
22
//@ ignore-compare-mode-next-solver (explicit revisions)
33
//@[next] compile-flags: -Znext-solver
4+
//@ reference: attributes.diagnostic.do_not_recommend.intro
45

56
trait Root {}
67
trait DontRecommend {}

tests/ui/diagnostic_namespace/do_not_recommend/supress_suggestions_in_help.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `(): Foo` is not satisfied
2-
--> $DIR/supress_suggestions_in_help.rs:21:11
2+
--> $DIR/supress_suggestions_in_help.rs:22:11
33
|
44
LL | check(());
55
| ----- ^^ the trait `Foo` is not implemented for `()`
@@ -8,7 +8,7 @@ LL | check(());
88
|
99
= help: the trait `Foo` is implemented for `i32`
1010
note: required by a bound in `check`
11-
--> $DIR/supress_suggestions_in_help.rs:18:18
11+
--> $DIR/supress_suggestions_in_help.rs:19:18
1212
|
1313
LL | fn check(a: impl Foo) {}
1414
| ^^^ required by this bound in `check`

tests/ui/diagnostic_namespace/do_not_recommend/supress_suggestions_in_help.next.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `(): Foo` is not satisfied
2-
--> $DIR/supress_suggestions_in_help.rs:21:11
2+
--> $DIR/supress_suggestions_in_help.rs:22:11
33
|
44
LL | check(());
55
| ----- ^^ the trait `Foo` is not implemented for `()`
@@ -8,7 +8,7 @@ LL | check(());
88
|
99
= help: the trait `Foo` is implemented for `i32`
1010
note: required by a bound in `check`
11-
--> $DIR/supress_suggestions_in_help.rs:18:18
11+
--> $DIR/supress_suggestions_in_help.rs:19:18
1212
|
1313
LL | fn check(a: impl Foo) {}
1414
| ^^^ required by this bound in `check`

tests/ui/diagnostic_namespace/do_not_recommend/supress_suggestions_in_help.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: current next
22
//@ ignore-compare-mode-next-solver (explicit revisions)
33
//@[next] compile-flags: -Znext-solver
4+
//@ reference: attributes.diagnostic.do_not_recommend.intro
45

56
trait Foo {}
67

tests/ui/diagnostic_namespace/do_not_recommend/type_mismatch.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: Very important message!
2-
--> $DIR/type_mismatch.rs:23:14
2+
--> $DIR/type_mismatch.rs:24:14
33
|
44
LL | verify::<u8>();
55
| ^^ the trait `TheImportantOne` is not implemented for `u8`
66
|
77
note: required by a bound in `verify`
8-
--> $DIR/type_mismatch.rs:20:14
8+
--> $DIR/type_mismatch.rs:21:14
99
|
1010
LL | fn verify<T: TheImportantOne>() {}
1111
| ^^^^^^^^^^^^^^^ required by this bound in `verify`

0 commit comments

Comments
 (0)