ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

Miri complains about stacked borrow

Open mulimoen opened this issue 2 years ago • 0 comments

The following snippet fails when executing with miri on the latest nightly

use ndarray::*;

fn main() {
    let a1 = arr2(&[[1.0, 2.0], [3.0, 4.0]]);
    let a2 = arr2(&[[2.0, 3.0], [4.0, 5.0]]);
    
    a1.dot(&a2);
}

and results in error: Undefined Behavior: attempting a read access using <16389> at alloc6883[0x48], but that tag does not exist in the borrow stack for this location

I am not sure whether this is a bug in ndarray or a false positive in miri

Playground link

mulimoen avatar Jul 03 '22 09:07 mulimoen