forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#108377 - clubby789:duplicate-diagnostic-ice…
…, r=compiler-errors Fix ICE in 'duplicate diagnostic item' diagnostic Not sure how to add this in a test; I found it by mistakenly running `cargo fix --lib -p std` rather than `x fix` at the root.
- Loading branch information
Showing
5 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#![feature(rustc_attrs)] | ||
#[rustc_diagnostic_item = "Foo"] | ||
pub struct Foo {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#![feature(rustc_attrs)] | ||
#[rustc_diagnostic_item = "Foo"] | ||
pub struct Foo {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// aux-build: p1.rs | ||
// aux-build: p2.rs | ||
|
||
// error-pattern: duplicate diagnostic item in crate `p2` | ||
// error-pattern: note: the diagnostic item is first defined in crate `p1` | ||
|
||
#![feature(rustc_attrs)] | ||
extern crate p1; | ||
extern crate p2; | ||
|
||
#[rustc_diagnostic_item = "Foo"] | ||
pub struct Foo {} //~ ERROR duplicate diagnostic item found | ||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error: duplicate diagnostic item in crate `p2`: `Foo`. | ||
| | ||
= note: the diagnostic item is first defined in crate `p1`. | ||
|
||
error: duplicate diagnostic item found: `Foo`. | ||
--> $DIR/duplicate-diagnostic.rs:12:1 | ||
| | ||
LL | pub struct Foo {} | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|