Skip to content

Emit an error for invalid use of the #[no_sanitize] attribute - #128552

Merged
bors merged 1 commit into
rust-lang:masterfrom
s7tya:check-no-sanitize-attribute-pos
Aug 8, 2024
Merged

Emit an error for invalid use of the #[no_sanitize] attribute#128552
bors merged 1 commit into
rust-lang:masterfrom
s7tya:check-no-sanitize-attribute-pos

Conversation

@s7tya

@s7tyas7tya commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

fixes#128487.

Currently, the use of the #[no_sanitize] attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it.

Referenced #128458. As far as I know, the #[no_sanitize] attribute can only be used with functions, so I changed that part to Fn and Method using check_applied_to_fn_or_method. However, I couldn't find explicit documentation on this, so I could be mistaken...

@rustbot

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BoxyUwU (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbotrustbot added 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 2, 2024
@bors

bors commented Aug 5, 2024

Copy link
Copy Markdown
Collaborator

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

@s7tya
s7tyaforce-pushed the check-no-sanitize-attribute-pos branch from d8b2b20 to d38b788CompareAugust 5, 2024 09:55
@rust-log-analyzer

This comment has been minimized.

@s7tya
s7tyaforce-pushed the check-no-sanitize-attribute-pos branch from d38b788 to 61ea488CompareAugust 5, 2024 10:19
@BoxyUwU

Copy link
Copy Markdown
Member

@bors r+ rollup

Thanks :3

@bors

bors commented Aug 8, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 61ea488 has been approved by BoxyUwU

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 8, 2024
@tgross35tgross35 mentioned this pull request Aug 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 8, 2024
Rollup of 7 pull requests
Successful merges:
- rust-lang#128520 (Skip over args when determining if async-closure's inner coroutine consumes its upvars)
- rust-lang#128552 (Emit an error for invalid use of the `#[no_sanitize]` attribute)
- rust-lang#128691 (Update `compiler-builtins` to 0.1.117)
- rust-lang#128702 (Add -Zmetrics-dir=PATH to save diagnostic metadata to disk)
- rust-lang#128797 (Fuchsia Test Runner: enable ffx repository server)
- rust-lang#128798 (refactor(rustc_expand::mbe): Don't require full ExtCtxt when not necessary)
- rust-lang#128800 (Add tracking issue to core-pattern-type)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 6c2e067 into rust-lang:masterAug 8, 2024
@rustbotrustbot added this to the 1.82.0 milestone Aug 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 8, 2024
Rollup merge of rust-lang#128552 - s7tya:check-no-sanitize-attribute-pos, r=BoxyUwU
Emit an error for invalid use of the `#[no_sanitize]` attribute
fixesrust-lang#128487.
Currently, the use of the `#[no_sanitize]` attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it.
Referenced rust-lang#128458. As far as I know, the `#[no_sanitize]` attribute can only be used with functions, so I changed that part to `Fn` and `Method` using `check_applied_to_fn_or_method`. However, I couldn't find explicit documentation on this, so I could be mistaken...
@s7tya
s7tya deleted the check-no-sanitize-attribute-pos branch August 8, 2024 07:11
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 17, 2024
… r=petrochenkov
Emit an error for invalid use of the linkage attribute
fixesrust-lang#128486
Currently, the use of the linkage attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it.
Related: rust-lang#128552.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 17, 2024
… r=petrochenkov
Emit an error for invalid use of the linkage attribute
fixesrust-lang#128486
Currently, the use of the linkage attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it.
Related: rust-lang#128552.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 17, 2024
Rollup merge of rust-lang#128989 - s7tya:check-linkage-attribute-pos, r=petrochenkov
Emit an error for invalid use of the linkage attribute
fixesrust-lang#128486
Currently, the use of the linkage attribute for Mod, Impl,... is incorrectly permitted. This PR will correct this issue by generating errors, and I've also added some UI test cases for it.
Related: rust-lang#128552.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

no_sanitize attribute can be applied to any item with arbitrary arguments

5 participants

@s7tya@rustbot@bors@rust-log-analyzer@BoxyUwU