]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #2044 - RalfJung:int_log, r=RalfJung
bors [Thu, 31 Mar 2022 15:22:18 +0000 (15:22 +0000)]
Auto merge of #2044 - RalfJung:int_log, r=RalfJung

test int_log functions

I'll have to disable many of their tests in libcore since they take too long, so let's add some of them back on our side here.

2 years agotest int_log functions
Ralf Jung [Thu, 31 Mar 2022 15:18:56 +0000 (11:18 -0400)]
test int_log functions

2 years agoAuto merge of #2040 - RalfJung:pnvi, r=RalfJung
bors [Sun, 27 Mar 2022 14:02:02 +0000 (14:02 +0000)]
Auto merge of #2040 - RalfJung:pnvi, r=RalfJung

ensure that -Zmiri-check-number-validity detects integers with provenance

This actually currently *fails* for the non-array case; I will have to fix this on the rustc side.

2 years agoAuto merge of #2042 - TaKO8Ki:add-vscode-dir-to-gitignore, r=RalfJung
bors [Sun, 27 Mar 2022 13:41:38 +0000 (13:41 +0000)]
Auto merge of #2042 - TaKO8Ki:add-vscode-dir-to-gitignore, r=RalfJung

Add `.vscode` directory to `.gitignore`

Add `.vscode` directory to `.gitignore` for configuring `rust-analyzer`

2 years agorustup
Ralf Jung [Sun, 27 Mar 2022 13:40:46 +0000 (09:40 -0400)]
rustup

2 years agoadd .vscode to .gitignore
Takayuki Maeda [Sun, 27 Mar 2022 09:41:40 +0000 (18:41 +0900)]
add .vscode to .gitignore

2 years agochannels do ptr-int transmutes so move them to non-check-number-validity test
Ralf Jung [Sat, 26 Mar 2022 18:33:17 +0000 (14:33 -0400)]
channels do ptr-int transmutes so move them to non-check-number-validity test

2 years agofix types in env shim to avoid ptr-int transmutes
Ralf Jung [Sat, 26 Mar 2022 18:29:58 +0000 (14:29 -0400)]
fix types in env shim to avoid ptr-int transmutes

2 years agoensure that -Zmiri-check-number-validity detects integers with provenance
Ralf Jung [Sat, 26 Mar 2022 17:10:20 +0000 (13:10 -0400)]
ensure that -Zmiri-check-number-validity detects integers with provenance

2 years agoAuto merge of #2039 - RalfJung:too-big, r=RalfJung
bors [Sat, 26 Mar 2022 15:08:43 +0000 (15:08 +0000)]
Auto merge of #2039 - RalfJung:too-big, r=RalfJung

another test for too big type

The existing test covers "slice is bigger than largest supported object" but we had no test covering "total size is bigger than largest supported object", which happens when the unsized tail itself is okay in terms of size, but together with the sized prefix it becomes too big.

Cc https://github.com/rust-lang/rust/issues/95334

2 years agoanother test for too big type
Ralf Jung [Sat, 26 Mar 2022 14:44:30 +0000 (10:44 -0400)]
another test for too big type

2 years agoAuto merge of #2036 - RalfJung:vec, r=RalfJung
bors [Thu, 24 Mar 2022 14:33:02 +0000 (14:33 +0000)]
Auto merge of #2036 - RalfJung:vec, r=RalfJung

regression test for reverse() unsoundness

Cc https://github.com/rust-lang/rust/pull/90821

2 years agoAuto merge of #2038 - RalfJung:rustup, r=RalfJung
bors [Thu, 24 Mar 2022 14:07:06 +0000 (14:07 +0000)]
Auto merge of #2038 - RalfJung:rustup, r=RalfJung

rustup

2 years agorustup
Ralf Jung [Thu, 24 Mar 2022 14:06:33 +0000 (10:06 -0400)]
rustup

2 years agoregression test for reverse() unsoundness
Ralf Jung [Tue, 22 Mar 2022 18:28:36 +0000 (14:28 -0400)]
regression test for reverse() unsoundness

2 years agovec test: check number validity
Ralf Jung [Tue, 22 Mar 2022 18:26:40 +0000 (14:26 -0400)]
vec test: check number validity

2 years agoAuto merge of #2033 - RalfJung:arbitrary-self-dyn, r=RalfJung
bors [Sun, 20 Mar 2022 18:04:55 +0000 (18:04 +0000)]
Auto merge of #2033 - RalfJung:arbitrary-self-dyn, r=RalfJung

test arbitrary-self dyn receivers

Requires https://github.com/rust-lang/rust/pull/95071

2 years agorustup
Ralf Jung [Sun, 20 Mar 2022 18:04:05 +0000 (14:04 -0400)]
rustup

2 years agotest arbitrary-self dyn receivers
Ralf Jung [Fri, 18 Mar 2022 12:50:49 +0000 (08:50 -0400)]
test arbitrary-self dyn receivers

2 years agoAuto merge of #2022 - RalfJung:remove_dir_all, r=RalfJung
bors [Sun, 20 Mar 2022 14:38:27 +0000 (14:38 +0000)]
Auto merge of #2022 - RalfJung:remove_dir_all, r=RalfJung

test remove_dir_all

Blocked on https://github.com/rust-lang/rust/pull/94749

Cc https://github.com/rust-lang/miri/issues/1966

2 years agorustup
Ralf Jung [Sun, 20 Mar 2022 14:36:44 +0000 (10:36 -0400)]
rustup

2 years agotest remove_dir_all
Ralf Jung [Sat, 12 Mar 2022 18:37:46 +0000 (13:37 -0500)]
test remove_dir_all

2 years agoAuto merge of #1975 - DrMeepster:backtrace_fix, r=RalfJung
bors [Sun, 20 Mar 2022 02:37:09 +0000 (02:37 +0000)]
Auto merge of #1975 - DrMeepster:backtrace_fix, r=RalfJung

Make backtraces work with #[global_allocator]

Currently, backtraces break when the global allocator is overridden because the allocator will attempt to deallocate memory allocated directly by Miri.

~~This PR fixes that by using a new memory kind and providing a function to deallocate it. We can't call the custom allocator to allocate because it's not possible to call a function in the middle of a shim.~~

This PR fixes that by adding a new version of the backtrace API accessible by setting `flags` to 1. Existing code still functions.

backtrace-rs PR: rust-lang/backtrace-rs#462

Fixes https://github.com/rust-lang/miri/issues/1996

2 years agoadd new version of backtrace api using flags=1
DrMeepster [Fri, 25 Feb 2022 06:11:20 +0000 (22:11 -0800)]
add new version of backtrace api using flags=1

2 years agoAuto merge of #2024 - saethlin:better-local-check, r=RalfJung
bors [Fri, 18 Mar 2022 20:38:37 +0000 (20:38 +0000)]
Auto merge of #2024 - saethlin:better-local-check, r=RalfJung

Consider the cargo workspace when checking if a frame is local

`DefId::is_local` returns a result which is technically correct, but doesn't match the user's intuition when running integration tests or doctests. This incorporates the workspace crates mentioned in `cargo metadata` into the check for whether a frame is local to match user intuition.

For example, here is the backtrace you get from `MIRIFLAGS=-Zmiri-tag-raw-pointers cargo miri test` in `bytes` 1.1.0:
```
   --> /home/ben/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/slice/raw.rs:131:14
    |
131 |     unsafe { &mut *ptr::slice_from_raw_parts_mut(data, len) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to reborrow for Unique at alloc67158, but parent tag <untagged> does not have an appropriate item in the borrow stack
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information

    = note: inside `std::slice::from_raw_parts_mut::<u8>` at /home/ben/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/slice/raw.rs:131:14
    = note: inside `bytes::bytes::rebuild_boxed_slice` at /tmp/bytes-1.1.0/src/bytes.rs:938:19
    = note: inside closure at /tmp/bytes-1.1.0/src/bytes.rs:904:18
    = note: inside `<std::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<[closure@bytes::bytes::promotable_even_drop::{closure#0}], ()>` at /tmp/bytes-1.1.0/src/loom.rs:17:17
    = note: inside `bytes::bytes::promotable_even_drop` at /tmp/bytes-1.1.0/src/bytes.rs:895:5
    = note: inside `<bytes::Bytes as std::ops::Drop>::drop` at /tmp/bytes-1.1.0/src/bytes.rs:515:18
    = note: inside `std::ptr::drop_in_place::<bytes::Bytes> - shim(Some(bytes::Bytes))` at /home/ben/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:188:1
note: inside `copy_to_bytes_less` at tests/test_buf.rs:112:1
   --> tests/test_buf.rs:112:1
    |
112 | }
    | ^
note: inside closure at tests/test_buf.rs:106:1
   --> tests/test_buf.rs:106:1
    |
105 |   #[test]
    |   ------- in this procedural macro expansion
106 | / fn copy_to_bytes_less() {
107 | |     let mut buf = &b"hello world"[..];
108 | |
109 | |     let bytes = buf.copy_to_bytes(5);
110 | |     assert_eq!(bytes, &b"hello"[..]);
111 | |     assert_eq!(buf, &b" world"[..])
112 | | }
    | |_^
    = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
```
We get these because the integration tests are occurring in a crate called `test`, not the actual `bytes` crate. With this PR, we get this:
```
    = note: inside `std::slice::from_raw_parts_mut::<u8>` at /home/ben/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/slice/raw.rs:131:14
note: inside `bytes::bytes::rebuild_boxed_slice` at /tmp/bytes-1.1.0/src/bytes.rs:938:19
   --> /tmp/bytes-1.1.0/src/bytes.rs:938:19
    |
938 |     Box::from_raw(slice::from_raw_parts_mut(buf, cap))
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside closure at /tmp/bytes-1.1.0/src/bytes.rs:904:18
   --> /tmp/bytes-1.1.0/src/bytes.rs:904:18
    |
904 |             drop(rebuild_boxed_slice(buf, ptr, len));
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `<std::sync::atomic::AtomicPtr<()> as bytes::loom::sync::atomic::AtomicMut<()>>::with_mut::<[closure@bytes::bytes::promotable_even_drop::{closure#0}], ()>` at /tmp/bytes-1.1.0/src/loom.rs:17:17
   --> /tmp/bytes-1.1.0/src/loom.rs:17:17
    |
17  |                 f(self.get_mut())
    |                 ^^^^^^^^^^^^^^^^^
note: inside `bytes::bytes::promotable_even_drop` at /tmp/bytes-1.1.0/src/bytes.rs:895:5
   --> /tmp/bytes-1.1.0/src/bytes.rs:895:5
    |
895 | /     data.with_mut(|shared| {
896 | |         let shared = *shared;
897 | |         let kind = shared as usize & KIND_MASK;
898 | |
...   |
905 | |         }
906 | |     });
    | |______^
note: inside `<bytes::Bytes as std::ops::Drop>::drop` at /tmp/bytes-1.1.0/src/bytes.rs:515:18
   --> /tmp/bytes-1.1.0/src/bytes.rs:515:18
    |
515 |         unsafe { (self.vtable.drop)(&mut self.data, self.ptr, self.len) }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: inside `std::ptr::drop_in_place::<bytes::Bytes> - shim(Some(bytes::Bytes))` at /home/ben/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:188:1
note: inside `copy_to_bytes_less` at tests/test_buf.rs:112:1
   --> tests/test_buf.rs:112:1
    |
112 | }
    | ^
note: inside closure at tests/test_buf.rs:106:1
   --> tests/test_buf.rs:106:1
    |
105 |   #[test]
    |   ------- in this procedural macro expansion
106 | / fn copy_to_bytes_less() {
107 | |     let mut buf = &b"hello world"[..];
108 | |
109 | |     let bytes = buf.copy_to_bytes(5);
110 | |     assert_eq!(bytes, &b"hello"[..]);
111 | |     assert_eq!(buf, &b" world"[..])
112 | | }
    | |_^
    = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
```

Note that this kind of inflation is rather rare to see. Most backtraces change not at all or only a tiny bit.

I originally implemented this to support another improvement to Miri diagnostics, but I think this is hairy enough to deserve its own PR, if somewhat poorly-motivated.

2 years agoConsider the cargo workspace when checking if a frame is local
Ben Kimock [Sat, 12 Mar 2022 22:23:22 +0000 (17:23 -0500)]
Consider the cargo workspace when checking if a frame is local

2 years agoAuto merge of #2029 - RalfJung:simd-bitmask, r=RalfJung
bors [Thu, 17 Mar 2022 17:18:01 +0000 (17:18 +0000)]
Auto merge of #2029 - RalfJung:simd-bitmask, r=RalfJung

implement simd bitmask intrinsics

Cc https://github.com/rust-lang/miri/issues/1912

2 years agofix simd_bitmask shorter than a byte on big-endian
Ralf Jung [Thu, 17 Mar 2022 17:14:16 +0000 (13:14 -0400)]
fix simd_bitmask shorter than a byte on big-endian

2 years agodetect when unused bits of a SIMD bitmask are non-0
Ralf Jung [Thu, 17 Mar 2022 00:52:01 +0000 (20:52 -0400)]
detect when unused bits of a SIMD bitmask are non-0

2 years agoimplement simd bitmask intrinsics
Ralf Jung [Thu, 17 Mar 2022 00:33:54 +0000 (20:33 -0400)]
implement simd bitmask intrinsics

2 years agoAuto merge of #1971 - saethlin:sb-details, r=RalfJung
bors [Thu, 17 Mar 2022 13:26:29 +0000 (13:26 +0000)]
Auto merge of #1971 - saethlin:sb-details, r=RalfJung

Add a lot more information to SB fatal errors

In fatal errors, this clarifies the difference between a tag not being present in the borrow stack at all, and the tag being present but granting SRO. It also introduces a little notation for memory ranges so we can mention to the user that the span may point to code that operates on multiple memory locations, but we are reporting an error at a particular offset.

This also gets rid of the unqualified phrase "the borrow stack" in errors, and clarifies that it is the borrow stack _for some location_.

The crate `pdqselect` v0.1.1:
Before:
```
2103 |     unsafe { copy_nonoverlapping(src, dst, count) }
     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item granting read access to tag <2357> at alloc1029 found in borrow stack.
```
After:
```
2103 |     unsafe { copy_nonoverlapping(src, dst, count) }
     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |              |
     |              attempting a read access using <2357> at alloc1029[0x0], but that tag does not exist in the borrow stack for this location
     |              this error occurs as part of an access at alloc1029[0x0..0x4]
```

And the crate `half` v1.8.2
Before:
```
131 |     unsafe { &mut *ptr::slice_from_raw_parts_mut(data, len) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to reborrow for Unique at alloc1051, but parent tag <2091> does not have an appropriate item in the borrow stack
```
After:
```
131 |     unsafe { &mut *ptr::slice_from_raw_parts_mut(data, len) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |              |
    |              trying to reborrow <2091> for Unique permission at alloc1051[0x0], but that tag only grants SharedReadOnly permission for this location
    |              this error occurs as part of a reborrow at alloc1051[0x0..0x6]
```

2 years agoAuto merge of #2031 - RalfJung:simd, r=RalfJung
bors [Thu, 17 Mar 2022 02:15:16 +0000 (02:15 +0000)]
Auto merge of #2031 - RalfJung:simd, r=RalfJung

implement SIMD sqrt and fma

Cc https://github.com/rust-lang/miri/issues/1912

2 years agoimplement SIMD sqrt and fma
Ralf Jung [Thu, 17 Mar 2022 02:12:39 +0000 (22:12 -0400)]
implement SIMD sqrt and fma

2 years agoPrint more in SB error diagnostics
Ben Kimock [Sun, 6 Feb 2022 00:44:56 +0000 (19:44 -0500)]
Print more in SB error diagnostics

This tries to clarify exactly why an access is not valid by printing
what memory range the access was over, which in combination with
tag-tracking may help a user figure out the source of the problem.

2 years agoAuto merge of #2028 - RalfJung:simd-round, r=RalfJung
bors [Wed, 16 Mar 2022 23:30:19 +0000 (23:30 +0000)]
Auto merge of #2028 - RalfJung:simd-round, r=RalfJung

implement SIMD float rounding functions

Cc https://github.com/rust-lang/miri/issues/1912

2 years agoimplement SIMD float rounding functions
Ralf Jung [Wed, 16 Mar 2022 22:51:34 +0000 (18:51 -0400)]
implement SIMD float rounding functions

2 years agoimplement fabs using soft floats
Ralf Jung [Wed, 16 Mar 2022 22:33:59 +0000 (18:33 -0400)]
implement fabs using soft floats

2 years agoAuto merge of #2026 - jakevossen5:master, r=RalfJung
bors [Wed, 16 Mar 2022 17:10:44 +0000 (17:10 +0000)]
Auto merge of #2026 - jakevossen5:master, r=RalfJung

missing backtick on miri-isolation warning help

Just ran into this and figured I could fix it real quick ðŸ™‚

2 years agomissing backtick on miri-isolation warning help
Jake Vossen [Wed, 16 Mar 2022 16:18:51 +0000 (10:18 -0600)]
missing backtick on miri-isolation warning help

2 years agoAuto merge of #2023 - RalfJung:simd-min-max, r=RalfJung
bors [Mon, 14 Mar 2022 13:54:19 +0000 (13:54 +0000)]
Auto merge of #2023 - RalfJung:simd-min-max, r=RalfJung

test integer SIMD min/max

Blocked on portable-simd getting updated in rustc.

2 years agotest integer SIMD min/max
Ralf Jung [Sat, 12 Mar 2022 19:42:06 +0000 (14:42 -0500)]
test integer SIMD min/max

2 years agoAuto merge of #2025 - workingjubilee:fix-nightly-simd, r=RalfJung
bors [Mon, 14 Mar 2022 02:07:23 +0000 (02:07 +0000)]
Auto merge of #2025 - workingjubilee:fix-nightly-simd, r=RalfJung

Fixup renamed fn for Simd

This fixes rust-lang/rust#94910

2 years agoFixup renamed fn for Simd
Jubilee Young [Mon, 14 Mar 2022 01:02:22 +0000 (18:02 -0700)]
Fixup renamed fn for Simd

2 years agoAuto merge of #2018 - RalfJung:term, r=oli-obk
bors [Sat, 12 Mar 2022 19:12:53 +0000 (19:12 +0000)]
Auto merge of #2018 - RalfJung:term, r=oli-obk

exclude TERM env var by default

Fixes https://github.com/rust-lang/miri/issues/1702

r? `@oli-obk`

2 years agoAuto merge of #2021 - RalfJung:write-fields-refactor, r=RalfJung
bors [Sat, 12 Mar 2022 17:18:24 +0000 (17:18 +0000)]
Auto merge of #2021 - RalfJung:write-fields-refactor, r=RalfJung

add write_int_fields to replace write_packed_immediates

This avoids having to explicitly list the types of all fields -- we derive them from the type of the struct instead.

Also add write_int_fields_named, to give the fields by name instead of ordered by index.

2 years agoadd write_int_fields to replace write_packed_immediates
Ralf Jung [Sat, 12 Mar 2022 16:21:45 +0000 (11:21 -0500)]
add write_int_fields to replace write_packed_immediates

for stat, lookup fields by name

2 years agouse dirent64_layout and field projections for writing dirent info
Ralf Jung [Sat, 12 Mar 2022 15:34:54 +0000 (10:34 -0500)]
use dirent64_layout and field projections for writing dirent info

2 years agoAuto merge of #2019 - RalfJung:align, r=RalfJung
bors [Sat, 12 Mar 2022 16:52:55 +0000 (16:52 +0000)]
Auto merge of #2019 - RalfJung:align, r=RalfJung

add README section on randomized alignment testing

also accept odd number of hex digits

`@saethlin` you mentioned that you liked this snippet, do you think it'd make sense to put it in the README?

2 years agoAuto merge of #2017 - RalfJung:rustup, r=RalfJung
bors [Sat, 12 Mar 2022 15:14:25 +0000 (15:14 +0000)]
Auto merge of #2017 - RalfJung:rustup, r=RalfJung

rustup

Cc https://github.com/rust-lang/rust/issues/94871

2 years agoexclude TERM by default
Ralf Jung [Sat, 12 Mar 2022 15:14:07 +0000 (10:14 -0500)]
exclude TERM by default

2 years agoalso accept odd number of hex digits; add README section on randomized alignment...
Ralf Jung [Sat, 12 Mar 2022 15:09:15 +0000 (10:09 -0500)]
also accept odd number of hex digits; add README section on randomized alignment testing

2 years agorustup
Ralf Jung [Sat, 12 Mar 2022 14:46:10 +0000 (09:46 -0500)]
rustup

2 years agoAuto merge of #2014 - RalfJung:ptr-offset-from, r=RalfJung
bors [Sat, 12 Mar 2022 03:12:37 +0000 (03:12 +0000)]
Auto merge of #2014 - RalfJung:ptr-offset-from, r=RalfJung

add ptr_offset_from OOB test, and update test errors

The Miri side of https://github.com/rust-lang/rust/pull/94827.

2 years agorustup
Ralf Jung [Sat, 12 Mar 2022 03:07:43 +0000 (22:07 -0500)]
rustup

2 years agoadd ptr_offset_from OOB test, and update test errors
Ralf Jung [Thu, 10 Mar 2022 23:56:19 +0000 (18:56 -0500)]
add ptr_offset_from OOB test, and update test errors

2 years agoAuto merge of #2013 - RalfJung:simd, r=RalfJung
bors [Thu, 10 Mar 2022 00:30:07 +0000 (00:30 +0000)]
Auto merge of #2013 - RalfJung:simd, r=RalfJung

implement simd_{shuffle,gather,scatter}

This makes portable-simd doctests pass. :)

Cc https://github.com/rust-lang/miri/issues/1912

2 years agoimplement simd_scatter
Ralf Jung [Thu, 10 Mar 2022 00:26:40 +0000 (19:26 -0500)]
implement simd_scatter

2 years agoimplement gather
Ralf Jung [Thu, 10 Mar 2022 00:18:07 +0000 (19:18 -0500)]
implement gather

2 years agoimplement simd_shuffle
Ralf Jung [Wed, 9 Mar 2022 23:48:31 +0000 (18:48 -0500)]
implement simd_shuffle

2 years agoAuto merge of #2006 - RalfJung:readme-ci, r=RalfJung
bors [Tue, 8 Mar 2022 12:54:18 +0000 (12:54 +0000)]
Auto merge of #2006 - RalfJung:readme-ci, r=RalfJung

update recommended CI snippet, add GHA example

If this snippet works as expected in https://github.com/rust-lang/portable-simd/pull/255 (which we can test tomorrow), then this adjusts our README to that nicer script.

2 years agoAuto merge of #2009 - RalfJung:rustup, r=RalfJung
bors [Tue, 8 Mar 2022 01:08:11 +0000 (01:08 +0000)]
Auto merge of #2009 - RalfJung:rustup, r=RalfJung

rustup

2 years agorustup
Ralf Jung [Tue, 8 Mar 2022 00:57:44 +0000 (19:57 -0500)]
rustup

2 years agoAuto merge of #2008 - RalfJung:notempty, r=RalfJung
bors [Mon, 7 Mar 2022 23:31:10 +0000 (23:31 +0000)]
Auto merge of #2008 - RalfJung:notempty, r=RalfJung

fs: add and test for DirectoryNotEmpty error variant

2 years agofs: add and test for DirectoryNotEmpty error variant
Ralf Jung [Mon, 7 Mar 2022 23:30:12 +0000 (18:30 -0500)]
fs: add and test for DirectoryNotEmpty error variant

2 years agoAuto merge of #1981 - tavianator:readdir, r=RalfJung
bors [Mon, 7 Mar 2022 22:53:54 +0000 (22:53 +0000)]
Auto merge of #1981 - tavianator:readdir, r=RalfJung

Implement a readdir64() shim for Linux

Partial fix for #1966.

2 years agoImplement a readdir64() shim for Linux
Tavian Barnes [Tue, 22 Feb 2022 22:06:05 +0000 (17:06 -0500)]
Implement a readdir64() shim for Linux

Partial fix for #1966.

2 years agoRename MiriMemoryKind::Env to Runtime
Tavian Barnes [Mon, 7 Mar 2022 17:46:53 +0000 (12:46 -0500)]
Rename MiriMemoryKind::Env to Runtime

In preparation to use it for other runtime-internal allocations.

2 years agoAuto merge of #2007 - RalfJung:simd_saturating, r=RalfJung
bors [Mon, 7 Mar 2022 19:13:41 +0000 (19:13 +0000)]
Auto merge of #2007 - RalfJung:simd_saturating, r=RalfJung

implement simd_saturating intrinsics

2 years agoimplement simd_saturating intrinsics
Ralf Jung [Mon, 7 Mar 2022 19:12:59 +0000 (14:12 -0500)]
implement simd_saturating intrinsics

2 years agoupdate recommended CI snippet, add GHA example
Ralf Jung [Mon, 7 Mar 2022 17:00:27 +0000 (12:00 -0500)]
update recommended CI snippet, add GHA example

2 years agoAuto merge of #2004 - RalfJung:simd, r=RalfJung
bors [Mon, 7 Mar 2022 14:58:30 +0000 (14:58 +0000)]
Auto merge of #2004 - RalfJung:simd, r=RalfJung

implement more SIMD intrinsics

Requires https://github.com/rust-lang/rust/pull/94681

With this, the cast, i32_ops, and f32_ops test suites of portable-simd pass. :)

Cc https://github.com/rust-lang/miri/issues/1912

2 years agofix handling of NaNs in simd max/min
Ralf Jung [Sun, 6 Mar 2022 21:54:51 +0000 (16:54 -0500)]
fix handling of NaNs in simd max/min

2 years agoimplement simd_fmax/fmin
Ralf Jung [Sun, 6 Mar 2022 20:26:15 +0000 (15:26 -0500)]
implement simd_fmax/fmin

2 years agoimplement simd_reduce_min/max
Ralf Jung [Sun, 6 Mar 2022 19:31:45 +0000 (14:31 -0500)]
implement simd_reduce_min/max

2 years agoimplement simd_cast, simd_as
Ralf Jung [Sun, 6 Mar 2022 18:58:41 +0000 (13:58 -0500)]
implement simd_cast, simd_as

2 years agoAuto merge of #2005 - RalfJung:rustup, r=RalfJung
bors [Mon, 7 Mar 2022 14:40:07 +0000 (14:40 +0000)]
Auto merge of #2005 - RalfJung:rustup, r=RalfJung

rustup

2 years agorustup
Ralf Jung [Mon, 7 Mar 2022 14:39:32 +0000 (09:39 -0500)]
rustup

2 years agoAuto merge of #2003 - RalfJung:simd-reduce-test, r=RalfJung
bors [Sun, 6 Mar 2022 04:22:12 +0000 (04:22 +0000)]
Auto merge of #2003 - RalfJung:simd-reduce-test, r=RalfJung

also test f32/f64 simd_reduce

Forgot to include this in https://github.com/rust-lang/miri/pull/2001

2 years agoalso test f32/f64 simd_reduce
Ralf Jung [Sun, 6 Mar 2022 04:03:14 +0000 (23:03 -0500)]
also test f32/f64 simd_reduce

2 years agoAuto merge of #2002 - RalfJung:negative-shifts, r=RalfJung
bors [Sun, 6 Mar 2022 04:00:41 +0000 (04:00 +0000)]
Auto merge of #2002 - RalfJung:negative-shifts, r=RalfJung

add extra tests for shifts with negative offsets

Cc https://github.com/rust-lang/rust/pull/94659

2 years agoadd extra tests for shifts with negative offsets
Ralf Jung [Sun, 6 Mar 2022 03:59:23 +0000 (22:59 -0500)]
add extra tests for shifts with negative offsets

2 years agoAuto merge of #2001 - RalfJung:simd, r=RalfJung
bors [Sun, 6 Mar 2022 00:25:19 +0000 (00:25 +0000)]
Auto merge of #2001 - RalfJung:simd, r=RalfJung

add more simd_reduce intrinsics

This makes large parts of the portable-simd test suite work. :D
Cc https://github.com/rust-lang/portable-simd/pull/255

2 years agoimplement simd_reduce_{add,mul}
Ralf Jung [Sun, 6 Mar 2022 00:02:00 +0000 (19:02 -0500)]
implement simd_reduce_{add,mul}

2 years agoavoid repeated string matching, and add more simd_reduce intrinsics
Ralf Jung [Sat, 5 Mar 2022 23:46:14 +0000 (18:46 -0500)]
avoid repeated string matching, and add more simd_reduce intrinsics

2 years agoAuto merge of #1970 - asquared31415:open_unix_varargs, r=RalfJung
bors [Sat, 5 Mar 2022 22:47:51 +0000 (22:47 +0000)]
Auto merge of #1970 - asquared31415:open_unix_varargs, r=RalfJung

Allow varargs for libc::open when it is allowed by the second argument

This PR allows `libc::open` to be called using two or three arguments as defined in https://man7.org/linux/man-pages/man2/open.2.html

The presence of the third argument depends on the value of the second argument.  If the second argument dictates that the third argument is *required* miri will emit an error if the argument is missing.  If the second argument does *not* require a third argument, then the argument is ignored and passed as 0 internally (it would be ignored by libc anyway)

2 years agoallow varargs for libc::open when it is allowed by the second argument
asquared31415 [Sun, 6 Feb 2022 01:41:29 +0000 (20:41 -0500)]
allow varargs for libc::open when it is allowed by the second argument

2 years agoAuto merge of #1998 - RalfJung:rustup, r=RalfJung
bors [Sat, 5 Mar 2022 22:26:57 +0000 (22:26 +0000)]
Auto merge of #1998 - RalfJung:rustup, r=RalfJung

rustup

Adjusts our tests for https://github.com/rust-lang/rust/pull/92697

2 years agorustup
Ralf Jung [Sat, 5 Mar 2022 22:26:32 +0000 (17:26 -0500)]
rustup

2 years agoAuto merge of #1999 - RalfJung:forward-env, r=oli-obk
bors [Sat, 5 Mar 2022 19:36:10 +0000 (19:36 +0000)]
Auto merge of #1999 - RalfJung:forward-env, r=oli-obk

add flag to forward specific env vars (while isolation remains enabled)

The flag is called `-Zmiri-env-forward=<var>`, but I am open to bikeshedding. ;)

2 years agoAuto merge of #2000 - RalfJung:simd, r=RalfJung
bors [Sat, 5 Mar 2022 18:47:28 +0000 (18:47 +0000)]
Auto merge of #2000 - RalfJung:simd, r=RalfJung

implement missing SIMD comparison operators, simd_xor, and simd_reduce_all

2 years agoimplement missing SIMD comparison operators, simd_xor, and simd_reduce_all
Ralf Jung [Sat, 5 Mar 2022 18:30:16 +0000 (13:30 -0500)]
implement missing SIMD comparison operators, simd_xor, and simd_reduce_all

2 years agoavoid env var forwarding logic panicking for non-UTF-8 env vars
Ralf Jung [Sat, 5 Mar 2022 16:13:32 +0000 (11:13 -0500)]
avoid env var forwarding logic panicking for non-UTF-8 env vars

2 years agoadd flag to forward specific env vars (while isolation remains enabled)
Ralf Jung [Sat, 5 Mar 2022 16:09:50 +0000 (11:09 -0500)]
add flag to forward specific env vars (while isolation remains enabled)

2 years agoAuto merge of #1997 - RalfJung:simd, r=RalfJung
bors [Thu, 3 Mar 2022 20:08:02 +0000 (20:08 +0000)]
Auto merge of #1997 - RalfJung:simd, r=RalfJung

implement simd_neg and simd_fabs

This lets us run the puny portable-simd smoke test in the core test suite. ;)

2 years agoimplement simd_neg and simd_fabs
Ralf Jung [Thu, 3 Mar 2022 19:54:54 +0000 (14:54 -0500)]
implement simd_neg and simd_fabs

2 years agouse binary_op over overflowing_binary_op
Ralf Jung [Thu, 3 Mar 2022 19:44:50 +0000 (14:44 -0500)]
use binary_op over overflowing_binary_op

2 years agoAuto merge of #1995 - saethlin:trophies, r=RalfJung
bors [Thu, 3 Mar 2022 18:57:56 +0000 (18:57 +0000)]
Auto merge of #1995 - saethlin:trophies, r=RalfJung

rkyv deallocation alignment issue

2 years agorkyv deallocation alignment issue
Ben Kimock [Thu, 3 Mar 2022 18:10:05 +0000 (13:10 -0500)]
rkyv deallocation alignment issue

2 years agoAuto merge of #1992 - RalfJung:sdiv, r=RalfJung
bors [Thu, 3 Mar 2022 17:32:59 +0000 (17:32 +0000)]
Auto merge of #1992 - RalfJung:sdiv, r=RalfJung

adjust for div/rem overflow being UB

This is the Miri side of https://github.com/rust-lang/rust/pull/94512. Just some error messages change.

2 years agoadd test for simd division overflow UB
Ralf Jung [Thu, 3 Mar 2022 17:32:42 +0000 (12:32 -0500)]
add test for simd division overflow UB