Skip to content

clippy: fix unfulfilled_lint_expectations lint#685

Merged
Amanieu merged 1 commit intorust-lang:masterfrom
xtqqczze:clippy/cast_ptr_alignment
Feb 27, 2026
Merged

clippy: fix unfulfilled_lint_expectations lint#685
Amanieu merged 1 commit intorust-lang:masterfrom
xtqqczze:clippy/cast_ptr_alignment

Conversation

@xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Feb 16, 2026

casting to a less strictly aligned pointer (u8) does not trigger the cast_ptr_alignment lint

warning: this lint expectation is unfulfilled
  --> src/control/group/neon.rs:43:14
   |
43 |     #[expect(clippy::cast_ptr_alignment)] // unaligned load
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unfulfilled_lint_expectations)]` on by default
    #[expect(clippy::cast_ptr_alignment)] // unaligned load
    pub(crate) unsafe fn load(ptr: *const Tag) -> Self {
        unsafe { Group(neon::vld1_u8(ptr.cast())) }
    }

casting to a less strictly aligned pointer (`u8`) does not trigger the lint
@clarfonthey
Copy link
Contributor

A little confused why these weren't breaking CI earlier. The intent was to only keep expects so we could remove them when they stopped triggering.

@xtqqczze
Copy link
Contributor Author

I'm seeing these warnings locally when running:

cargo clippy --all --tests --features serde,rayon -- -D warnings`

Perhaps they haven’t shown up in CI because rustfmt_clippy runs on the i586-unknown-linux-gnu target, while I’m building on aarch64?

@clarfonthey
Copy link
Contributor

Oh, yeah, huh. I guess that this is an issue when it comes to the SIMD code.

Not sure what the best solution is other than running clippy on those targets in CI too, hmm.

@xtqqczze
Copy link
Contributor Author

xtqqczze commented Feb 17, 2026

Yeah CI needs a matrix strategy that runs clippy for every target, opened #691

@clarfonthey
Copy link
Contributor

The main issue is that we test substantially more targets than would need clippy runs, since we want to verify performance and correctness. Honestly, the big issue is that clippy can't go through cfged code, but that's a story for another day.

I think we could definitely improve it by running clippy on more targets, however, to at least cover all the code.

@Amanieu Amanieu added this pull request to the merge queue Feb 27, 2026
Merged via the queue into rust-lang:master with commit b65e15c Feb 27, 2026
25 checks passed
@xtqqczze xtqqczze deleted the clippy/cast_ptr_alignment branch February 27, 2026 20:47
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.

3 participants