Skip to content

ref: Enable the allow_attributes lint and fix violations - #1257

Merged
szokeasaurusrex merged 3 commits into
masterfrom
szokeasaurusrex/disallow-allow
Jul 27, 2026
Merged

ref: Enable the allow_attributes lint and fix violations#1257
szokeasaurusrex merged 3 commits into
masterfrom
szokeasaurusrex/disallow-allow

Conversation

@szokeasaurusrex

Copy link
Copy Markdown
Member

The allow_attributes lint disallows using #[allow], forcing to use #[except] instead. #[except] is generally better than #[allow] because #[expect] errors if the expectation is unfulfilled, meaning that we don't have stale annotations floating around the codebase.

This also fixes the violations by:

  • Removing #[allow] completely where it is not needed
  • Fixing the underlying violation, when this can be done trivially, and/or where we cannot use allow becuase the lint only triggers on some compilation targets
  • Replacing #[allow] with #[expect]

Resolves #1256
Resolves RUST-267

@linear-code

linear-code Bot commented Jul 21, 2026

Copy link
Copy Markdown

RUST-267

@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review July 21, 2026 14:47
@szokeasaurusrex
szokeasaurusrex requested a review from a team as a code owner July 21, 2026 14:47
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/disallow-allow branch 2 times, most recently from 7573887 to 29e2ab6 Compare July 27, 2026 09:17
Comment thread sentry-contexts/build.rs Outdated
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/disallow-allow branch from 29e2ab6 to c6bfa26 Compare July 27, 2026 09:44
The [`allow_attributes`](https://rust-lang.github.io/rust-clippy/master/#allow_attributes) lint disallows using `#[allow]`, forcing to use `#[except]` instead. `#[except]` is generally better than `#[allow]` because `#[expect]` errors if the expectation is unfulfilled, meaning that we don't have stale annotations floating around the codebase.

This also fixes the violations by:
  - Removing `#[allow]` completely where it is not needed
  - Fixing the underlying violation, when this can be done trivially, and/or where we cannot use `allow` becuase the lint only triggers on some compilation targets
  - Replacing `#[allow]` with `#[expect]`

Resolves [#1256](#1256)
Resolves [RUST-267](https://linear.app/getsentry/issue/RUST-267)
@szokeasaurusrex
szokeasaurusrex force-pushed the szokeasaurusrex/disallow-allow branch from c6bfa26 to 09823b7 Compare July 27, 2026 12:10
@szokeasaurusrex
szokeasaurusrex merged commit 2594964 into master Jul 27, 2026
29 checks passed
@szokeasaurusrex
szokeasaurusrex deleted the szokeasaurusrex/disallow-allow branch July 27, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable allow_attributes clippy lint

2 participants