Commit Graph

5545 Commits

Author SHA1 Message Date
Ralf Jung
5338a16018 adjust for ERR_ON_PARTIAL_PTR_OVERWRITE 2021-08-02 17:58:55 +02:00
bors
1f969da570 Auto merge of #1863 - hyd-dev:parallel-compiler, r=RalfJung
Use `Lrc` instead of `Rc` in `MiriCompilerCalls::config()`

The `used_crate_source` query defines its return type as [`Lrc<CrateSource>`](1195bea5a7/compiler/rustc_middle/src/query/mod.rs (L1418)), which would be `Arc` when `parallel-compiler = true`.

I assume this fixes rust-lang/rust#87623. I didn't test that locally -- I'm not interested in `parallel-compiler = true` enough to be willing to recompile rustc with that configuration to test it, but I'm submitting this in case it might be useful for `parallel-compiler = true` users.
2021-07-30 14:38:10 +00:00
hyd-dev
a789b49e4c
Use Lrc instead of Rc in MiriCompilerCalls::config() 2021-07-30 21:28:34 +08:00
bors
453e3ef7da Auto merge of #1861 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/87518
2021-07-27 16:39:12 +00:00
Ralf Jung
c76fa2138e rustup 2021-07-27 18:38:35 +02:00
bors
02f78b089c Auto merge of #1858 - RalfJung:thread-leaks, r=oli-obk
also ignore 'thread leaks' with -Zmiri-ignore-leaks

This is a step towards https://github.com/rust-lang/miri/issues/1371. The remaining hard part would be supporting checking for memory leaks when there are threads still running. For now we elegantly avoid this problem by using the same flag to control both of these checks. :)
2021-07-27 12:23:56 +00:00
Ralf Jung
78bcd12b17 make sure we only terminate main thread once TLS is initialized 2021-07-27 14:05:37 +02:00
Ralf Jung
66aa3d0247 make the loop infinite 2021-07-27 13:58:55 +02:00
Ralf Jung
679d10f98b no concurrency on windows 2021-07-25 14:38:02 +02:00
bors
e445f78951 Auto merge of #1859 - RalfJung:global-system-mixup, r=RalfJung
add test for mixing up System and Global memory
2021-07-25 12:37:03 +00:00
Ralf Jung
24fa9deddc add test for mixing up System and Global memory 2021-07-25 14:36:00 +02:00
Ralf Jung
df9d481989 tell users how to disable the leak check 2021-07-25 14:21:06 +02:00
Ralf Jung
71efd950d1 also ignore 'thread leaks' with -Zmiri-ignore-leaks 2021-07-25 14:21:06 +02:00
bors
eb9e3073a0 Auto merge of #1856 - RalfJung:no-mir, r=RalfJung
show proper error when using a sysroot without MIR

Fixes https://github.com/rust-lang/miri/issues/1834
2021-07-25 09:50:06 +00:00
bors
1677946d74 Auto merge of #1838 - atsmtat:fs-isolation, r=RalfJung
Fix use of deprecated `check_no_isolation` in posix fs shims

Update posix fs shims to use new API `reject_in_isolation`, which
allows rejection with error code instead of always forcing abort.
Error code chosen for each op is the most appropriate one from the
list in corresponding syscall's manual.

Updated helper APIs to not use quotes (\`) around input name while
preparing the message. This allows callers to pass multi-word string
like -- "\`read\` from stdin".

Cc https://github.com/rust-lang/miri/issues/1034
2021-07-25 09:34:02 +00:00
Smit Soni
20d0f2ee26 Move shim argument checks before isolation check
This allows catching extremely incorrect arguments before rejecting
due to isolation.
2021-07-24 11:54:55 -07:00
Ralf Jung
46d31f9230 show proper error when using a sysroot without MIR 2021-07-24 14:02:09 +02:00
Smit Soni
da6880427a Update error code for fs ops in isolation
Change the code to either `EACCES` (if the op is performed on the
path), or `EBADF` (if the op is performed the fd)

Updated ops: `stat`, `opendir`, `ftruncate64`, and `readlink`

Add a new test for fs ops in isolation.
2021-07-20 08:23:51 -07:00
Smit Soni
a1cabac727 Fix use of deprecated check_no_isolation in posix fs ops
Update posix fs shims to use new API `reject_in_isolation`, which
allows rejection with error code instead of always forcing abort.
Error code chosen for each op is the most appropriate one from the
list in corresponding syscall's manual.

Updated helper APIs to not use quotes (`) around input name while
preparing the message. This allows callers to pass multi-word string
like -- "`read` from stdin".
2021-07-20 08:23:51 -07:00
bors
e2872a3f2a Auto merge of #1853 - RalfJung:negative-offsets, r=RalfJung
better errors for negative out-of-bounds offsets

This is the Miri side of https://github.com/rust-lang/rust/pull/87224
2021-07-20 11:39:12 +00:00
Ralf Jung
63286771d3 rustup 2021-07-20 13:38:52 +02:00
Ralf Jung
cf26458376 test for negative offsets 2021-07-20 13:30:49 +02:00
Ralf Jung
46ed39ec20 adjust for PointerOutOfBounds change 2021-07-20 13:30:49 +02:00
bors
37974e617e Auto merge of #1855 - RalfJung:rustup, r=RalfJung
rustup

This test was removed in rustc in https://github.com/rust-lang/rust/pull/87141.

We added it in https://github.com/rust-lang/miri/pull/1430, and possibly that "interesting case in unsizing" is not covered by tests now -- but I don't remember what that case is.^^ If/when `impl Trait` in bindings comes back, we should copy the new rustc tests to Miri as well.
2021-07-20 10:21:08 +00:00
Ralf Jung
6ce77164c1 rustup 2021-07-20 12:18:59 +02:00
bors
250eff85c8 Auto merge of #1851 - RalfJung:provenance-overhaul, r=RalfJung
adjust Miri to Pointer type overhaul

This is the Miri side of https://github.com/rust-lang/rust/pull/87123.

This was a lot more work than I expected... lucky enough it is also (hopefully) the last large-scale refactoring I will do.^^

Fixes https://github.com/rust-lang/miri/issues/224
2021-07-17 19:46:33 +00:00
Ralf Jung
0d65d500c6 rustup 2021-07-17 20:24:57 +02:00
Ralf Jung
bf8b2aa8dc add test for better ptr handling in enum niches 2021-07-17 13:59:58 +02:00
Ralf Jung
a1233a721d adjust Miri to Pointer type overhaul 2021-07-16 10:10:12 +02:00
bors
a4a9a36d20 Auto merge of #1850 - RalfJung:fmt, r=RalfJung
fmt: set force_multiline_blocks=true

This is an experiment, I am not yet sure if I like it... but it does prevent rustfmt from putting stuff after the `=>` in a `match` (unless the entire arm fits there), which IMO is a big plus. What do others think?
(I also tried setting `match_arm_blocks` back to its default of `true`, but that adds too many braces for my taste.)

Btw, `@calebcartwright` is the interaction of `match_arm_blocks = false` and `force_multiline_blocks = true` as can be seen here expected? I think I like it, but it it is not at all what I expected from the docs which describe `force_multiline_blocks = true` as "Force multiline closure and match arm bodies to be wrapped in a block" -- but here that is not the effect it has, there are no new blocks being added.
2021-07-12 16:26:02 +00:00
Ralf Jung
cffa1d325c fmt cargo-miri 2021-07-11 14:27:07 +02:00
Ralf Jung
0341b8ac84 fmt: set force_multiline_blocks=true 2021-07-11 14:18:44 +02:00
bors
b06130762e Auto merge of #1849 - Aaron1011:rustup-track-caller, r=RalfJung
Rustup for `#[track_caller]` trait object changes

Change test to assert that we get the correct location
even through a trait object call.
2021-07-10 17:15:31 +00:00
Aaron Hill
811423e761
Rustup for #[track_caller] trait object changes
Change test to assert that we get the correct location
even through a trait object call.
2021-07-10 11:51:00 -05:00
bors
3cf6550cc1 Auto merge of #1848 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/86923
2021-07-07 07:33:42 +00:00
Ralf Jung
833dff994f rustup 2021-07-07 09:33:01 +02:00
bors
4a30b68d45 Auto merge of #1846 - RalfJung:license, r=RalfJung
sync license files with rustc repo

`@Mark-Simulacrum` pointed out that our license files are slightly different from those in rustc. This syncs them.

The question is... is this a thing we can just do?^^
2021-07-06 11:58:42 +00:00
bors
74f81e952c Auto merge of #1847 - RalfJung:more-tags, r=RalfJung
also treat CallerLocation and Machine memory as properly tagged

Only heap allocations need an exception.
2021-07-06 08:14:03 +00:00
Ralf Jung
447f23c71b fmt 2021-07-06 10:13:30 +02:00
Ralf Jung
340267525c exported_symbols_cache: ensure we do not overwrite anything 2021-07-06 10:09:53 +02:00
Ralf Jung
9b57313a4d also treat CallerLocation and Machine memory as properly tagged 2021-07-06 10:07:48 +02:00
Ralf Jung
efd582c6d8 explicitly list memory kinds for stacked borrows 2021-07-06 10:04:16 +02:00
Ralf Jung
ca782dfc1c sync license files with rustc repo 2021-07-05 19:34:08 +02:00
bors
15e81a94b1 Auto merge of #1845 - Smittyvb:fix-after-mir-alloc-oom, r=RalfJung
Make work with latest rustc

Cc https://github.com/rust-lang/rust/issues/86863, which was caused by PR https://github.com/rust-lang/rust/pull/86255.
2021-07-04 20:35:34 +00:00
Smitty
d19376985d Make work after mir-alloc-oom 2021-07-04 09:59:55 -04:00
bors
6a18683d09 Auto merge of #1842 - hyd-dev:target-dir, r=RalfJung
Use `miri` inside the target directory used by rustc as Miri's target directory

Resolves #1311.

This PR makes Miri use `miri` inside the rustc target directory as its target directory, by letting `cargo-miri` get the rustc target directory by calling `cargo metadata`, append `miri` to it, and pass it with `--target-dir` to Cargo.

Getting the rustc target directory accurately requires calling `cargo metadata` as far as I know, because the `target-dir` can be set in config files in various places that are hard for `cargo-miri` to find.

I also considered https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#custom-named-profiles, but it looks like that requires adding `cargo-features = ["named-profiles"]` to **`Cargo.toml`**, which would be tricky for `cargo-miri`:
```
$ cargo +nightly-2021-06-23 test --config 'profile.miri.inherits="release"' --profile=miri -Z named-profiles -Z unstable-options
error: config profile `miri` is not valid (defined in `--config cli option`)

Caused by:
  feature `named-profiles` is required

  consider adding `cargo-features = ["named-profiles"]` to the manifest
```
2021-07-03 07:34:41 +00:00
bors
05fdec916a Auto merge of #1844 - hyd-dev:rustup, r=RalfJung
Update for `TyCtxt::crates()` change

cc rust-lang/rust#86792
2021-07-02 08:49:49 +00:00
hyd-dev
e3fca9b3f1
Import std::process::self 2021-07-02 16:39:43 +08:00
hyd-dev
c504e3dee0
Add a comment in .github/workflows/ci.yml 2021-07-02 16:39:43 +08:00
hyd-dev
76fe48543c
Update for TyCtxt::crates() change 2021-07-02 16:08:27 +08:00