Closed FeanorTheElf closed 3 months ago
This is a copy-and-paste of my reply on this issue from 2 days ago: https://github.com/rust-lang/miri/issues/3657
This is not a false positive. The ranges printed by the diagnostics are exclusive on the end, like Rust ranges. 0..5
does not include 5.
Alternatively if you mean you think that Stacked Borrows should be changed to accept this code, that's part of what Tree Borrows is for. Set MIRIFLAGS=-Zmiri-tree-borrows
to use that model instead. Your code is trying to do the &Header pattern: https://github.com/rust-lang/unsafe-code-guidelines/issues/256
I'm closing this because it is not a bug in Miri (which essentially does not have false positives), but I don't want to discourage you from asking further questions about this situation or diagnostic.
Miri flags the following code of a custom allocator that caches allocation as UB. I think it isn't, although I am not 100% sure.
The error message is