File tree 5 files changed +32
-1
lines changed
compiler/rustc_passes/locales
5 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -407,10 +407,10 @@ passes_duplicate_diagnostic_item =
407
407
408
408
passes_duplicate_diagnostic_item_in_crate =
409
409
duplicate diagnostic item in crate `{ $crate_name } `: `{ $name } `.
410
+ .note = the diagnostic item is first defined in crate `{ $orig_crate_name } `.
410
411
411
412
passes_diagnostic_item_first_defined =
412
413
the diagnostic item is first defined here
413
- .note = the diagnostic item is first defined in crate `{ $orig_crate_name } `.
414
414
415
415
passes_abi =
416
416
abi: { $abi }
Original file line number Diff line number Diff line change
1
+ #![ feature( rustc_attrs) ]
2
+ #[ rustc_diagnostic_item = "Foo" ]
3
+ pub struct Foo { }
Original file line number Diff line number Diff line change
1
+ #![ feature( rustc_attrs) ]
2
+ #[ rustc_diagnostic_item = "Foo" ]
3
+ pub struct Foo { }
Original file line number Diff line number Diff line change
1
+ // aux-build: p1.rs
2
+ // aux-build: p2.rs
3
+
4
+ // error-pattern: duplicate diagnostic item in crate `p2`
5
+ // error-pattern: note: the diagnostic item is first defined in crate `p1`
6
+
7
+ #![ feature( rustc_attrs) ]
8
+ extern crate p1;
9
+ extern crate p2;
10
+
11
+ #[ rustc_diagnostic_item = "Foo" ]
12
+ pub struct Foo { } //~ ERROR duplicate diagnostic item found
13
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: duplicate diagnostic item in crate `p2`: `Foo`.
2
+ |
3
+ = note: the diagnostic item is first defined in crate `p1`.
4
+
5
+ error: duplicate diagnostic item found: `Foo`.
6
+ --> $DIR/duplicate-diagnostic.rs:12:1
7
+ |
8
+ LL | pub struct Foo {}
9
+ | ^^^^^^^^^^^^^^
10
+
11
+ error: aborting due to 2 previous errors
12
+
You can’t perform that action at this time.
0 commit comments