Skip to content

Commit 62926b7

Browse files
author
Ellen Arteca
committed
upstream master changes; and no libc on windows
1 parent 7c97b73 commit 62926b7

File tree

147 files changed

+2420
-1423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+2420
-1423
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ perf.data
1010
perf.data.old
1111
flamegraph.svg
1212
tests/extern-so/libtestlib.so
13+
.auto-*

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ install that exact version of rustc as a toolchain:
2828
This will set up a rustup toolchain called `miri` and set it as an override for
2929
the current directory.
3030

31+
You can also create a `.auto-everything` file (contents don't matter, can be empty), which
32+
will cause any `./miri` command to automatically call `rustup-toolchain`, `clippy` and `rustfmt`
33+
for you. If you don't want all of these to happen, you can add individual `.auto-toolchain`,
34+
`.auto-clippy` and `.auto-fmt` files respectively.
35+
3136
[`rustup-toolchain-install-master`]: https://github.com/kennytm/rustup-toolchain-install-master
3237

3338
## Building and testing Miri
@@ -163,11 +168,15 @@ to `.vscode/settings.json` in your local Miri clone:
163168
"./cargo-miri/Cargo.toml"
164169
],
165170
"rust-analyzer.checkOnSave.overrideCommand": [
171+
"env",
172+
"MIRI_AUTO_OPS=no",
166173
"./miri",
167174
"check",
168175
"--message-format=json"
169176
],
170177
"rust-analyzer.buildScripts.overrideCommand": [
178+
"env",
179+
"MIRI_AUTO_OPS=no",
171180
"./miri",
172181
"check",
173182
"--message-format=json",
@@ -244,6 +253,14 @@ rustup toolchain link stage2 build/x86_64-unknown-linux-gnu/stage2
244253
rustup override set stage2
245254
```
246255

256+
Note: When you are working with a locally built rustc or any other toolchain that
257+
is not the same as the one in `rust-version`, you should not have `.auto-everything` or
258+
`.auto-toolchain` as that will keep resetting your toolchain.
259+
260+
```
261+
rm -f .auto-everything .auto-toolchain
262+
```
263+
247264
Important: You need to delete the Miri cache when you change the stdlib; otherwise the
248265
old, chached version will be used. On Linux, the cache is located at `~/.cache/miri`,
249266
and on Windows, it is located at `%LOCALAPPDATA%\rust-lang\miri\cache`; the exact

Cargo.lock

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ harness = false
5858
default = ["stack-cache"]
5959
stack-cache = []
6060

61-
[profile.dev]
62-
opt-level = 2 # because it's too slow otherwise
61+
# Be aware that this file is inside a workspace when used via the
62+
# submodule in the rustc repo. That means there are many cargo features
63+
# we cannot use, such as profiles.

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -337,17 +337,6 @@ The remaining flags are for advanced use only, and more likely to change or be r
337337
Some of these are **unsound**, which means they can lead
338338
to Miri failing to detect cases of undefined behavior in a program.
339339

340-
* `-Zmiri-allow-uninit-numbers` disables the check to ensure that number types (integer and float
341-
types) always hold initialized data. (They must still be initialized when any actual operation,
342-
such as arithmetic, is performed.) Using this flag is **unsound** and
343-
[deprecated](https://github.com/rust-lang/miri/issues/2187). This has no effect when
344-
`-Zmiri-disable-validation` is present.
345-
* `-Zmiri-allow-ptr-int-transmute` makes Miri more accepting of transmutation between pointers and
346-
integers via `mem::transmute` or union/pointer type punning. This has two effects: it disables the
347-
check against integers storing a pointer (i.e., data with provenance), thus allowing
348-
pointer-to-integer transmutation, and it treats integer-to-pointer transmutation as equivalent to
349-
a cast. Implies `-Zmiri-permissive-provenance`. Using this flag is **unsound** and
350-
[deprecated](https://github.com/rust-lang/miri/issues/2188).
351340
* `-Zmiri-disable-abi-check` disables checking [function ABI]. Using this flag
352341
is **unsound**.
353342
* `-Zmiri-disable-alignment-check` disables checking pointer alignment, so you
@@ -412,6 +401,9 @@ Some native rustc `-Z` flags are also very relevant for Miri:
412401

413402
Moreover, Miri recognizes some environment variables:
414403

404+
* `MIRI_AUTO_OPS` indicates whether the automatic execution of rustfmt, clippy and rustup-toolchain
405+
should be skipped. If it is set to any value, they are skipped. This is used for avoiding
406+
infinite recursion in `./miri` and to allow automated IDE actions to avoid the auto ops.
415407
* `MIRI_LOG`, `MIRI_BACKTRACE` control logging and backtrace printing during
416408
Miri executions, also [see "Testing the Miri driver" in `CONTRIBUTING.md`][testing-miri].
417409
* `MIRIFLAGS` (recognized by `cargo miri` and the test suite) defines extra

0 commit comments

Comments
 (0)