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.
Suppress copy impl error when post-normalized type references errors
- Loading branch information
1 parent
1a521db
commit 8a99ffc
Showing
5 changed files
with
49 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,16 @@ | ||
trait AsPtr { | ||
type Ptr; | ||
} | ||
|
||
impl AsPtr for () { | ||
type Ptr = *const void; | ||
//~^ ERROR cannot find type `void` in this scope | ||
} | ||
|
||
#[derive(Copy, Clone)] | ||
struct Foo { | ||
p: <() as AsPtr>::Ptr, | ||
// Do not report a "`Copy` cannot be implemented" here. | ||
} | ||
|
||
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,9 @@ | ||
error[E0412]: cannot find type `void` in this scope | ||
--> $DIR/illegal-copy-bad-projection.rs:6:23 | ||
| | ||
LL | type Ptr = *const void; | ||
| ^^^^ not found in this scope | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |
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,9 @@ | ||
#[derive(Copy, Clone)] | ||
pub struct Foo { | ||
x: [u8; SIZE], | ||
//~^ ERROR mismatched types | ||
} | ||
|
||
const SIZE: u32 = 1; | ||
|
||
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,9 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/bad-generic-in-copy-impl.rs:3:13 | ||
| | ||
LL | x: [u8; SIZE], | ||
| ^^^^ expected `usize`, found `u32` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |