Skip to content

Conversation

@1c3t3a
Copy link
Member

@1c3t3a 1c3t3a commented Aug 20, 2025

This is just logical as the attribute has anyways no effect in that case.

This is in reaction to some perf-metrics going up after #142681, specifically mentioned here: #142681 (comment).

r? rcvalle

This is just logical as the attribute has anyways no effect in that
case.
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 20, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@1c3t3a
Copy link
Member Author

1c3t3a commented Aug 20, 2025

@rustbot label +PG-exploit-mitigations

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Aug 20, 2025
@Kobzol
Copy link
Member

Kobzol commented Aug 20, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 20, 2025
Don't evaluate the sanitizer attribute if no sanitizer is enabled
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 20, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
64 
- error: invalid argument for `sanitize`
-   --> $DIR/invalid-sanitize.rs:3:1
-    |
- LL | #[sanitize(brontosaurus = "off")]
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
-    = note: expected one of: `address`, `kernel_address`, `cfi`, `hwaddress`, `kcfi`, `memory`, `memtag`, `shadow_call_stack`, or `thread`
- 
- error: invalid argument for `sanitize`
-   --> $DIR/invalid-sanitize.rs:15:1
-    |
- LL | #[sanitize(address = "bogus")]
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
-    = note: expected one of: `address`, `kernel_address`, `cfi`, `hwaddress`, `kcfi`, `memory`, `memtag`, `shadow_call_stack`, or `thread`
- 
- error: aborting due to 6 previous errors
+ error: aborting due to 4 previous errors
82 
83 
---
To only update this specific test, also pass `--test-args sanitize-attr/invalid-sanitize.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/sanitize-attr/invalid-sanitize.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/sanitize-attr/invalid-sanitize" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: malformed `sanitize` attribute input
##[error]  --> /checkout/tests/ui/sanitize-attr/invalid-sanitize.rs:18:1
   |
LL | #[sanitize = "off"] //~ ERROR malformed `sanitize` attribute input
   | ^^^^^^^^^^^^^^^^^^^
   |
help: the following are the possible correct uses
   |
LL - #[sanitize = "off"] //~ ERROR malformed `sanitize` attribute input
LL + #[sanitize(address = "on|off")] //~ ERROR malformed `sanitize` attribute input
   |
LL - #[sanitize = "off"] //~ ERROR malformed `sanitize` attribute input
LL + #[sanitize(cfi = "on|off")] //~ ERROR malformed `sanitize` attribute input
   |
LL - #[sanitize = "off"] //~ ERROR malformed `sanitize` attribute input
LL + #[sanitize(hwaddress = "on|off")] //~ ERROR malformed `sanitize` attribute input
   |
LL - #[sanitize = "off"] //~ ERROR malformed `sanitize` attribute input
LL + #[sanitize(kcfi = "on|off")] //~ ERROR malformed `sanitize` attribute input
   |
   = and 5 other candidates

error: malformed `sanitize` attribute input
##[error]  --> /checkout/tests/ui/sanitize-attr/invalid-sanitize.rs:21:1
   |
LL | #[sanitize] //~ ERROR malformed `sanitize` attribute input
   | ^^^^^^^^^^^
   |
help: the following are the possible correct uses
   |
LL | #[sanitize(address = "on|off")] //~ ERROR malformed `sanitize` attribute input
   |           ++++++++++++++++++++
LL | #[sanitize(cfi = "on|off")] //~ ERROR malformed `sanitize` attribute input
   |           ++++++++++++++++
LL | #[sanitize(hwaddress = "on|off")] //~ ERROR malformed `sanitize` attribute input
   |           ++++++++++++++++++++++
LL | #[sanitize(kcfi = "on|off")] //~ ERROR malformed `sanitize` attribute input
   |           +++++++++++++++++
   = and 5 other candidates

error: multiple `sanitize` attributes
##[error]  --> /checkout/tests/ui/sanitize-attr/invalid-sanitize.rs:7:1
   |
LL | #[sanitize(address = "off")] //~ ERROR multiple `sanitize` attributes
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /checkout/tests/ui/sanitize-attr/invalid-sanitize.rs:8:1
   |
LL | #[sanitize(address = "off")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: multiple `sanitize` attributes
##[error]  --> /checkout/tests/ui/sanitize-attr/invalid-sanitize.rs:11:1
   |
LL | #[sanitize(address = "on")] //~ ERROR multiple `sanitize` attributes
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /checkout/tests/ui/sanitize-attr/invalid-sanitize.rs:12:1
   |
---
---- [ui] tests/ui/sanitizer/inline-always-sanitize.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/sanitizer/inline-always-sanitize/inline-always-sanitize.stderr`
diff of stderr:

- warning: setting `sanitize` off will have no effect after inlining
-   --> $DIR/inline-always-sanitize.rs:7:1
-    |
- LL | #[sanitize(address = "off")]
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-    |
---
To only update this specific test, also pass `--test-args sanitizer/inline-always-sanitize.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/sanitizer/inline-always-sanitize.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/sanitizer/inline-always-sanitize" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
stderr: none



@rust-bors
Copy link

rust-bors bot commented Aug 20, 2025

☀️ Try build successful (CI)
Build commit: 6fcc151 (6fcc151168d674963a5c4f2a8117d8f11ae01478, parent: e8a792daf500b5ff8097896ddb6cc037abe92487)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6fcc151): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.8%, -0.2%] 6
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -1.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [2.6%, 3.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-4.6%, -2.7%] 3
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 471.66s -> 470.248s (-0.30%)
Artifact size: 378.20 MiB -> 378.28 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 21, 2025
@bors
Copy link
Collaborator

bors commented Nov 8, 2025

☔ The latest upstream changes (presumably #147935) made this pull request unmergeable. Please resolve the merge conflicts.

@wesleywiser
Copy link
Member

r? wesleywiser

@rustbot rustbot assigned wesleywiser and unassigned rcvalle Dec 11, 2025
@1c3t3a
Copy link
Member Author

1c3t3a commented Dec 18, 2025

This is no longer needed, after the no-sanitize attribute was migrated to the new attributes parsing infrastructure in #145670.

@1c3t3a 1c3t3a closed this Dec 18, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) PG-exploit-mitigations Project group: Exploit mitigations T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants