Fix Miri symbolic alignment check failures#2798
Conversation
This change introduces the `miri_promise_symbolic_alignment` intrinsic and uses it to resolve false positives in Miri's symbolic alignment checking. This prepares the codebase for enabling `-Zmiri-symbolic-alignment-check` in CI. * Defined `miri_promise_symbolic_alignment` in `src/util/mod.rs` (guarded by `cfg(miri)`). * Applied the intrinsic in `src/pointer/ptr.rs` (`as_ref` and `as_mut`) to promise alignment when the `Aligned` invariant is held. * Enabled `feature(layout_for_ptr)` under Miri to allow using `align_of_val_raw` for unsized types. Note: The CI configuration (`.github/workflows/ci.yml`) must be updated separately to add `-Zmiri-symbolic-alignment-check` to `ZC_NIGHTLY_MIRIFLAGS`, as workflow modifications are restricted in this environment. Makes progress on #674
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
This change introduces the `miri_promise_symbolic_alignment` intrinsic and uses it to resolve false positives in Miri's symbolic alignment checking. This prepares the codebase for enabling `-Zmiri-symbolic-alignment-check` in CI. * Defined `miri_promise_symbolic_alignment` in `src/util/mod.rs` (guarded by `cfg(miri)`). * Applied the intrinsic in `src/pointer/ptr.rs` (`as_ref` and `as_mut`) to promise alignment when the `Aligned` invariant is held. * Enabled `feature(layout_for_ptr)` under Miri to allow using `align_of_val_raw` for unsized types. Note: The CI configuration (`.github/workflows/ci.yml`) must be updated separately to add `-Zmiri-symbolic-alignment-check` to `ZC_NIGHTLY_MIRIFLAGS`, as workflow modifications are restricted in this environment. Makes progress on #674
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2798 +/- ##
=======================================
Coverage 88.14% 88.14%
=======================================
Files 20 20
Lines 5450 5450
=======================================
Hits 4804 4804
Misses 646 646 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fix Miri symbolic alignment check failures
This change introduces the
miri_promise_symbolic_alignmentintrinsic and uses it to resolve false positives in Miri's symbolic alignment checking. This prepares the codebase for enabling-Zmiri-symbolic-alignment-checkin CI.miri_promise_symbolic_alignmentinsrc/util/mod.rs(guarded bycfg(miri)).src/pointer/ptr.rs(as_refandas_mut) to promise alignment when theAlignedinvariant is held.feature(layout_for_ptr)under Miri to allow usingalign_of_val_rawfor unsized types.Note: The CI configuration (
.github/workflows/ci.yml) must be updated separately to add-Zmiri-symbolic-alignment-checktoZC_NIGHTLY_MIRIFLAGS, as workflow modifications are restricted in this environment.Makes progress on #674
PR created automatically by Jules for task 15594606259766288029 started by @joshlf