-
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.
Auto merge of #94369 - matthiaskrgr:rollup-qtripm2, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #93850 (Don't ICE when an extern static is too big for the current architecture) - #94154 (Wire up unstable rustc --check-cfg to rustdoc) - #94353 (Fix debug_assert in unused lint pass) - #94366 (Add missing item to release notes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
20 changed files
with
182 additions
and
18 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
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
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,12 @@ | ||
// check-pass | ||
// compile-flags: --test --nocapture --check-cfg=values(feature,"test") -Z unstable-options | ||
// normalize-stderr-test: "src/test/rustdoc-ui" -> "$$DIR" | ||
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" | ||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" | ||
|
||
/// The doctest will produce a warning because feature invalid is unexpected | ||
/// ``` | ||
/// #[cfg(feature = "invalid")] | ||
/// assert!(false); | ||
/// ``` | ||
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,11 @@ | ||
warning: unexpected `cfg` condition value | ||
--> $DIR/check-cfg-test.rs:9:7 | ||
| | ||
LL | #[cfg(feature = "invalid")] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(unexpected_cfgs)]` on by default | ||
= note: expected values for `feature` are: test | ||
|
||
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,6 @@ | ||
|
||
running 1 test | ||
test $DIR/check-cfg-test.rs - Foo (line 8) ... ok | ||
|
||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME | ||
|
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,2 @@ | ||
// check-fail | ||
// compile-flags: --check-cfg=names() |
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,2 @@ | ||
error: the `-Z unstable-options` flag must also be passed to enable the flag `check-cfg` | ||
|
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,7 @@ | ||
// check-pass | ||
// compile-flags: --check-cfg=names() -Z unstable-options | ||
|
||
/// uniz is nor a builtin nor pass as arguments so is unexpected | ||
#[cfg(uniz)] | ||
//~^ WARNING unexpected `cfg` condition name | ||
pub struct Bar; |
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,10 @@ | ||
warning: unexpected `cfg` condition name | ||
--> $DIR/check-cfg.rs:5:7 | ||
| | ||
LL | #[cfg(uniz)] | ||
| ^^^^ help: did you mean: `unix` | ||
| | ||
= note: `#[warn(unexpected_cfgs)]` 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,43 @@ | ||
#[repr(C)] | ||
struct ReallyBig { | ||
_a: [u8; usize::MAX], | ||
} | ||
|
||
// The limit for "too big for the current architecture" is dependent on the target pointer size | ||
// however it's artifically limited on 64 bits | ||
// logic copied from rustc_target::abi::TargetDataLayout::obj_size_bound() | ||
const fn max_size() -> usize { | ||
#[cfg(target_pointer_width = "16")] | ||
{ | ||
1 << 15 | ||
} | ||
|
||
#[cfg(target_pointer_width = "32")] | ||
{ | ||
1 << 31 | ||
} | ||
|
||
#[cfg(target_pointer_width = "64")] | ||
{ | ||
1 << 47 | ||
} | ||
|
||
#[cfg(not(any( | ||
target_pointer_width = "16", | ||
target_pointer_width = "32", | ||
target_pointer_width = "64" | ||
)))] | ||
{ | ||
isize::MAX as usize | ||
} | ||
} | ||
|
||
extern "C" { | ||
static FOO: [u8; 1]; | ||
static BAR: [u8; max_size() - 1]; | ||
static BAZ: [u8; max_size()]; //~ ERROR extern static is too large | ||
static UWU: [usize; usize::MAX]; //~ ERROR extern static is too large | ||
static A: ReallyBig; //~ ERROR extern static is too large | ||
} | ||
|
||
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,20 @@ | ||
error: extern static is too large for the current architecture | ||
--> $DIR/extern-static-size-overflow.rs:38:5 | ||
| | ||
LL | static BAZ: [u8; max_size()]; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: extern static is too large for the current architecture | ||
--> $DIR/extern-static-size-overflow.rs:39:5 | ||
| | ||
LL | static UWU: [usize; usize::MAX]; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: extern static is too large for the current architecture | ||
--> $DIR/extern-static-size-overflow.rs:40:5 | ||
| | ||
LL | static A: ReallyBig; | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
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