-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check both align and size in PointerSized
- Loading branch information
1 parent
84b06d5
commit 5edbf2c
Showing
4 changed files
with
50 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,11 @@ | ||
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/align.rs:4:12 | ||
| | ||
LL | #![feature(dyn_star)] | ||
| ^^^^^^^^ | ||
| | ||
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
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,20 @@ | ||
warning: the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/align.rs:4:12 | ||
| | ||
LL | #![feature(dyn_star)] | ||
| ^^^^^^^^ | ||
| | ||
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error[E0277]: `AlignedUsize` needs to be a pointer-sized type | ||
--> $DIR/align.rs:15:13 | ||
| | ||
LL | let x = AlignedUsize(12) as dyn* Debug; | ||
| ^^^^^^^^^^^^^^^^ `AlignedUsize` needs to be a pointer-sized type | ||
| | ||
= help: the trait `PointerSized` is not implemented for `AlignedUsize` | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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,17 @@ | ||
// revisions: normal over_aligned | ||
//[normal] check-pass | ||
|
||
#![feature(dyn_star)] | ||
//~^ WARN the feature `dyn_star` is incomplete and may not be safe to use and/or cause compiler crashes | ||
|
||
use std::fmt::Debug; | ||
|
||
#[cfg_attr(over_aligned, repr(C, align(1024)))] | ||
#[cfg_attr(not(over_aligned), repr(C))] | ||
#[derive(Debug)] | ||
struct AlignedUsize(usize); | ||
|
||
fn main() { | ||
let x = AlignedUsize(12) as dyn* Debug; | ||
//[over_aligned]~^ ERROR `AlignedUsize` needs to be a pointer-sized type | ||
} |