| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Before this commit, running `MIRIFLAGS="-Zmiri-tag-raw-pointers" cargo miri test` caused Miri to report undefined behavior for code using the `WindowsIter`, `ExactChunksIter`, and `ExactChunksIterMut` iterators. This commit fixes the underlying issue. Basically, Miri doesn't like code which uses a reference to an element to access other elements. Before this commit, these iterators wrapped the `ElementsBase` and `ElementsBaseMut` iterators, and they created views from the references returned by those inner iterators. Accessing elements within those views (other than the first element) led to the Miri error, since the view's pointer was derived from a reference to a single element. Now, the iterators wrap `Baseiter` instead, which produces raw pointers instead of references. Although not necessary to satisfy Miri, this commit also changes the `Windows`, `ExactChunks`, and `ExactChunksMut` producers to wrap raw views instead of normal views. This avoids potential confusion regarding which elements are accessible through the views produced by these producers.
|
rebased. Safety delayed is safety denied.. yet we try to merge it now. Thanks for the nice work. I had to do some conflict resolution on this one around where the Window struct is created, but I think it turned out correct this way. |
Sorry, something went wrong.
|
cc @adamreichold if you are interested in miri, there are instructions here |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Before this PR, running MIRIFLAGS="-Zmiri-tag-raw-pointers" cargo miri test caused Miri to report undefined behavior for code using the WindowsIter, ExactChunksIter, and ExactChunksIterMut iterators. This PR fixes the underlying issue. Basically, Miri doesn't like code which uses a reference to an element to access other elements. Before this PR, these iterators wrapped the ElementsBase and ElementsBaseMut iterators, and they created views from the references returned by those inner iterators. Accessing elements within those views (other than the first element) led to the Miri error, since the view's pointer was derived from a reference to a single element. Now, the iterators wrap Baseiter instead, which produces raw pointers instead of references.
Although not necessary to satisfy Miri, this PR also changes the Windows, ExactChunks, and ExactChunksMut producers to wrap raw views instead of normal views. This avoids potential confusion regarding which elements are accessible through the views produced by these producers.
With this PR, #1138, and bluss/matrixmultiply#67, MIRIFLAGS="-Zmiri-tag-raw-pointers -Zmiri-check-number-validity" RUSTFLAGS="-Zrandomize-layout" cargo +nightly miri test runs without errors (in about 8 minutes on my machine).