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#117277 - RalfJung:too-big-with-padding, r=o…
…li-obk fix failure to detect a too-big-type after adding padding Fixes rust-lang#117265
- Loading branch information
Showing
4 changed files
with
34 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// build-fail | ||
// compile-flags: --target i686-unknown-linux-gnu --crate-type lib | ||
// needs-llvm-components: x86 | ||
#![feature(no_core, lang_items)] | ||
#![allow(internal_features)] | ||
#![no_std] | ||
#![no_core] | ||
|
||
// 0x7fffffff is fine, but after rounding up it becomes too big | ||
#[repr(C, align(2))] | ||
pub struct Example([u8; 0x7fffffff]); | ||
|
||
pub fn lib(_x: Example) {} //~ERROR: too big for the current architecture | ||
|
||
#[lang = "sized"] | ||
pub trait Sized {} | ||
#[lang = "copy"] | ||
pub trait Copy: Sized {} |
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,8 @@ | ||
error: values of the type `Example` are too big for the current architecture | ||
--> $DIR/too-big-with-padding.rs:13:1 | ||
| | ||
LL | pub fn lib(_x: Example) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|