Repository navigation
Description
Problem
Mutable references and projected assignments through a fat slice can compute the wrong address when the slice element type is itself an array. For example, rows[row][0] on &mut [[f32; 2]] should step by one [f32; 2] row first, then select column 0. The MIR address walker currently classifies the extracted slice data pointer from its pointee type alone, so ptr<[f32; 2]> can be mistaken for a pointer to one array object and the row index writes inside row 0 instead.
Why this matters
Fat slice indexing is standard Rust codegen for mutable slice borrows, slice::get_mut, raw address-taking, and projected assignments. Device code that works with slices of fixed-size vectors or matrix rows can silently write the wrong element instead of failing to compile.
Expected behavior
After dereferencing a fat slice, the extracted data pointer should be indexed as a pointer to slice elements. If the slice element is [T; N], the first index should move by one whole [T; N]; only the next index should select inside that array element.
Acceptance criteria
- A focused regression with
&mut [[f32; 2]]fails onupstream/mainby writing row 0 column 1 instead of row 1 column 0. - The same regression passes on the patched branch.
- Runtime
Index, forwardConstantIndex, mutable-reference address materialization, and direct projected assignment are covered. - Existing scalar-element fat-slice write cases continue to pass.
- The implementation distinguishes "data pointer extracted from a fat slice" from "ordinary pointer to one array object" before choosing pointer-offset versus array-element-address lowering.
Activity
build(deps): bump github/codeql-action in the all-actions group (NVID…