From 1b96797c0855dbe0bad2c7f98a21202aec718aae Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Tue, 7 Apr 2026 00:32:29 +0300 Subject: [PATCH] address review comments --- compiler/rustc_metadata/src/errors.rs | 2 +- compiler/rustc_metadata/src/rmeta/decoder.rs | 7 +- compiler/rustc_metadata/src/rmeta/encoder.rs | 4 +- .../src/options/mitigation_coverage.rs | 10 +- tests/ui/README.md | 4 +- ...d-future-allow-reset-by-mitigation.stderr} | 20 ++-- .../err-allow-partial-mitigations-1-error.rs | 35 +++++-- ...llow-partial-mitigations-1-error.sp.stderr | 47 ---------- ...or.stack-protector-allow-then-deny.stderr} | 20 ++-- ...ector-but-allow-control-flow-guard.stderr} | 20 ++-- ...r-future-allow-reset-by-mitigation.stderr} | 20 ++-- ...ure-deny-allow-reset-by-mitigation.stderr} | 20 ++-- ...tor-future-deny-reset-by-mitigation.stderr | 47 ++++++++++ ...tack-protector-future-explicit-deny.stderr | 47 ++++++++++ ...ions-1-error.stack-protector-future.stderr | 47 ++++++++++ ...al-mitigations-1-error.wrong-enable.stderr | 47 ---------- ...w-partial-mitigations-2-errors.both.stderr | 40 ++++---- ....enable-separately-disable-together.stderr | 40 ++++---- ....enable-together-disable-separately.stderr | 92 +++++++++++++++++++ .../err-allow-partial-mitigations-2-errors.rs | 12 ++- .../err-allow-partial-mitigations-bad-cli.rs | 2 +- ...on.control-flow-2024-explicit-deny.stderr} | 20 ++-- ...low-partial-mitigations-current-edition.rs | 3 +- ...low-partial-mitigations-current-edition.rs | 20 +++- .../ok-allow-partial-mitigations.rs | 15 ++- 25 files changed, 416 insertions(+), 225 deletions(-) rename tests/ui/allow-partial-mitigations/{err-allow-partial-mitigations-1-error.cfg-allow-first.stderr => err-allow-partial-mitigations-1-error.control-flow-guard-future-allow-reset-by-mitigation.stderr} (76%) delete mode 100644 tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.sp.stderr rename tests/ui/allow-partial-mitigations/{err-allow-partial-mitigations-1-error.sp-allow-first.stderr => err-allow-partial-mitigations-1-error.stack-protector-allow-then-deny.stderr} (76%) rename tests/ui/allow-partial-mitigations/{err-allow-partial-mitigations-1-error.disable-enable-reset.stderr => err-allow-partial-mitigations-1-error.stack-protector-but-allow-control-flow-guard.stderr} (76%) rename tests/ui/allow-partial-mitigations/{err-allow-partial-mitigations-1-error.disable.stderr => err-allow-partial-mitigations-1-error.stack-protector-future-allow-reset-by-mitigation.stderr} (76%) rename tests/ui/allow-partial-mitigations/{err-allow-partial-mitigations-1-error.enable-disable.stderr => err-allow-partial-mitigations-1-error.stack-protector-future-deny-allow-reset-by-mitigation.stderr} (76%) create mode 100644 tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-deny-reset-by-mitigation.stderr create mode 100644 tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-explicit-deny.stderr create mode 100644 tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future.stderr delete mode 100644 tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.wrong-enable.stderr create mode 100644 tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.enable-together-disable-separately.stderr rename tests/ui/allow-partial-mitigations/{err-allow-partial-mitigations-current-edition.stderr => err-allow-partial-mitigations-current-edition.control-flow-2024-explicit-deny.stderr} (75%) diff --git a/compiler/rustc_metadata/src/errors.rs b/compiler/rustc_metadata/src/errors.rs index 79568dcec81e..a6f35a179d70 100644 --- a/compiler/rustc_metadata/src/errors.rs +++ b/compiler/rustc_metadata/src/errors.rs @@ -702,7 +702,7 @@ pub(crate) struct UnusedCrateDependency { "your program uses the crate `{$extern_crate}`, that is not compiled with `{$mitigation_name}{$mitigation_level}` enabled" )] #[note( - "recompile `{$extern_crate}` with `{$mitigation_name}{$mitigation_level}` enabled, or use `-Z allow-partial-mitigations={$mitigation_name}` to allow creating an artifact that has the mitigation only partially enabled " + "recompile `{$extern_crate}` with `{$mitigation_name}{$mitigation_level}` enabled, or use `-Z allow-partial-mitigations={$mitigation_name}` to allow creating an artifact that has the mitigation partially enabled " )] #[help( "it is possible to disable `-Z allow-partial-mitigations={$mitigation_name}` via `-Z deny-partial-mitigations={$mitigation_name}`" diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index 2993eb340cfe..280b3b12e5c8 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -79,10 +79,13 @@ pub(crate) fn bytes(&self) -> &OwnedSlice { /// own crate numbers. pub(crate) type CrateNumMap = IndexVec; -/// Target modifiers - abi or exploit mitigations flags that cause unsoundness when mixed +/// Target modifiers - abi or exploit mitigations options that may cause unsoundness when mixed or +/// partially enabled. pub(crate) type TargetModifiers = Vec; -/// The set of enforceable mitigations (RFC 3855) that are currently enabled for this crate +/// The set of mitigations that cannot be partially enabled (see +/// [RFC 3855](https://github.com/rust-lang/rfcs/pull/3855)), but are currently enabled for this +/// crate. pub(crate) type DeniedPartialMitigations = Vec; pub(crate) struct CrateMetadata { diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 2a0eeef442a3..17dc3564c6ac 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -716,8 +716,8 @@ macro_rules! stat { // `SourceFiles` we actually need to encode. let source_map = stat!("source-map", || self.encode_source_map()); let target_modifiers = stat!("target-modifiers", || self.encode_target_modifiers()); - let denied_partial_mitigations = - stat!("enforced-mitigations", || self.encode_enabled_denied_partial_mitigations()); + let denied_partial_mitigations = stat!("denied-partial-mitigations", || self + .encode_enabled_denied_partial_mitigations()); let root = stat!("final", || { let attrs = tcx.hir_krate_attrs(); diff --git a/compiler/rustc_session/src/options/mitigation_coverage.rs b/compiler/rustc_session/src/options/mitigation_coverage.rs index cf839706fe78..f396392cd263 100644 --- a/compiler/rustc_session/src/options/mitigation_coverage.rs +++ b/compiler/rustc_session/src/options/mitigation_coverage.rs @@ -167,12 +167,12 @@ fn from_str(v: &str) -> Result bool { - let enforced_since = match self { - // Should change the enforced-since edition of StackProtector to 2015 + let denied_since = match self { + // Should change the denied-since edition of StackProtector to 2015 // (all editions) when `-C stack-protector` is stabilized. $(DeniedPartialMitigationKind::$name => Edition::$since),* }; - edition < enforced_since + edition < denied_since } } @@ -209,7 +209,9 @@ enum DeniedPartialMitigationKind { } } -/// Denied-partial mitigations, see [RFC 3855](https://github.com/rust-lang/rfcs/pull/3855) +/// A mitigation that cannot be partially enabled (see +/// [RFC 3855](https://github.com/rust-lang/rfcs/pull/3855)), but are currently enabled for this +/// crate. #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Encodable, BlobDecodable)] pub struct DeniedPartialMitigation { pub kind: DeniedPartialMitigationKind, diff --git a/tests/ui/README.md b/tests/ui/README.md index ab9b58aa4981..4527105dd32a 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -24,9 +24,9 @@ See [Allocator traits and `std::heap` #32838](https://github.com/rust-lang/rust/ ## `tests/ui/allow-partial-mitigations` -These tests exercise the check against partial mitigation enforcement. +These tests exercise the support for mitigation coverage and the `allow-partial-mitigations` and `deny-partial-mitigations` options. -See [the mitigation enforcement RFC](https://github.com/rust-lang/rfcs/pull/3855). +See [RFC 3855](https://github.com/rust-lang/rfcs/pull/3855). ## `tests/ui/annotate-moves` diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.cfg-allow-first.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.control-flow-guard-future-allow-reset-by-mitigation.stderr similarity index 76% rename from tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.cfg-allow-first.stderr rename to tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.control-flow-guard-future-allow-reset-by-mitigation.stderr index 24bcf83a9be6..fa4b9a8c99f8 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.cfg-allow-first.stderr +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.control-flow-guard-future-allow-reset-by-mitigation.stderr @@ -1,46 +1,46 @@ error: your program uses the crate `std`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `core`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `alloc`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `compiler_builtins`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `libc`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: aborting due to 5 previous errors diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.rs b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.rs index 4b419e8212c1..f87d40196d6e 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.rs +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.rs @@ -1,16 +1,35 @@ // ignore-tidy-linelength -//@ revisions: sp disable enable-disable wrong-enable disable-enable-reset cfg-allow-first sp-allow-first +//@ revisions: stack-protector-future stack-protector-future-explicit-deny stack-protector-future-deny-reset-by-mitigation stack-protector-allow-then-deny stack-protector-but-allow-control-flow-guard control-flow-guard-future-allow-reset-by-mitigation stack-protector-future-allow-reset-by-mitigation stack-protector-future-deny-allow-reset-by-mitigation //@ check-fail //@ ignore-nvptx64 stack protector is not supported //@ ignore-wasm32-unknown-unknown stack protector is not supported //@ edition:future -//@ [sp] compile-flags: -Z unstable-options -Z stack-protector=all -//@ [disable] compile-flags: -Z unstable-options -Z deny-partial-mitigations=stack-protector -Z stack-protector=all -//@ [enable-disable] compile-flags: -Z unstable-options -Z allow-partial-mitigations=stack-protector -Z deny-partial-mitigations=stack-protector -Z stack-protector=all -//@ [wrong-enable] compile-flags: -Z unstable-options -Z allow-partial-mitigations=control-flow-guard -Z stack-protector=all -//@ [cfg-allow-first] compile-flags: -Z unstable-options -Z allow-partial-mitigations=stack-protector -C control-flow-guard=on -//@ [sp-allow-first] compile-flags: -Z unstable-options -Z allow-partial-mitigations=stack-protector -Z stack-protector=all -//@ [disable-enable-reset] compile-flags: -Z unstable-options -Z deny-partial-mitigations=stack-protector -Z allow-partial-mitigations=stack-protector -Z stack-protector=all + +// test that stack-protector is denied-partial in edition=future +//@ [stack-protector-future] compile-flags: -Z unstable-options -Z stack-protector=all + +// same, but with explicit deny +//@ [stack-protector-future-explicit-deny] compile-flags: -Z unstable-options -Z stack-protector=all -Z deny-partial-mitigations=stack-protector + +// same, but with explicit deny before the enable. The `-Z stack-protector=all` resets the mitigation status +// to default which is deny at edition=future. +// at edition=2024, this would be allowed, see ok-allow-partial-mitigations-current-edition scenario stack-protector-future-deny-reset-by-mitigation +//@ [stack-protector-future-deny-reset-by-mitigation] compile-flags: -Z unstable-options -Z deny-partial-mitigations=stack-protector -Z stack-protector=all + +// same, but with explicit allow followed by explicit deny +//@ [stack-protector-allow-then-deny] compile-flags: -Z unstable-options -Z stack-protector=all -Z allow-partial-mitigations=stack-protector -Z deny-partial-mitigations=stack-protector + +// check that allowing an unrelated mitigation (control-flow-guard) does not allow a different mitigation (stack-protector) +//@ [stack-protector-but-allow-control-flow-guard] compile-flags: -Z unstable-options -Z stack-protector=all -Z allow-partial-mitigations=control-flow-guard + +// check that `-C control-flow-guard` overrides the `-Z allow-partial-mitigations=control-flow-guard` (to the default, which is deny at edition=future) +//@ [control-flow-guard-future-allow-reset-by-mitigation] compile-flags: -Z unstable-options -Z allow-partial-mitigations=control-flow-guard -C control-flow-guard=on + +// check that `-Z stack-protector` overrides the `-Z allow-partial-mitigations=stack-protector` (to the default, which is deny at edition=future) +//@ [stack-protector-future-allow-reset-by-mitigation] compile-flags: -Z unstable-options -Z allow-partial-mitigations=stack-protector -Z stack-protector=all + +// check that this is the case even if there was a "deny" before the "allow" +//@ [stack-protector-future-deny-allow-reset-by-mitigation] compile-flags: -Z unstable-options -Z deny-partial-mitigations=stack-protector -Z allow-partial-mitigations=stack-protector -Z stack-protector=all fn main() {} //~^ ERROR that is not compiled with diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.sp.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.sp.stderr deleted file mode 100644 index f039dc7acbd0..000000000000 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.sp.stderr +++ /dev/null @@ -1,47 +0,0 @@ -error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: aborting due to 5 previous errors - diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.sp-allow-first.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-allow-then-deny.stderr similarity index 76% rename from tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.sp-allow-first.stderr rename to tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-allow-then-deny.stderr index f039dc7acbd0..3565173435b5 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.sp-allow-first.stderr +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-allow-then-deny.stderr @@ -1,46 +1,46 @@ error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: aborting due to 5 previous errors diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.disable-enable-reset.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-but-allow-control-flow-guard.stderr similarity index 76% rename from tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.disable-enable-reset.stderr rename to tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-but-allow-control-flow-guard.stderr index f039dc7acbd0..3565173435b5 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.disable-enable-reset.stderr +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-but-allow-control-flow-guard.stderr @@ -1,46 +1,46 @@ error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: aborting due to 5 previous errors diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.disable.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-allow-reset-by-mitigation.stderr similarity index 76% rename from tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.disable.stderr rename to tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-allow-reset-by-mitigation.stderr index f039dc7acbd0..3565173435b5 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.disable.stderr +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-allow-reset-by-mitigation.stderr @@ -1,46 +1,46 @@ error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: aborting due to 5 previous errors diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.enable-disable.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-deny-allow-reset-by-mitigation.stderr similarity index 76% rename from tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.enable-disable.stderr rename to tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-deny-allow-reset-by-mitigation.stderr index f039dc7acbd0..3565173435b5 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.enable-disable.stderr +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-deny-allow-reset-by-mitigation.stderr @@ -1,46 +1,46 @@ error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: aborting due to 5 previous errors diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-deny-reset-by-mitigation.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-deny-reset-by-mitigation.stderr new file mode 100644 index 000000000000..3565173435b5 --- /dev/null +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-deny-reset-by-mitigation.stderr @@ -0,0 +1,47 @@ +error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: aborting due to 5 previous errors + diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-explicit-deny.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-explicit-deny.stderr new file mode 100644 index 000000000000..3565173435b5 --- /dev/null +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future-explicit-deny.stderr @@ -0,0 +1,47 @@ +error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: aborting due to 5 previous errors + diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future.stderr new file mode 100644 index 000000000000..3565173435b5 --- /dev/null +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.stack-protector-future.stderr @@ -0,0 +1,47 @@ +error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-1-error.rs:34:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: aborting due to 5 previous errors + diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.wrong-enable.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.wrong-enable.stderr deleted file mode 100644 index f039dc7acbd0..000000000000 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-1-error.wrong-enable.stderr +++ /dev/null @@ -1,47 +0,0 @@ -error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-1-error.rs:15:1 - | -LL | fn main() {} - | ^ - | - = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled - = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` - -error: aborting due to 5 previous errors - diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.both.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.both.stderr index cbbe30036530..98029972ea19 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.both.stderr +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.both.stderr @@ -1,91 +1,91 @@ error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `std`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `core`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `alloc`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `compiler_builtins`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `libc`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: aborting due to 10 previous errors diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.enable-separately-disable-together.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.enable-separately-disable-together.stderr index cbbe30036530..98029972ea19 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.enable-separately-disable-together.stderr +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.enable-separately-disable-together.stderr @@ -1,91 +1,91 @@ error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `std`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `core`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `alloc`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `compiler_builtins`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` error: your program uses the crate `libc`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-2-errors.rs:10:1 + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: aborting due to 10 previous errors diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.enable-together-disable-separately.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.enable-together-disable-separately.stderr new file mode 100644 index 000000000000..98029972ea19 --- /dev/null +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.enable-together-disable-separately.stderr @@ -0,0 +1,92 @@ +error: your program uses the crate `std`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `std` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `std`, that is not compiled with `control-flow-guard` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` + +error: your program uses the crate `core`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `core` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `core`, that is not compiled with `control-flow-guard` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` + +error: your program uses the crate `alloc`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `alloc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `alloc`, that is not compiled with `control-flow-guard` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` + +error: your program uses the crate `compiler_builtins`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `compiler_builtins` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `compiler_builtins`, that is not compiled with `control-flow-guard` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` + +error: your program uses the crate `libc`, that is not compiled with `stack-protector=all` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `libc` with `stack-protector=all` enabled, or use `-Z allow-partial-mitigations=stack-protector` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=stack-protector` via `-Z deny-partial-mitigations=stack-protector` + +error: your program uses the crate `libc`, that is not compiled with `control-flow-guard` enabled + --> $DIR/err-allow-partial-mitigations-2-errors.rs:18:1 + | +LL | fn main() {} + | ^ + | + = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled + = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` + +error: aborting due to 10 previous errors + diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.rs b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.rs index 2ce4172023aa..88809892c8af 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.rs +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-2-errors.rs @@ -1,11 +1,19 @@ // ignore-tidy-linelength -//@ revisions: both enable-separately-disable-together +//@ revisions: both enable-separately-disable-together enable-together-disable-separately //@ check-fail //@ ignore-nvptx64 stack protector is not supported //@ ignore-wasm32-unknown-unknown stack protector is not supported //@ edition:future + +// just use 2 partial mitigations, without any allow/deny flag. Should be denied at edition=future. //@ [both] compile-flags: -Z unstable-options -C control-flow-guard=on -Z stack-protector=all -//@ [enable-separately-disable-together] compile-flags: -Z unstable-options -Z allow-partial-mitigations=stack-protector -Z allow-partial-mitigations=control-flow-guard -Z deny-partial-mitigations=control-flow-guard,stack-protector -C control-flow-guard=on -Z stack-protector=all + +// check that mitigations are denied if they are enabled separately and then disabled in a single command, +// to test the "foo,bar" syntax +//@ [enable-separately-disable-together] compile-flags: -Z unstable-options -C control-flow-guard=on -Z stack-protector=all -Z allow-partial-mitigations=stack-protector -Z allow-partial-mitigations=control-flow-guard -Z deny-partial-mitigations=control-flow-guard,stack-protector + +// same, but for allow +//@ [enable-together-disable-separately] compile-flags: -Z unstable-options -C control-flow-guard=on -Z stack-protector=all -Z allow-partial-mitigations=stack-protector,control-flow-guard -Z deny-partial-mitigations=control-flow-guard -Z deny-partial-mitigations=stack-protector fn main() {} //~^ ERROR that is not compiled with diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-bad-cli.rs b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-bad-cli.rs index 0f45830b9b64..c5fe5b0e1158 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-bad-cli.rs +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-bad-cli.rs @@ -5,7 +5,7 @@ //@ edition:future //@ compile-flags: -Z unstable-options -Z deny-partial-mitigations=garbage -// have a test that the list of mitigations is generated correctly +// test that the list of mitigations in the error message is generated correctly //~? ERROR incorrect value `garbage` for unstable option `deny-partial-mitigations` - comma-separated list of mitigation kinds (available: diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.stderr b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.control-flow-2024-explicit-deny.stderr similarity index 75% rename from tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.stderr rename to tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.control-flow-2024-explicit-deny.stderr index 02e915498679..7940f3f907d3 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.stderr +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.control-flow-2024-explicit-deny.stderr @@ -1,46 +1,46 @@ error: your program uses the crate `std`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-current-edition.rs:12:1 + --> $DIR/err-allow-partial-mitigations-current-edition.rs:13:1 | LL | fn main() {} | ^ | - = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `std` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `core`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-current-edition.rs:12:1 + --> $DIR/err-allow-partial-mitigations-current-edition.rs:13:1 | LL | fn main() {} | ^ | - = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `core` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `alloc`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-current-edition.rs:12:1 + --> $DIR/err-allow-partial-mitigations-current-edition.rs:13:1 | LL | fn main() {} | ^ | - = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `alloc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `compiler_builtins`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-current-edition.rs:12:1 + --> $DIR/err-allow-partial-mitigations-current-edition.rs:13:1 | LL | fn main() {} | ^ | - = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `compiler_builtins` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: your program uses the crate `libc`, that is not compiled with `control-flow-guard` enabled - --> $DIR/err-allow-partial-mitigations-current-edition.rs:12:1 + --> $DIR/err-allow-partial-mitigations-current-edition.rs:13:1 | LL | fn main() {} | ^ | - = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation only partially enabled + = note: recompile `libc` with `control-flow-guard` enabled, or use `-Z allow-partial-mitigations=control-flow-guard` to allow creating an artifact that has the mitigation partially enabled = help: it is possible to disable `-Z allow-partial-mitigations=control-flow-guard` via `-Z deny-partial-mitigations=control-flow-guard` error: aborting due to 5 previous errors diff --git a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.rs b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.rs index 5ed5edf63ece..4f5acb0280d0 100644 --- a/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.rs +++ b/tests/ui/allow-partial-mitigations/err-allow-partial-mitigations-current-edition.rs @@ -1,9 +1,10 @@ // ignore-tidy-linelength +//@ revisions: control-flow-2024-explicit-deny //@ check-fail //@ ignore-nvptx64 stack protector is not supported //@ ignore-wasm32-unknown-unknown stack protector is not supported //@ edition: 2024 -//@ compile-flags: -C control-flow-guard=on -Z deny-partial-mitigations=control-flow-guard +//@ [control-flow-2024-explicit-deny] compile-flags: -C control-flow-guard=on -Z deny-partial-mitigations=control-flow-guard // check that in edition 2024, it is still possible to explicitly // disallow partial mitigations (in edition=future, they are diff --git a/tests/ui/allow-partial-mitigations/ok-allow-partial-mitigations-current-edition.rs b/tests/ui/allow-partial-mitigations/ok-allow-partial-mitigations-current-edition.rs index 6a9c297698b6..dddad265aff4 100644 --- a/tests/ui/allow-partial-mitigations/ok-allow-partial-mitigations-current-edition.rs +++ b/tests/ui/allow-partial-mitigations/ok-allow-partial-mitigations-current-edition.rs @@ -1,13 +1,25 @@ // ignore-tidy-linelength -//@ revisions: no-deny deny-first +//@ revisions: control-flow-guard-2024-default control-flow-guard-2024-deny-reset-by-mitigation stack-protector-2024-deny-reset-by-mitigation stack-protector-2024-allow-deny-reset-by-mitigation //@ check-pass //@ ignore-nvptx64 stack protector is not supported //@ ignore-wasm32-unknown-unknown stack protector is not supported //@ edition: 2024 -//@ [deny-first] compile-flags: -Z deny-partial-mitigations=control-flow-guard -C control-flow-guard=on -//@ [no-deny] compile-flags: -C control-flow-guard=on // check that the `-C control-flow-guard=on` overrides the `-Z deny-partial-mitigations=control-flow-guard`, -// which in edition 2024 leads to partial mitigations being allowed +// which in edition 2024 leads to partial mitigations being allowed. Test with both an explicit +// deny and without one. + +// just test control-flow-guard at edition 2024. allowed-partial due to backwards compatibility. +//@ [control-flow-guard-2024-default] compile-flags: -C control-flow-guard=on + +// test that -C control-flow-guard=on resets -Z deny-partial-mitigations=control-flow-guard +//@ [control-flow-guard-2024-deny-reset-by-mitigation] compile-flags: -Z deny-partial-mitigations=control-flow-guard -C control-flow-guard=on + +// same but for stack-protector, to match the stack-protector-future-deny-reset-by-mitigation test in +// err-allow-partial-mitigations-1-error (which has the same args but on edition=future). +//@ [stack-protector-2024-deny-reset-by-mitigation] compile-flags: -Z deny-partial-mitigations=stack-protector -Z stack-protector=all + +// check that this is the case even if there was an "allow" then a "deny" +//@ [stack-protector-2024-allow-deny-reset-by-mitigation] compile-flags: -Z unstable-options -Z allow-partial-mitigations=stack-protector -Z deny-partial-mitigations=stack-protector -Z stack-protector=all fn main() {} diff --git a/tests/ui/allow-partial-mitigations/ok-allow-partial-mitigations.rs b/tests/ui/allow-partial-mitigations/ok-allow-partial-mitigations.rs index 804873f39751..f9f013e44cc6 100644 --- a/tests/ui/allow-partial-mitigations/ok-allow-partial-mitigations.rs +++ b/tests/ui/allow-partial-mitigations/ok-allow-partial-mitigations.rs @@ -1,11 +1,18 @@ // ignore-tidy-linelength -//@ revisions: sp both disable-enable +//@ revisions: stack-protector-explicit-allow stack-protector-and-control-flow-guard-explicit-allow stack-protector-deny-then-allow //@ check-pass //@ edition:future //@ ignore-nvptx64 stack protector is not supported //@ ignore-wasm32-unknown-unknown stack protector is not supported -//@ [both] compile-flags: -Z unstable-options -Z stack-protector=all -C control-flow-guard=on -Z allow-partial-mitigations=stack-protector,control-flow-guard -//@ [sp] compile-flags: -Z unstable-options -Z stack-protector=all -Z allow-partial-mitigations=stack-protector -//@ [disable-enable] compile-flags: -Z unstable-options -Z deny-partial-mitigations=stack-protector -Z stack-protector=all -Z allow-partial-mitigations=stack-protector + +// requesting both stack-protector and control-flow-guard and then allow-partial-mitigations it +//@ [stack-protector-and-control-flow-guard-explicit-allow] compile-flags: -Z unstable-options -Z stack-protector=all -C control-flow-guard=on -Z allow-partial-mitigations=stack-protector,control-flow-guard + +// requesting stack-protector and then allow-partial-mitigations it +//@ [stack-protector-explicit-allow] compile-flags: -Z unstable-options -Z stack-protector=all -Z allow-partial-mitigations=stack-protector + +// testing that the later allow-partial-mitigations overrides the earlier deny-partial-mitigations +// see also the stack-protector-allow-then-deny test (in the error tests) for the other order +//@ [stack-protector-deny-then-allow] compile-flags: -Z unstable-options -Z stack-protector=all -Z deny-partial-mitigations=stack-protector -Z allow-partial-mitigations=stack-protector fn main() {}