Skip to content

Commit 6860d84

Browse files
weiznichfmease
andcommitted
Apply suggestions from code review
Co-authored-by: León Orell Valerian Liehr <[email protected]>
1 parent 7a0b29b commit 6860d84

File tree

5 files changed

+30
-33
lines changed

5 files changed

+30
-33
lines changed

compiler/rustc_trait_selection/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ trait_selection_inherent_projection_normalization_overflow = overflow evaluating
2727
trait_selection_invalid_on_clause_in_rustc_on_unimplemented = invalid `on`-clause in `#[rustc_on_unimplemented]`
2828
.label = invalid on-clause here
2929
30-
trait_selection_malformed_on_unimplemented_attr = Malformed on_unimplemented attribute
30+
trait_selection_malformed_on_unimplemented_attr = malformed `on_unimplemented` attribute
3131
3232
trait_selection_negative_positive_conflict = found both positive and negative implementation of trait `{$trait_desc}`{$self_desc ->
3333
[none] {""}

tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
#![feature(diagnostic_namespace)]
2-
// check-fail
32

43
#[diagnostic::on_unimplemented(unsupported = "foo")]
5-
//~^WARN Malformed on_unimplemented attribute
6-
//~|WARN Malformed on_unimplemented attribute
4+
//~^WARN malformed `on_unimplemented` attribute
5+
//~|WARN malformed `on_unimplemented` attribute
76
trait Foo {}
87

98
#[diagnostic::on_unimplemented(message = "Baz")]
109
//~^WARN `#[diagnostic::on_unimplemented]` can only be applied to trait definitions
1110
struct Bar {}
1211

1312
#[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
14-
//~^WARN Malformed on_unimplemented attribute
15-
//~|WARN Malformed on_unimplemented attribute
13+
//~^WARN malformed `on_unimplemented` attribute
14+
//~|WARN malformed `on_unimplemented` attribute
1615
trait Baz {}
1716

1817
#[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))]
19-
//~^WARN Malformed on_unimplemented attribute
20-
//~|WARN Malformed on_unimplemented attribute
18+
//~^WARN malformed `on_unimplemented` attribute
19+
//~|WARN malformed `on_unimplemented` attribute
2120
trait Boom {}
2221

2322
#[diagnostic::on_unimplemented = "boom"]
24-
//~^WARN Malformed on_unimplemented attribute
23+
//~^WARN malformed `on_unimplemented` attribute
2524
trait Doom {}
2625

2726
fn take_foo(_: impl Foo) {}

tests/ui/diagnostic_namespace/on_unimplemented/do_not_fail_parsing_on_invalid_options_1.stderr

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,91 @@
1-
warning: Malformed on_unimplemented attribute
2-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:4:32
1+
warning: malformed `on_unimplemented` attribute
2+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:3:32
33
|
44
LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
55
| ^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[warn(malformed_diagnostic_attributes)]` on by default
88

99
warning: `#[diagnostic::on_unimplemented]` can only be applied to trait definitions
10-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:9:1
10+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:8:1
1111
|
1212
LL | #[diagnostic::on_unimplemented(message = "Baz")]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

15-
warning: Malformed on_unimplemented attribute
16-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:13:50
15+
warning: malformed `on_unimplemented` attribute
16+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:12:50
1717
|
1818
LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
1919
| ^^^^^^^^^^^^^^^^^^^
2020

21-
warning: Malformed on_unimplemented attribute
22-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:18:50
21+
warning: malformed `on_unimplemented` attribute
22+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:17:50
2323
|
2424
LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))]
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2626

27-
warning: Malformed on_unimplemented attribute
28-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:23:1
27+
warning: malformed `on_unimplemented` attribute
28+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:22:1
2929
|
3030
LL | #[diagnostic::on_unimplemented = "boom"]
3131
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3232

33-
warning: Malformed on_unimplemented attribute
34-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:4:32
33+
warning: malformed `on_unimplemented` attribute
34+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:3:32
3535
|
3636
LL | #[diagnostic::on_unimplemented(unsupported = "foo")]
3737
| ^^^^^^^^^^^^^^^^^^^
3838

3939
error[E0277]: the trait bound `i32: Foo` is not satisfied
40-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:32:14
40+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:31:14
4141
|
4242
LL | take_foo(1_i32);
4343
| -------- ^^^^^ the trait `Foo` is not implemented for `i32`
4444
| |
4545
| required by a bound introduced by this call
4646
|
4747
note: required by a bound in `take_foo`
48-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:27:21
48+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:26:21
4949
|
5050
LL | fn take_foo(_: impl Foo) {}
5151
| ^^^ required by this bound in `take_foo`
5252

53-
warning: Malformed on_unimplemented attribute
54-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:13:50
53+
warning: malformed `on_unimplemented` attribute
54+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:12:50
5555
|
5656
LL | #[diagnostic::on_unimplemented(message = "Boom", unsupported = "Bar")]
5757
| ^^^^^^^^^^^^^^^^^^^
5858

5959
error[E0277]: Boom
60-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:34:14
60+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:33:14
6161
|
6262
LL | take_baz(1_i32);
6363
| -------- ^^^^^ the trait `Baz` is not implemented for `i32`
6464
| |
6565
| required by a bound introduced by this call
6666
|
6767
note: required by a bound in `take_baz`
68-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:28:21
68+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:27:21
6969
|
7070
LL | fn take_baz(_: impl Baz) {}
7171
| ^^^ required by this bound in `take_baz`
7272

73-
warning: Malformed on_unimplemented attribute
74-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:18:50
73+
warning: malformed `on_unimplemented` attribute
74+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:17:50
7575
|
7676
LL | #[diagnostic::on_unimplemented(message = "Boom", on(_Self = "i32", message = "whatever"))]
7777
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7878

7979
error[E0277]: Boom
80-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:36:15
80+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:35:15
8181
|
8282
LL | take_boom(1_i32);
8383
| --------- ^^^^^ the trait `Boom` is not implemented for `i32`
8484
| |
8585
| required by a bound introduced by this call
8686
|
8787
note: required by a bound in `take_boom`
88-
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:29:22
88+
--> $DIR/do_not_fail_parsing_on_invalid_options_1.rs:28:22
8989
|
9090
LL | fn take_boom(_: impl Boom) {}
9191
| ^^^^ required by this bound in `take_boom`

tests/ui/diagnostic_namespace/on_unimplemented/feature-gate-diagnostic_on_unimplemented.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// check-fail
2-
31
#[diagnostic::on_unimplemented(message = "Foo")]
42
//~^ERROR `#[diagnostic]` attribute name space is experimental [E0658]
53
pub trait Bar {

tests/ui/diagnostic_namespace/on_unimplemented/feature-gate-diagnostic_on_unimplemented.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: `#[diagnostic]` attribute name space is experimental
2-
--> $DIR/feature-gate-diagnostic_on_unimplemented.rs:3:3
2+
--> $DIR/feature-gate-diagnostic_on_unimplemented.rs:1:3
33
|
44
LL | #[diagnostic::on_unimplemented(message = "Foo")]
55
| ^^^^^^^^^^

0 commit comments

Comments
 (0)