bors [Fri, 4 Feb 2022 17:01:23 +0000 (17:01 +0000)]
Auto merge of #1968 - RalfJung:rustup, r=RalfJung
rustup; implement simd_and/or
I had to disable the integer division tests since they now require simd_eq, which seems [non-trivial to implement](https://github.com/rust-lang/miri/issues/1912#issuecomment-1030164843).
bors [Fri, 4 Feb 2022 16:18:30 +0000 (16:18 +0000)]
Auto merge of #1967 - RalfJung:rustup, r=RalfJung
rustup: disable read_dir test for now
I don't currently have time to fix our read_dir support, so I disabled the tests for now. https://github.com/rust-lang/miri/issues/1966 tracks bringing back that functionality.
bors [Sun, 9 Jan 2022 14:10:00 +0000 (14:10 +0000)]
Auto merge of #1952 - RalfJung:self-referential, r=RalfJung
exclude mutable references to !Unpin types from uniqueness guarantees
This basically works around https://github.com/rust-lang/unsafe-code-guidelines/issues/148 by not requiring uniqueness any more for mutable references to self-referential generators. That corresponds to [the same work-around that was applied in rustc itself](https://github.com/rust-lang/rust/blob/b81553267437627af63c79c1a20c73af865a842a/compiler/rustc_middle/src/ty/layout.rs#L2482).
I am not entirely sure if this is a good idea since it might hide too many errors in case types are "accidentally" `!Unpin`. OTOH, our test suite still passes, and to my knowledge the vast majority of types is `Unpin`. (`place.layout.ty` is monomorphic, we should always exactly know which type this is.)
bors [Tue, 21 Dec 2021 21:25:52 +0000 (21:25 +0000)]
Auto merge of #1945 - saethlin:better-sb-tracking, r=RalfJung
Provide slightly better notes when tracking a pointer tag
I slapped this in as a sort of advanced println-based debugging when trying to figure out a track-raw-pointers finding in `smallvec`. Perhaps this looks like a good idea to you all?
EDIT: User scenario
Run `MIRIFLAGS=-Ztag-raw-pointers cargo miri test`, get a diagnostic that looks like
```
error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc99465+0x9, but parent tag <265507> does not have an appropriate item in the borrow stack
```
So now run `MIRIFLAGS=-Ztag-raw-pointers -Zmiri-track-pointer-tag=265507 cargo miri test`
Old:
```
note: tracking was triggered
--> src/lib.rs:822:36
|
822 | vec: NonNull::from(self),
| ^^^^ popped tracked tag for item [SharedReadOnly for <265507>]
```
New:
```
note: tracking was triggered
--> src/lib.rs:822:36
|
822 | vec: NonNull::from(self),
| ^^^^ popped tracked tag for item [SharedReadOnly for <265507>] due to Write access for <265356>
```
So that if a user is now beginning to question their sanity because they don't really understand SB yet, they can then track the tag which caused the parent tag to be removed from the stack to be sure what's going on here:
```
--> src/lib.rs:792:5
|
792 | / pub fn drain<R>(&mut self, range: R) -> Drain<'_, A>
793 | | where
794 | | R: RangeBounds<usize>,
795 | | {
... |
824 | | }
825 | | }
| |_____^ created tag 265356
```
The existing diagnostic can tell you where the tag you'd need was invalidated, but it cannot tell you what and why that tag was invalidated.
bors [Mon, 6 Dec 2021 01:33:55 +0000 (01:33 +0000)]
Auto merge of #1930 - tavianator:avoid-adjacent-allocations, r=RalfJung
intptrcast: Never allocate two objects directly adjecent
When two objects directly follow each other in memory, what is the
provenance of an integer cast to a pointer that points directly between
them? For a zero-size region, it could point into the end of the first
object, or the start of the second.
We can avoid answering this difficult question by simply never
allocating two objects directly beside each other. This fixes some of
the false positives from #1866.
Tavian Barnes [Fri, 3 Dec 2021 20:57:37 +0000 (15:57 -0500)]
intptrcast: Never allocate two objects directly adjecent
When two objects directly follow each other in memory, what is the
provenance of an integer cast to a pointer that points directly between
them? For a zero-size region, it could point into the end of the first
object, or the start of the second.
We can avoid answering this difficult question by simply never
allocating two objects directly beside each other. This fixes some of
the false positives from #1866.
bors [Thu, 25 Nov 2021 22:55:43 +0000 (22:55 +0000)]
Auto merge of #1924 - RalfJung:ra, r=oli-obk
hack to work around RA quirk
This is a gross hack to work around https://github.com/rust-analyzer/rust-analyzer/issues/10793: calling `cargo-miri/miri` does the same thing as calling `./miri`.
`@oli-obk` this is the best I could come up with... not sure if we want to have this in the repo. I am also okay with carrying `cargo-miri/miri` locally.
bors [Tue, 23 Nov 2021 19:08:06 +0000 (19:08 +0000)]
Auto merge of #1921 - RalfJung:overflow-checks-off, r=RalfJung
test for overflow-checks=off
Strangely, if we call the functions in `std::ops`, we still get the panics. I assume that is because we build the stdlib with `-Cdebug-assertions=on`; probably the magic attribute that makes stdlib functions inherit overflow checks from the calling crate only works one way (namely to enable them when the calling crate asks for them, but not to disable them when the calling crate does not want them).
bors [Wed, 17 Nov 2021 16:08:13 +0000 (16:08 +0000)]
Auto merge of #1911 - RalfJung:rename-track-tag, r=RalfJung
rename track-raw-pointers flag to tag-raw-pointers
The old flag name sounds too similar to `-Zmiri-track-pointer-tag`, which is a totally different kind of 'tracking'. This has lead to confusion in https://github.com/rust-lang/miri/issues/1907.
bors [Wed, 17 Nov 2021 15:43:32 +0000 (15:43 +0000)]
Auto merge of #1915 - RalfJung:cron, r=RalfJung
tweak cron job time
15:00 UTC is 16:00 in Europe and 10:00 on the US East Coast (during winter time, and 1h later during summer time), so a good time in both places to see the email and react quickly. No need to run this in the middle of the night if nobody will fix the problem anyway.
Move it 5min past the full hour to avoid what is probably a rush of cronjobs on the full hour.
bors [Sun, 14 Nov 2021 17:29:41 +0000 (17:29 +0000)]
Auto merge of #1913 - RalfJung:rustdoc-miri, r=RalfJung
run rustdoc with the miri cfg flag
This is important to be able to control which doctests run with `cargo miri test`. In particular, this is required for https://github.com/rust-lang/rust/pull/90909 to work as intended.