-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Taint resolution if there were multiple items of the same name
- Loading branch information
Showing
7 changed files
with
58 additions
and
52 deletions.
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
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
13 changes: 13 additions & 0 deletions
13
tests/ui/resolve/multiple_definitions_attribute_merging.rs
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 @@ | ||
//! This test used to ICE because the `repr(packed)` attributes | ||
//! ended up on the `Dealigned` struct's attribute list, but the | ||
//! derive didn't see that. | ||
#[repr(packed)] | ||
struct Dealigned<T>(u8, T); | ||
|
||
#[derive(PartialEq)] | ||
#[repr(C)] | ||
struct Dealigned<T>(u8, T); | ||
//~^ ERROR: `Dealigned` is defined multiple times | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui/resolve/multiple_definitions_attribute_merging.stderr
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,14 @@ | ||
error[E0428]: the name `Dealigned` is defined multiple times | ||
--> $DIR/multiple_definitions_attribute_merging.rs:10:1 | ||
| | ||
LL | struct Dealigned<T>(u8, T); | ||
| --------------------------- previous definition of the type `Dealigned` here | ||
... | ||
LL | struct Dealigned<T>(u8, T); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Dealigned` redefined here | ||
| | ||
= note: `Dealigned` must be defined only once in the type namespace of this module | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0428`. |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
#[derive(Clone)] //~ trait objects must include the `dyn` keyword | ||
//~^ ERROR: the size for values of type `(dyn Foo + 'static)` cannot be known | ||
//~| ERROR: return type cannot have an unboxed trait object | ||
#[derive(Clone)] | ||
struct Foo; | ||
trait Foo {} //~ the name `Foo` is defined multiple times | ||
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