Add a custom ui test runner and move all tests to it
This commit is contained in:
parent
5063880779
commit
f1756c3ddd
447 changed files with 7323 additions and 464 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Contribution Guide
|
||||
|
||||
If you want to hack on miri yourself, great! Here are some resources you might
|
||||
If you want to hack on Miri yourself, great! Here are some resources you might
|
||||
find useful.
|
||||
|
||||
## Getting started
|
||||
|
|
@ -89,6 +89,20 @@ MIRI_LOG=rustc_mir::interpret=info,miri::stacked_borrows ./miri run tests/run-pa
|
|||
In addition, you can set `MIRI_BACKTRACE=1` to get a backtrace of where an
|
||||
evaluation error was originally raised.
|
||||
|
||||
#### UI testing
|
||||
|
||||
We use ui-testing in Miri, meaning we generate `.stderr` and `.stdout` files for the output
|
||||
produced by Miri. You can use `./miri bless` to automatically (re)generate these files when
|
||||
you add new tests or change how Miri presents certain output.
|
||||
|
||||
Note that when you also use `MIRIFLAGS` to change optimizations and similar, the ui output
|
||||
will change in unexpected ways. In order to still be able
|
||||
to run the other checks while ignoring the ui output, use `MIRI_SKIP_UI_CHECKS=1 ./miri test`.
|
||||
|
||||
For more info on how to configure ui tests see [the documentation on the ui test crate][ui_test]
|
||||
|
||||
[ui_test]: ui_test/README.md
|
||||
|
||||
### Testing `cargo miri`
|
||||
|
||||
Working with the driver directly gives you full control, but you also lose all
|
||||
|
|
@ -183,7 +197,7 @@ A big part of the Miri driver lives in rustc, so working on Miri will sometimes
|
|||
require using a locally built rustc. The bug you want to fix may actually be on
|
||||
the rustc side, or you just need to get more detailed trace of the execution
|
||||
than what is possible with release builds -- in both cases, you should develop
|
||||
miri against a rustc you compiled yourself, with debug assertions (and hence
|
||||
Miri against a rustc you compiled yourself, with debug assertions (and hence
|
||||
tracing) enabled.
|
||||
|
||||
The setup for a local rustc works as follows:
|
||||
|
|
@ -191,7 +205,7 @@ The setup for a local rustc works as follows:
|
|||
# Clone the rust-lang/rust repo.
|
||||
git clone https://github.com/rust-lang/rust rustc
|
||||
cd rustc
|
||||
# Create a config.toml with defaults for working on miri.
|
||||
# Create a config.toml with defaults for working on Miri.
|
||||
./x.py setup compiler
|
||||
# Now edit `config.toml` and under `[rust]` set `debug-assertions = true`.
|
||||
|
||||
|
|
|
|||
341
Cargo.lock
generated
341
Cargo.lock
generated
|
|
@ -12,10 +12,13 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.51"
|
||||
name = "ansi_term"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203"
|
||||
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atty"
|
||||
|
|
@ -28,6 +31,12 @@ dependencies = [
|
|||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
|
|
@ -52,26 +61,82 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "compiletest_rs"
|
||||
version = "0.7.1"
|
||||
name = "crossbeam"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29843cb8d351febf86557681d049d1e1652b81a086a190fa1173c07fd17fbf83"
|
||||
checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845"
|
||||
dependencies = [
|
||||
"diff",
|
||||
"filetime",
|
||||
"getopts",
|
||||
"cfg-if",
|
||||
"crossbeam-channel",
|
||||
"crossbeam-deque",
|
||||
"crossbeam-epoch",
|
||||
"crossbeam-queue",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-channel"
|
||||
version = "0.5.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crossbeam-epoch",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-epoch"
|
||||
version = "0.9.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"log",
|
||||
"miow",
|
||||
"regex",
|
||||
"rustfix",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"tempfile",
|
||||
"tester",
|
||||
"winapi",
|
||||
"memoffset",
|
||||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-queue"
|
||||
version = "0.3.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ctor"
|
||||
version = "0.1.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -80,27 +145,6 @@ version = "0.1.12"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499"
|
||||
|
||||
[[package]]
|
||||
name = "dirs-next"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"dirs-sys-next",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirs-sys-next"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"redox_users",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.9.0"
|
||||
|
|
@ -114,27 +158,6 @@ dependencies = [
|
|||
"termcolor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "filetime"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getopts"
|
||||
version = "0.2.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
|
||||
dependencies = [
|
||||
"unicode-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.3"
|
||||
|
|
@ -170,12 +193,6 @@ dependencies = [
|
|||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
|
||||
|
||||
[[package]]
|
||||
name = "lazy_static"
|
||||
version = "1.4.0"
|
||||
|
|
@ -236,12 +253,12 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "miow"
|
||||
version = "0.3.7"
|
||||
name = "memoffset"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
|
||||
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -249,27 +266,27 @@ name = "miri"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"colored",
|
||||
"compiletest_rs",
|
||||
"env_logger",
|
||||
"getrandom",
|
||||
"lazy_static",
|
||||
"libc",
|
||||
"log",
|
||||
"measureme",
|
||||
"rand",
|
||||
"regex",
|
||||
"rustc-workspace-hack",
|
||||
"rustc_version",
|
||||
"shell-escape",
|
||||
"smallvec",
|
||||
"ui_test",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num_cpus"
|
||||
version = "1.13.0"
|
||||
name = "output_vt100"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
|
||||
checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -313,19 +330,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.33"
|
||||
name = "pretty_assertions"
|
||||
version = "1.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a"
|
||||
checksum = "c89f989ac94207d048d92db058e4f6ec7342b0971fc58d1271ca148b799b3563"
|
||||
dependencies = [
|
||||
"unicode-xid",
|
||||
"ansi_term",
|
||||
"ctor",
|
||||
"diff",
|
||||
"output_vt100",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.10"
|
||||
version = "1.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
|
||||
checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
|
@ -379,21 +408,11 @@ dependencies = [
|
|||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_users"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"redox_syscall",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.5.4"
|
||||
version = "1.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
|
||||
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
|
|
@ -406,15 +425,6 @@ version = "0.6.25"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
||||
|
||||
[[package]]
|
||||
name = "remove_dir_all"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-hash"
|
||||
version = "1.1.0"
|
||||
|
|
@ -436,30 +446,6 @@ dependencies = [
|
|||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustfix"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2c50b74badcddeb8f7652fa8323ce440b95286f8e4b64ebfd871c609672704e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.1.0"
|
||||
|
|
@ -468,40 +454,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
|||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.4"
|
||||
version = "1.0.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.131"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4ad69dfbd3e45369132cc64e6748c2d65cdfb001a2b1c232d128b4ad60561c1"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.131"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b710a83c4e0dff6a3d511946b95274ad9ca9e5d3ae497b63fda866ac955358d2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.73"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd"
|
||||
|
||||
[[package]]
|
||||
name = "shell-escape"
|
||||
|
|
@ -517,38 +472,13 @@ checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.82"
|
||||
version = "1.0.95"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59"
|
||||
checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempfile"
|
||||
version = "3.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"rand",
|
||||
"redox_syscall",
|
||||
"remove_dir_all",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "term"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
|
||||
dependencies = [
|
||||
"dirs-next",
|
||||
"rustversion",
|
||||
"winapi",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -561,29 +491,22 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "tester"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0639d10d8f4615f223a57275cf40f9bdb7cfbb806bcb7f7cc56e3beb55a576eb"
|
||||
name = "ui_test"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"getopts",
|
||||
"libc",
|
||||
"num_cpus",
|
||||
"term",
|
||||
"colored",
|
||||
"crossbeam",
|
||||
"lazy_static",
|
||||
"pretty_assertions",
|
||||
"regex",
|
||||
"rustc_version",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.9"
|
||||
name = "unicode-ident"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||
checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee"
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
|
|
|
|||
|
|
@ -37,9 +37,10 @@ measureme = "9.1.2"
|
|||
libc = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
compiletest_rs = { version = "0.7", features = ["tmp"] }
|
||||
rustc_version = "0.4"
|
||||
colored = "2"
|
||||
ui_test = { path = "ui_test" }
|
||||
regex = "1.5.5"
|
||||
lazy_static = "1.4.0"
|
||||
|
||||
[package.metadata.rust-analyzer]
|
||||
# This crate uses #[feature(rustc_private)].
|
||||
|
|
|
|||
17
README.md
17
README.md
|
|
@ -328,7 +328,7 @@ to Miri failing to detect cases of undefined behavior in a program.
|
|||
using the tools in the repository https://github.com/rust-lang/measureme.
|
||||
* `-Zmiri-mute-stdout-stderr` silently ignores all writes to stdout and stderr,
|
||||
but reports to the program that it did actually write. This is useful when you
|
||||
are not interested in the actual program's output, but only want to see miri's
|
||||
are not interested in the actual program's output, but only want to see Miri's
|
||||
errors and warnings.
|
||||
* `-Zmiri-panic-on-unsupported` will makes some forms of unsupported functionality,
|
||||
such as FFI and unsupported syscalls, panic within the context of the emulated
|
||||
|
|
@ -412,6 +412,11 @@ Moreover, Miri recognizes some environment variables:
|
|||
* `MIRI_TEST_TARGET` (recognized by the test suite) indicates which target
|
||||
architecture to test against. `miri` and `cargo miri` accept the `--target`
|
||||
flag for the same purpose.
|
||||
* `MIRI_BLESS` (recognized by the test suite) overwrite all `stderr` and `stdout` files
|
||||
instead of checking whether the output matches.
|
||||
* `MIRI_SKIP_UI_CHECKS` (recognized by the test suite) don't check whether the
|
||||
`stderr` or `stdout` files match the actual output. Useful for the rustc test suite
|
||||
which has subtle differences that we don't care about.
|
||||
|
||||
The following environment variables are *internal* and must not be used by
|
||||
anyone but Miri itself. They are used to communicate between different Miri
|
||||
|
|
@ -519,15 +524,15 @@ GitHub or use the [Miri stream on the Rust Zulip][zulip].
|
|||
|
||||
This project began as part of an undergraduate research course in 2015 by
|
||||
@solson at the [University of Saskatchewan][usask]. There are [slides] and a
|
||||
[report] available from that project. In 2016, @oli-obk joined to prepare miri
|
||||
[report] available from that project. In 2016, @oli-obk joined to prepare Miri
|
||||
for eventually being used as const evaluator in the Rust compiler itself
|
||||
(basically, for `const` and `static` stuff), replacing the old evaluator that
|
||||
worked directly on the AST. In 2017, @RalfJung did an internship with Mozilla
|
||||
and began developing miri towards a tool for detecting undefined behavior, and
|
||||
also using miri as a way to explore the consequences of various possible
|
||||
definitions for undefined behavior in Rust. @oli-obk's move of the miri engine
|
||||
and began developing Miri towards a tool for detecting undefined behavior, and
|
||||
also using Miri as a way to explore the consequences of various possible
|
||||
definitions for undefined behavior in Rust. @oli-obk's move of the Miri engine
|
||||
into the compiler finally came to completion in early 2018. Meanwhile, later
|
||||
that year, @RalfJung did a second internship, developing miri further with
|
||||
that year, @RalfJung did a second internship, developing Miri further with
|
||||
support for checking basic type invariants and verifying that references are
|
||||
used according to their aliasing restrictions.
|
||||
|
||||
|
|
|
|||
|
|
@ -461,7 +461,12 @@ path = "lib.rs"
|
|||
command.env_remove("RUSTFLAGS");
|
||||
// Disable debug assertions in the standard library -- Miri is already slow enough.
|
||||
// But keep the overflow checks, they are cheap.
|
||||
command.env("RUSTFLAGS", "-Cdebug-assertions=off -Coverflow-checks=on");
|
||||
// Also remap the current directory to something that is stable across different
|
||||
// machines. Otherwise ui output would contain the current directory.
|
||||
command.env(
|
||||
"RUSTFLAGS",
|
||||
"-Cdebug-assertions=off -Coverflow-checks=on -Zremap-cwd-prefix=rustc_src",
|
||||
);
|
||||
// Finally run it!
|
||||
if command.status().expect("failed to run xargo").success().not() {
|
||||
show_error(format!("failed to run xargo"));
|
||||
|
|
|
|||
3
ci.sh
3
ci.sh
|
|
@ -24,7 +24,8 @@ function run_tests {
|
|||
if [ -z "${MIRI_TEST_TARGET+exists}" ]; then
|
||||
# Only for host architecture: tests with optimizations (`-O` is what cargo passes, but crank MIR
|
||||
# optimizations up all the way).
|
||||
MIRIFLAGS="-O -Zmir-opt-level=4" ./miri test --locked
|
||||
# Optimizations change diagnostics (mostly backtraces), so we don't check them
|
||||
MIRIFLAGS="-O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test --locked
|
||||
fi
|
||||
|
||||
# On Windows, there is always "python", not "python3" or "python2".
|
||||
|
|
|
|||
7
miri
7
miri
|
|
@ -123,10 +123,15 @@ build|build-debug)
|
|||
cargo build $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/Cargo.toml "$@"
|
||||
cargo build $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/cargo-miri/Cargo.toml "$@"
|
||||
;;
|
||||
test|test-debug)
|
||||
test|test-debug|bless|bless-debug)
|
||||
# First build and get a sysroot.
|
||||
cargo build $CARGO_BUILD_FLAGS
|
||||
find_sysroot
|
||||
case "$COMMAND" in
|
||||
bless|bless-debug)
|
||||
export MIRI_BLESS="Gesundheit"
|
||||
;;
|
||||
esac
|
||||
# Then test, and let caller control flags.
|
||||
# Only in root project as `cargo-miri` has no tests.
|
||||
exec cargo test $CARGO_BUILD_FLAGS "$@"
|
||||
|
|
|
|||
|
|
@ -583,7 +583,11 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
|
|||
if let Some(&ptr) = ecx.machine.extern_statics.get(&link_name) {
|
||||
Ok(ptr)
|
||||
} else {
|
||||
throw_unsup_format!("`extern` static {:?} is not supported by Miri", def_id)
|
||||
throw_unsup_format!(
|
||||
"`extern` static `{}` from crate `{}` is not supported by Miri",
|
||||
ecx.tcx.def_path_str(def_id),
|
||||
ecx.tcx.crate_name(def_id.krate),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
19
tests/compile-fail/abort-terminator.stderr
Normal file
19
tests/compile-fail/abort-terminator.stderr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
thread 'main' panicked at 'explicit panic', $DIR/abort-terminator.rs:LL:CC
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
error: abnormal termination: the program aborted execution
|
||||
--> $DIR/abort-terminator.rs:LL:CC
|
||||
|
|
||||
LL | extern "C" fn panic_abort() { panic!() }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the program aborted execution
|
||||
|
|
||||
= note: inside `panic_abort` at $DIR/abort-terminator.rs:LL:CC
|
||||
note: inside `main` at $DIR/abort-terminator.rs:LL:CC
|
||||
--> $DIR/abort-terminator.rs:LL:CC
|
||||
|
|
||||
LL | panic_abort();
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
16
tests/compile-fail/alloc/deallocate-bad-alignment.stderr
Normal file
16
tests/compile-fail/alloc/deallocate-bad-alignment.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 1 and alignment ALIGN
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `std::alloc::dealloc` at rustc_src/src/alloc.rs:LL:CC
|
||||
note: inside `main` at $DIR/deallocate-bad-alignment.rs:LL:CC
|
||||
--> $DIR/deallocate-bad-alignment.rs:LL:CC
|
||||
|
|
||||
LL | dealloc(x, Layout::from_size_align_unchecked(1, 2));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
16
tests/compile-fail/alloc/deallocate-bad-size.stderr
Normal file
16
tests/compile-fail/alloc/deallocate-bad-size.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `std::alloc::dealloc` at rustc_src/src/alloc.rs:LL:CC
|
||||
note: inside `main` at $DIR/deallocate-bad-size.rs:LL:CC
|
||||
--> $DIR/deallocate-bad-size.rs:LL:CC
|
||||
|
|
||||
LL | dealloc(x, Layout::from_size_align_unchecked(2, 1));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
16
tests/compile-fail/alloc/deallocate-twice.stderr
Normal file
16
tests/compile-fail/alloc/deallocate-twice.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `std::alloc::dealloc` at rustc_src/src/alloc.rs:LL:CC
|
||||
note: inside `main` at $DIR/deallocate-twice.rs:LL:CC
|
||||
--> $DIR/deallocate-twice.rs:LL:CC
|
||||
|
|
||||
LL | dealloc(x, Layout::from_size_align_unchecked(1, 1));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
// (even when the default `Global` uses `System`).
|
||||
// error-pattern: which is Rust heap memory, using
|
||||
|
||||
// normalize-stderr-test: "using [A-Za-z]+ heap deallocation operation" -> "using PLATFORM heap deallocation operation"
|
||||
|
||||
#![feature(allocator_api, slice_ptr_get)]
|
||||
|
||||
use std::alloc::{Allocator, Global, System, Layout};
|
||||
|
|
|
|||
17
tests/compile-fail/alloc/global_system_mixup.stderr
Normal file
17
tests/compile-fail/alloc/global_system_mixup.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
error: Undefined Behavior: deallocating ALLOC, which is Rust heap memory, using PLATFORM heap deallocation operation
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `std::sys::PLATFORM::alloc::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at rustc_src/src/sys/PLATFORM/alloc.rs:LL:CC
|
||||
= note: inside `<std::alloc::System as std::alloc::Allocator>::deallocate` at rustc_src/src/alloc.rs:LL:CC
|
||||
note: inside `main` at $DIR/global_system_mixup.rs:LL:CC
|
||||
--> $DIR/global_system_mixup.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { System.deallocate(ptr, l); }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
12
tests/compile-fail/alloc/no_global_allocator.stderr
Normal file
12
tests/compile-fail/alloc/no_global_allocator.stderr
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
error: unsupported operation: can't call foreign function: __rust_alloc
|
||||
--> $DIR/no_global_allocator.rs:LL:CC
|
||||
|
|
||||
LL | __rust_alloc(1, 1);
|
||||
| ^^^^^^^^^^^^^^^^^^ can't call foreign function: __rust_alloc
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `start` at $DIR/no_global_allocator.rs:LL:CC
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
16
tests/compile-fail/alloc/reallocate-bad-size.stderr
Normal file
16
tests/compile-fail/alloc/reallocate-bad-size.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
error: Undefined Behavior: incorrect layout on deallocation: ALLOC has size 1 and alignment ALIGN, but gave size 2 and alignment ALIGN
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `std::alloc::realloc` at rustc_src/src/alloc.rs:LL:CC
|
||||
note: inside `main` at $DIR/reallocate-bad-size.rs:LL:CC
|
||||
--> $DIR/reallocate-bad-size.rs:LL:CC
|
||||
|
|
||||
LL | let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/alloc/reallocate-change-alloc.stderr
Normal file
15
tests/compile-fail/alloc/reallocate-change-alloc.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/reallocate-change-alloc.rs:LL:CC
|
||||
|
|
||||
LL | let _z = *x;
|
||||
| ^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/reallocate-change-alloc.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
16
tests/compile-fail/alloc/reallocate-dangling.stderr
Normal file
16
tests/compile-fail/alloc/reallocate-dangling.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `std::alloc::realloc` at rustc_src/src/alloc.rs:LL:CC
|
||||
note: inside `main` at $DIR/reallocate-dangling.rs:LL:CC
|
||||
--> $DIR/reallocate-dangling.rs:LL:CC
|
||||
|
|
||||
LL | let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
20
tests/compile-fail/alloc/stack_free.stderr
Normal file
20
tests/compile-fail/alloc/stack_free.stderr
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
error: Undefined Behavior: deallocating ALLOC, which is stack variable memory, using Rust heap deallocation operation
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `std::alloc::dealloc` at rustc_src/src/alloc.rs:LL:CC
|
||||
= note: inside `<std::alloc::Global as std::alloc::Allocator>::deallocate` at rustc_src/src/alloc.rs:LL:CC
|
||||
= note: inside `alloc::alloc::box_free::<i32, std::alloc::Global>` at rustc_src/src/alloc.rs:LL:CC
|
||||
= note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at rustc_src/src/ptr/mod.rs:LL:CC
|
||||
= note: inside `std::mem::drop::<std::boxed::Box<i32>>` at rustc_src/src/mem/mod.rs:LL:CC
|
||||
note: inside `main` at $DIR/stack_free.rs:LL:CC
|
||||
--> $DIR/stack_free.rs:LL:CC
|
||||
|
|
||||
LL | drop(bad_box);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/backtrace/bad-backtrace-decl.stderr
Normal file
15
tests/compile-fail/backtrace/bad-backtrace-decl.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: bad declaration of miri_resolve_frame - should return a struct with 5 fields
|
||||
--> $DIR/bad-backtrace-decl.rs:LL:CC
|
||||
|
|
||||
LL | ... miri_resolve_frame(*frame, 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bad declaration of miri_resolve_frame - should return a struct with 5 fields
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/bad-backtrace-decl.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
14
tests/compile-fail/backtrace/bad-backtrace-flags.stderr
Normal file
14
tests/compile-fail/backtrace/bad-backtrace-flags.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: unknown `miri_get_backtrace` flags 2
|
||||
--> $DIR/bad-backtrace-flags.rs:LL:CC
|
||||
|
|
||||
LL | miri_get_backtrace(2, 0 as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_get_backtrace` flags 2
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/bad-backtrace-flags.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/backtrace/bad-backtrace-ptr.stderr
Normal file
15
tests/compile-fail/backtrace/bad-backtrace-ptr.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: null pointer is not a valid pointer for this operation
|
||||
--> $DIR/bad-backtrace-ptr.rs:LL:CC
|
||||
|
|
||||
LL | miri_resolve_frame(0 as *mut _, 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ null pointer is not a valid pointer for this operation
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/bad-backtrace-ptr.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: unknown `miri_resolve_frame` flags 2
|
||||
--> $DIR/bad-backtrace-resolve-flags.rs:LL:CC
|
||||
|
|
||||
LL | miri_resolve_frame(buf[0], 2);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame` flags 2
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/bad-backtrace-resolve-flags.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: unknown `miri_resolve_frame_names` flags 2
|
||||
--> $DIR/bad-backtrace-resolve-names-flags.rs:LL:CC
|
||||
|
|
||||
LL | ... miri_resolve_frame_names(buf[0], 2, 0 as *mut _, 0 as *mut _);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame_names` flags 2
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/bad-backtrace-resolve-names-flags.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
14
tests/compile-fail/backtrace/bad-backtrace-size-flags.stderr
Normal file
14
tests/compile-fail/backtrace/bad-backtrace-size-flags.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: unknown `miri_backtrace_size` flags 2
|
||||
--> $DIR/bad-backtrace-size-flags.rs:LL:CC
|
||||
|
|
||||
LL | miri_backtrace_size(2);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_backtrace_size` flags 2
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/bad-backtrace-size-flags.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
14
tests/compile-fail/backtrace/bad-backtrace-version.stderr
Normal file
14
tests/compile-fail/backtrace/bad-backtrace-version.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: unknown `miri_resolve_frame` flags 1
|
||||
--> $DIR/bad-backtrace-version.rs:7:9
|
||||
|
|
||||
LL | miri_resolve_frame(0 as *mut _, 1); //~ ERROR unsupported operation: unknown `miri_resolve_frame` flags 1
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame` flags 1
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/bad-backtrace-version.rs:7:9
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
32
tests/compile-fail/box-cell-alias.stderr
Normal file
32
tests/compile-fail/box-cell-alias.stderr
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
|
||||
--> $DIR/box-cell-alias.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { (*ptr).set(20); }
|
||||
| ^^^^^^^^^^^^^^
|
||||
| |
|
||||
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
|
||||
| this error occurs as part of a reborrow at ALLOC[0x0..0x1]
|
||||
|
|
||||
= 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
|
||||
help: <TAG> was created by a retag at offsets [0x0..0x1]
|
||||
--> $DIR/box-cell-alias.rs:LL:CC
|
||||
|
|
||||
LL | let ptr: *const Cell<u8> = &*val;
|
||||
| ^^^^^
|
||||
help: <TAG> was later invalidated at offsets [0x0..0x1]
|
||||
--> $DIR/box-cell-alias.rs:LL:CC
|
||||
|
|
||||
LL | let res = helper(val, ptr);
|
||||
| ^^^
|
||||
= note: inside `helper` at $DIR/box-cell-alias.rs:LL:CC
|
||||
note: inside `main` at $DIR/box-cell-alias.rs:LL:CC
|
||||
--> $DIR/box-cell-alias.rs:LL:CC
|
||||
|
|
||||
LL | let res = helper(val, ptr);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/branchless-select-i128-pointer.stderr
Normal file
15
tests/compile-fail/branchless-select-i128-pointer.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: type validation failed: encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes
|
||||
--> $DIR/branchless-select-i128-pointer.rs:LL:CC
|
||||
|
|
||||
LL | !mask & transmute::<_, TwoPtrs>("false !") | mask & transmute::<_, TwoPtrs>("true !"),
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered (potentially part of) a pointer, but expected plain (non-pointer) bytes
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/branchless-select-i128-pointer.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
12
tests/compile-fail/breakpoint.stderr
Normal file
12
tests/compile-fail/breakpoint.stderr
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
error: abnormal termination: Trace/breakpoint trap
|
||||
--> $DIR/breakpoint.rs:LL:CC
|
||||
|
|
||||
LL | core::intrinsics::breakpoint()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Trace/breakpoint trap
|
||||
|
|
||||
= note: inside `main` at $DIR/breakpoint.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: the main thread terminated without waiting for all remaining threads
|
||||
|
||||
note: pass `-Zmiri-ignore-leaks` to disable this check
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: trying to join a detached or already joined thread
|
||||
--> $DIR/libc_pthread_join_detached.rs:LL:CC
|
||||
|
|
||||
LL | ... assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached or already joined thread
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/libc_pthread_join_detached.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: trying to join a detached or already joined thread
|
||||
--> $DIR/libc_pthread_join_joined.rs:LL:CC
|
||||
|
|
||||
LL | ... assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached or already joined thread
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/libc_pthread_join_joined.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/concurrency/libc_pthread_join_main.stderr
Normal file
17
tests/compile-fail/concurrency/libc_pthread_join_main.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: trying to join a detached or already joined thread
|
||||
--> $DIR/libc_pthread_join_main.rs:LL:CC
|
||||
|
|
||||
LL | ... assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached or already joined thread
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/libc_pthread_join_main.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: trying to join a detached or already joined thread
|
||||
--> $DIR/libc_pthread_join_multiple.rs:LL:CC
|
||||
|
|
||||
LL | ... assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join a detached or already joined thread
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/libc_pthread_join_multiple.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/concurrency/libc_pthread_join_self.stderr
Normal file
17
tests/compile-fail/concurrency/libc_pthread_join_self.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: trying to join itself
|
||||
--> $DIR/libc_pthread_join_self.rs:LL:CC
|
||||
|
|
||||
LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to join itself
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/libc_pthread_join_self.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
// ignore-linux: Only Windows is not supported.
|
||||
// ignore-macos: Only Windows is not supported.
|
||||
// only-windows: Only Windows is not supported.
|
||||
|
||||
use std::thread;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/thread_local_static_dealloc.rs:LL:CC
|
||||
|
|
||||
LL | let _val = *(dangling_ptr as *const u8);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/thread_local_static_dealloc.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
16
tests/compile-fail/concurrency/too_few_args.stderr
Normal file
16
tests/compile-fail/concurrency/too_few_args.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: callee has fewer arguments than expected
|
||||
--> $DIR/too_few_args.rs:LL:CC
|
||||
|
|
||||
LL | panic!()
|
||||
| ^^^^^^^^ callee has fewer arguments than expected
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `thread_start` at rustc_src/src/panic.rs:LL:CC
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
16
tests/compile-fail/concurrency/too_many_args.stderr
Normal file
16
tests/compile-fail/concurrency/too_many_args.stderr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: callee has more arguments than expected
|
||||
--> $DIR/too_many_args.rs:LL:CC
|
||||
|
|
||||
LL | panic!()
|
||||
| ^^^^^^^^ callee has more arguments than expected
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `thread_start` at rustc_src/src/panic.rs:LL:CC
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
19
tests/compile-fail/concurrency/unwind_top_of_stack.stderr
Normal file
19
tests/compile-fail/concurrency/unwind_top_of_stack.stderr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
thread '<unnamed>' panicked at 'explicit panic', $DIR/unwind_top_of_stack.rs:LL:CC
|
||||
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
|
||||
error: Undefined Behavior: unwinding past the topmost frame of the stack
|
||||
--> $DIR/unwind_top_of_stack.rs:LL:CC
|
||||
|
|
||||
LL | / extern "C-unwind" fn thread_start(_null: *mut libc::c_void) -> *mut libc::c_void {
|
||||
LL | | panic!()
|
||||
LL | | }
|
||||
| |_^ unwinding past the topmost frame of the stack
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `thread_start` at $DIR/unwind_top_of_stack.rs:LL:CC
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/dangling_pointer_addr_of.rs:LL:CC
|
||||
|
|
||||
LL | let x = unsafe { ptr::addr_of!(*p) };
|
||||
| ^^^^^^^^^^^^^^^^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at rustc_src/src/ptr/mod.rs:LL:CC
|
||||
= note: this error originates in the macro `ptr::addr_of` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/dangling_pointer_deref.rs:LL:CC
|
||||
|
|
||||
LL | let x = unsafe { *p };
|
||||
| ^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/dangling_pointer_deref.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/dangling_zst_deref.rs:LL:CC
|
||||
|
|
||||
LL | let _x = unsafe { *p };
|
||||
| ^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/dangling_zst_deref.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -3,5 +3,5 @@
|
|||
|
||||
fn main() {
|
||||
let x = 16usize as *const u32;
|
||||
let _y = unsafe { &*x as *const u32 }; //~ ERROR 0x10 is not a valid pointer
|
||||
let _y = unsafe { &*x as *const u32 }; //~ ERROR is not a valid pointer
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: 0x10 is not a valid pointer
|
||||
--> $DIR/deref-invalid-ptr.rs:LL:CC
|
||||
|
|
||||
LL | let _y = unsafe { &*x as *const u32 };
|
||||
| ^^^ dereferencing pointer failed: 0x10 is not a valid pointer
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/deref-invalid-ptr.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: ALLOC has size 8, so pointer to 12 bytes starting at offset 0 is out-of-bounds
|
||||
--> $DIR/deref-partially-dangling.rs:LL:CC
|
||||
|
|
||||
LL | let val = unsafe { (*xptr).1 };
|
||||
| ^^^^^^^^^ dereferencing pointer failed: ALLOC has size 8, so pointer to 12 bytes starting at offset 0 is out-of-bounds
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/deref-partially-dangling.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/dangling_pointers/dyn_size.stderr
Normal file
15
tests/compile-fail/dangling_pointers/dyn_size.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: ALLOC has size 4, so pointer to 5 bytes starting at offset 0 is out-of-bounds
|
||||
--> $DIR/dyn_size.rs:LL:CC
|
||||
|
|
||||
LL | let _ptr = unsafe { &*ptr };
|
||||
| ^^^^^ dereferencing pointer failed: ALLOC has size 4, so pointer to 5 bytes starting at offset 0 is out-of-bounds
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/dyn_size.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: ALLOC has size 1, so pointer at offset -2048 is out-of-bounds
|
||||
--> $DIR/maybe_null_pointer_deref_zst.rs:LL:CC
|
||||
|
|
||||
LL | let _x: () = unsafe { *ptr };
|
||||
| ^^^^ dereferencing pointer failed: ALLOC has size 1, so pointer at offset -2048 is out-of-bounds
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/maybe_null_pointer_deref_zst.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: ALLOC has size 1, so pointer at offset -2048 is out-of-bounds
|
||||
--> $DIR/maybe_null_pointer_write_zst.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { *ptr = zst_val; }
|
||||
| ^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC has size 1, so pointer at offset -2048 is out-of-bounds
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/maybe_null_pointer_write_zst.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: null pointer is not a valid pointer
|
||||
--> $DIR/null_pointer_deref.rs:LL:CC
|
||||
|
|
||||
LL | let x: i32 = unsafe { *std::ptr::null() };
|
||||
| ^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is not a valid pointer
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/null_pointer_deref.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: null pointer is not a valid pointer
|
||||
--> $DIR/null_pointer_deref_zst.rs:LL:CC
|
||||
|
|
||||
LL | let x: () = unsafe { *std::ptr::null() };
|
||||
| ^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is not a valid pointer
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/null_pointer_deref_zst.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: null pointer is not a valid pointer
|
||||
--> $DIR/null_pointer_write.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { *std::ptr::null_mut() = 0i32 };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: null pointer is not a valid pointer
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/null_pointer_write.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
error: Undefined Behavior: memory access failed: null pointer is not a valid pointer
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `std::ptr::write::<[u8; 0]>` at rustc_src/src/ptr/mod.rs:LL:CC
|
||||
= note: inside `std::ptr::mut_ptr::<impl *mut [u8; 0]>::write` at rustc_src/src/ptr/mut_ptr.rs:LL:CC
|
||||
note: inside `main` at $DIR/null_pointer_write_zst.rs:LL:CC
|
||||
--> $DIR/null_pointer_write_zst.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { std::ptr::null_mut::<[u8; 0]>().write(zst_val) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: ALLOC has size 2, so pointer to 1 byte starting at offset 5 is out-of-bounds
|
||||
--> $DIR/out_of_bounds_read1.rs:LL:CC
|
||||
|
|
||||
LL | let x = unsafe { *v.as_ptr().wrapping_offset(5) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC has size 2, so pointer to 1 byte starting at offset 5 is out-of-bounds
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/out_of_bounds_read1.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: ALLOC has size 2, so pointer to 1 byte starting at offset 5 is out-of-bounds
|
||||
--> $DIR/out_of_bounds_read2.rs:LL:CC
|
||||
|
|
||||
LL | let x = unsafe { *v.as_ptr().wrapping_offset(5) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: ALLOC has size 2, so pointer to 1 byte starting at offset 5 is out-of-bounds
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/out_of_bounds_read2.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/dangling_pointers/stack_temporary.stderr
Normal file
15
tests/compile-fail/dangling_pointers/stack_temporary.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/stack_temporary.rs:LL:CC
|
||||
|
|
||||
LL | let val = *x;
|
||||
| ^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/stack_temporary.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/storage_dead_dangling.rs:LL:CC
|
||||
|
|
||||
LL | unsafe { &mut *(LEAK as *mut i32) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `evil` at $DIR/storage_dead_dangling.rs:LL:CC
|
||||
note: inside `main` at $DIR/storage_dead_dangling.rs:LL:CC
|
||||
--> $DIR/storage_dead_dangling.rs:LL:CC
|
||||
|
|
||||
LL | evil();
|
||||
| ^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
fn main() {
|
||||
let p = 44 as *const i32;
|
||||
let x = unsafe { *p }; //~ ERROR 0x2c is not a valid pointer
|
||||
let x = unsafe { *p }; //~ ERROR is not a valid pointer
|
||||
panic!("this should never print: {}", x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: dereferencing pointer failed: 0x2c is not a valid pointer
|
||||
--> $DIR/wild_pointer_deref.rs:LL:CC
|
||||
|
|
||||
LL | let x = unsafe { *p };
|
||||
| ^^ dereferencing pointer failed: 0x2c is not a valid pointer
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/wild_pointer_deref.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
17
tests/compile-fail/data_race/alloc_read_race.stderr
Normal file
17
tests/compile-fail/data_race/alloc_read_race.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Read on Thread(id = 2) and Allocate on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/alloc_read_race.rs:LL:CC
|
||||
|
|
||||
LL | *pointer.load(Ordering::Relaxed)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Read on Thread(id = 2) and Allocate on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/alloc_read_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/alloc_write_race.stderr
Normal file
17
tests/compile-fail/data_race/alloc_write_race.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 2) and Allocate on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/alloc_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *pointer.load(Ordering::Relaxed) = 2;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on Thread(id = 2) and Allocate on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/alloc_write_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Atomic Load on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/atomic_read_na_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | atomic_load(c.0 as *mut usize)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Load on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/atomic_read_na_write_race1.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 2) and Atomic Load on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/atomic_read_na_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | *atomic_ref.get_mut() = 32;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on Thread(id = 2) and Atomic Load on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/atomic_read_na_write_race2.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Read on Thread(id = 2) and Atomic Store on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/atomic_write_na_read_race1.rs:LL:CC
|
||||
|
|
||||
LL | *atomic_ref.get_mut()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ Data race detected between Read on Thread(id = 2) and Atomic Store on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/atomic_write_na_read_race1.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Atomic Store on Thread(id = 2) and Read on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/atomic_write_na_read_race2.rs:LL:CC
|
||||
|
|
||||
LL | atomic_store(c.0 as *mut usize, 32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Store on Thread(id = 2) and Read on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/atomic_write_na_read_race2.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Atomic Store on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/atomic_write_na_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | atomic_store(c.0 as *mut usize, 64);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Atomic Store on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/atomic_write_na_write_race1.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 2) and Atomic Store on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/atomic_write_na_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | *atomic_ref.get_mut() = 32;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Write on Thread(id = 2) and Atomic Store on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/atomic_write_na_write_race2.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 3) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/dangling_thread_async_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on Thread(id = 3) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/dangling_thread_async_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/dangling_thread_race.stderr
Normal file
17
tests/compile-fail/data_race/dangling_thread_race.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 0, name = "main") and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/dangling_thread_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on Thread(id = 0, name = "main") and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/dangling_thread_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/dealloc_read_race1.stderr
Normal file
17
tests/compile-fail/data_race/dealloc_read_race1.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Deallocate on Thread(id = 2) and Read on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/dealloc_read_race1.rs:LL:CC
|
||||
|
|
||||
LL | __rust_dealloc(ptr.0 as *mut _, std::mem::size_of::<usize>(), std::mem::align_of::<usize>());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Deallocate on Thread(id = 2) and Read on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/dealloc_read_race1.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/dealloc_read_race2.stderr
Normal file
17
tests/compile-fail/data_race/dealloc_read_race2.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/dealloc_read_race2.rs:LL:CC
|
||||
|
|
||||
LL | *ptr.0
|
||||
| ^^^^^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/dealloc_read_race2.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/dealloc_read_race_stack.stderr
Normal file
17
tests/compile-fail/data_race/dealloc_read_race_stack.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/dealloc_read_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | }
|
||||
| ^ Data race detected between Deallocate on Thread(id = 1) and Read on Thread(id = 2) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/dealloc_read_race_stack.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/dealloc_write_race1.stderr
Normal file
17
tests/compile-fail/data_race/dealloc_write_race1.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Deallocate on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/dealloc_write_race1.rs:LL:CC
|
||||
|
|
||||
LL | __rust_dealloc(ptr.0 as *mut _, std::mem::size_of::<usize>(), std::mem::align_of::<usize>());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Data race detected between Deallocate on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/dealloc_write_race1.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/dealloc_write_race2.stderr
Normal file
17
tests/compile-fail/data_race/dealloc_write_race2.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/dealloc_write_race2.rs:LL:CC
|
||||
|
|
||||
LL | *ptr.0 = 2;
|
||||
| ^^^^^^^^^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/dealloc_write_race2.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/dealloc_write_race_stack.stderr
Normal file
17
tests/compile-fail/data_race/dealloc_write_race_stack.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/dealloc_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | }
|
||||
| ^ Data race detected between Deallocate on Thread(id = 1) and Write on Thread(id = 2) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/dealloc_write_race_stack.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 6) and Write on Thread(id = 5) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/enable_after_join_to_main.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on Thread(id = 6) and Write on Thread(id = 5) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/enable_after_join_to_main.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/read_write_race.stderr
Normal file
17
tests/compile-fail/data_race/read_write_race.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 2) and Read on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/read_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on Thread(id = 2) and Read on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/read_write_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/read_write_race_stack.stderr
Normal file
17
tests/compile-fail/data_race/read_write_race_stack.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/read_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | stack_var
|
||||
| ^^^^^^^^^ Data race detected between Read on Thread(id = 1) and Write on Thread(id = 2) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/read_write_race_stack.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/relax_acquire_race.stderr
Normal file
17
tests/compile-fail/data_race/relax_acquire_race.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/relax_acquire_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^ Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/relax_acquire_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/release_seq_race.stderr
Normal file
17
tests/compile-fail/data_race/release_seq_race.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/release_seq_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^ Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/release_seq_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Read on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/release_seq_race_same_thread.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^ Data race detected between Read on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/release_seq_race_same_thread.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/rmw_race.stderr
Normal file
17
tests/compile-fail/data_race/rmw_race.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/rmw_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0
|
||||
| ^^^^ Data race detected between Read on Thread(id = 3) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/rmw_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/write_write_race.stderr
Normal file
17
tests/compile-fail/data_race/write_write_race.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/write_write_race.rs:LL:CC
|
||||
|
|
||||
LL | *c.0 = 64;
|
||||
| ^^^^^^^^^ Data race detected between Write on Thread(id = 2) and Write on Thread(id = 1) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/write_write_race.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
17
tests/compile-fail/data_race/write_write_race_stack.stderr
Normal file
17
tests/compile-fail/data_race/write_write_race_stack.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: thread support is experimental and incomplete: weak memory effects are not emulated.
|
||||
|
||||
error: Undefined Behavior: Data race detected between Write on Thread(id = 1) and Write on Thread(id = 2) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
--> $DIR/write_write_race_stack.rs:LL:CC
|
||||
|
|
||||
LL | stack_var = 1usize;
|
||||
| ^^^^^^^^^^^^^^^^^^ Data race detected between Write on Thread(id = 1) and Write on Thread(id = 2) at ALLOC (current vector clock = VClock, conflicting timestamp = VClock)
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside closure at $DIR/write_write_race_stack.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error; 1 warning emitted
|
||||
|
||||
15
tests/compile-fail/environ-gets-deallocated.stderr
Normal file
15
tests/compile-fail/environ-gets-deallocated.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
|
||||
--> $DIR/environ-gets-deallocated.rs:LL:CC
|
||||
|
|
||||
LL | let _y = unsafe { *pointer };
|
||||
| ^^^^^^^^ pointer to ALLOC was dereferenced after this allocation got freed
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/environ-gets-deallocated.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
26
tests/compile-fail/erroneous_const.stderr
Normal file
26
tests/compile-fail/erroneous_const.stderr
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
error[E0080]: evaluation of `PrintName::<i32>::VOID` failed
|
||||
--> $DIR/erroneous_const.rs:LL:CC
|
||||
|
|
||||
LL | const VOID: ! = panic!();
|
||||
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/erroneous_const.rs:LL:CC
|
||||
|
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: post-monomorphization error: encountered constants with type errors, stopping evaluation
|
||||
--> $DIR/erroneous_const.rs:LL:CC
|
||||
|
|
||||
LL | let _ = PrintName::<T>::VOID;
|
||||
| ^^^^^^^^^^^^^^^^^^^^ encountered constants with type errors, stopping evaluation
|
||||
|
|
||||
= note: inside `no_codegen::<i32>` at $DIR/erroneous_const.rs:LL:CC
|
||||
note: inside `main` at $DIR/erroneous_const.rs:LL:CC
|
||||
--> $DIR/erroneous_const.rs:LL:CC
|
||||
|
|
||||
LL | no_codegen::<i32>();
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0080`.
|
||||
41
tests/compile-fail/erroneous_const2.stderr
Normal file
41
tests/compile-fail/erroneous_const2.stderr
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
error: any use of this value will cause an error
|
||||
--> $DIR/erroneous_const2.rs:LL:CC
|
||||
|
|
||||
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
|
||||
| ------------------^^^^^---------------------------
|
||||
| |
|
||||
| attempt to compute `5_u32 - 6_u32`, which would overflow
|
||||
|
|
||||
= note: `#[deny(const_err)]` on by default
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
|
||||
|
||||
error[E0080]: evaluation of constant value failed
|
||||
--> $DIR/erroneous_const2.rs:LL:CC
|
||||
|
|
||||
LL | println!("{}", FOO);
|
||||
| ^^^ referenced constant has errors
|
||||
|
||||
error: erroneous constant used
|
||||
--> $DIR/erroneous_const2.rs:LL:CC
|
||||
|
|
||||
LL | println!("{}", FOO);
|
||||
| ^^^ referenced constant has errors
|
||||
|
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
|
||||
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: post-monomorphization error: referenced constant has errors
|
||||
--> $DIR/erroneous_const2.rs:LL:CC
|
||||
|
|
||||
LL | println!("{}", FOO);
|
||||
| ^^^ referenced constant has errors
|
||||
|
|
||||
= note: inside `main` at $DIR/erroneous_const2.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0080`.
|
||||
14
tests/compile-fail/extern_static.stderr
Normal file
14
tests/compile-fail/extern_static.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: `extern` static `FOO` from crate `extern_static` is not supported by Miri
|
||||
--> $DIR/extern_static.rs:LL:CC
|
||||
|
|
||||
LL | let _val = unsafe { std::ptr::addr_of!(FOO) };
|
||||
| ^^^ `extern` static `FOO` from crate `extern_static` is not supported by Miri
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/extern_static.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/fast_math_both.stderr
Normal file
15
tests/compile-fail/fast_math_both.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: `fsub_fast` intrinsic called with non-finite value as both parameters
|
||||
--> $DIR/fast_math_both.rs:LL:CC
|
||||
|
|
||||
LL | ...: f32 = core::intrinsics::fsub_fast(f32::NAN, f32::NAN);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fsub_fast` intrinsic called with non-finite value as both parameters
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/fast_math_both.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/fast_math_first.stderr
Normal file
15
tests/compile-fail/fast_math_first.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: `frem_fast` intrinsic called with non-finite value as first parameter
|
||||
--> $DIR/fast_math_first.rs:LL:CC
|
||||
|
|
||||
LL | ... let _x: f32 = core::intrinsics::frem_fast(f32::NAN, 3.2);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `frem_fast` intrinsic called with non-finite value as first parameter
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/fast_math_first.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/fast_math_second.stderr
Normal file
15
tests/compile-fail/fast_math_second.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: `fmul_fast` intrinsic called with non-finite value as second parameter
|
||||
--> $DIR/fast_math_second.rs:LL:CC
|
||||
|
|
||||
LL | ...f32 = core::intrinsics::fmul_fast(3.4f32, f32::INFINITY);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fmul_fast` intrinsic called with non-finite value as second parameter
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/fast_math_second.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
14
tests/compile-fail/fs/close_stdout.stderr
Normal file
14
tests/compile-fail/fs/close_stdout.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: stdout cannot be closed
|
||||
--> $DIR/close_stdout.rs:LL:CC
|
||||
|
|
||||
LL | libc::close(1);
|
||||
| ^^^^^^^^^^^^^^ stdout cannot be closed
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/close_stdout.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
22
tests/compile-fail/fs/isolated_file.stderr
Normal file
22
tests/compile-fail/fs/isolated_file.stderr
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
error: unsupported operation: `open` not available when isolation is enabled
|
||||
|
|
||||
= help: pass the flag `-Zmiri-disable-isolation` to disable isolation;
|
||||
= help: or pass `-Zmiri-isolation-error=warn` to configure Miri to return an error code from isolated operations (if supported for that operation) and continue with a warning
|
||||
|
||||
= note: inside closure at rustc_src/src/sys/PLATFORM/fs.rs:LL:CC
|
||||
= note: inside `std::sys::PLATFORM::cvt_r::<i32, [closure@std::sys::PLATFORM::fs::File::open_c::{closure#0}]>` at rustc_src/src/sys/PLATFORM/mod.rs:LL:CC
|
||||
= note: inside `std::sys::PLATFORM::fs::File::open_c` at rustc_src/src/sys/PLATFORM/fs.rs:LL:CC
|
||||
= note: inside `std::sys::PLATFORM::fs::File::open` at rustc_src/src/sys/PLATFORM/fs.rs:LL:CC
|
||||
= note: inside `std::fs::OpenOptions::_open` at rustc_src/src/fs.rs:LL:CC
|
||||
= note: inside `std::fs::OpenOptions::open::<&std::path::Path>` at rustc_src/src/fs.rs:LL:CC
|
||||
= note: inside `std::fs::File::open::<&str>` at rustc_src/src/fs.rs:LL:CC
|
||||
note: inside `main` at $DIR/isolated_file.rs:LL:CC
|
||||
--> $DIR/isolated_file.rs:LL:CC
|
||||
|
|
||||
LL | let _file = std::fs::File::open("file.txt").unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/fs/isolated_stdin.stderr
Normal file
15
tests/compile-fail/fs/isolated_stdin.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: unsupported operation: `read` from stdin not available when isolation is enabled
|
||||
--> $DIR/isolated_stdin.rs:LL:CC
|
||||
|
|
||||
LL | libc::read(0, bytes.as_mut_ptr() as *mut libc::c_void, 512);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `read` from stdin not available when isolation is enabled
|
||||
|
|
||||
= help: pass the flag `-Zmiri-disable-isolation` to disable isolation;
|
||||
= help: or pass `-Zmiri-isolation-error=warn` to configure Miri to return an error code from isolated operations (if supported for that operation) and continue with a warning
|
||||
|
||||
= note: inside `main` at $DIR/isolated_stdin.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
14
tests/compile-fail/fs/read_from_stdout.stderr
Normal file
14
tests/compile-fail/fs/read_from_stdout.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: cannot read from stdout
|
||||
--> $DIR/read_from_stdout.rs:LL:CC
|
||||
|
|
||||
LL | libc::read(1, bytes.as_mut_ptr() as *mut libc::c_void, 512);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot read from stdout
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/read_from_stdout.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
20
tests/compile-fail/fs/unix_open_missing_required_mode.stderr
Normal file
20
tests/compile-fail/fs/unix_open_missing_required_mode.stderr
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
error: Undefined Behavior: incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
|
||||
--> $DIR/unix_open_missing_required_mode.rs:LL:CC
|
||||
|
|
||||
LL | ...safe { libc::open(name_ptr, libc::O_CREAT) };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments for `open` with `O_CREAT`: got 2, expected at least 3
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `test_file_open_missing_needed_mode` at $DIR/unix_open_missing_required_mode.rs:LL:CC
|
||||
note: inside `main` at $DIR/unix_open_missing_required_mode.rs:LL:CC
|
||||
--> $DIR/unix_open_missing_required_mode.rs:LL:CC
|
||||
|
|
||||
LL | test_file_open_missing_needed_mode();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
20
tests/compile-fail/fs/unix_open_too_many_args.stderr
Normal file
20
tests/compile-fail/fs/unix_open_too_many_args.stderr
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
error: Undefined Behavior: incorrect number of arguments for `open`: got 4, expected 2 or 3
|
||||
--> $DIR/unix_open_too_many_args.rs:15:24
|
||||
|
|
||||
LL | let _fd = unsafe { libc::open(name_ptr, libc::O_RDONLY, 0, 0) }; //~ ERROR Undefined Behavior: incorrect number of arguments for `ope...
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of arguments for `open`: got 4, expected 2 or 3
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `test_open_too_many_args` at $DIR/unix_open_too_many_args.rs:15:24
|
||||
note: inside `main` at $DIR/unix_open_too_many_args.rs:9:5
|
||||
--> $DIR/unix_open_too_many_args.rs:9:5
|
||||
|
|
||||
LL | test_open_too_many_args();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
14
tests/compile-fail/fs/write_to_stdin.stderr
Normal file
14
tests/compile-fail/fs/write_to_stdin.stderr
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
error: unsupported operation: cannot write to stdin
|
||||
--> $DIR/write_to_stdin.rs:LL:CC
|
||||
|
|
||||
LL | libc::write(0, bytes.as_ptr() as *const libc::c_void, 5);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot write to stdin
|
||||
|
|
||||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
|
||||
|
||||
= note: inside `main` at $DIR/write_to_stdin.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
15
tests/compile-fail/function_calls/check_arg_abi.stderr
Normal file
15
tests/compile-fail/function_calls/check_arg_abi.stderr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: calling a function with ABI C using caller ABI Rust
|
||||
--> $DIR/check_arg_abi.rs:LL:CC
|
||||
|
|
||||
LL | let _ = malloc(0);
|
||||
| ^^^^^^^^^ calling a function with ABI C using caller ABI Rust
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/check_arg_abi.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
error: Undefined Behavior: incorrect number of arguments: got 1, expected 0
|
||||
--> $DIR/check_arg_count_abort.rs:LL:CC
|
||||
|
|
||||
LL | abort(1);
|
||||
| ^^^^^^^^ incorrect number of arguments: got 1, expected 0
|
||||
|
|
||||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
|
||||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
|
||||
|
||||
= note: inside `main` at $DIR/check_arg_count_abort.rs:LL:CC
|
||||
|
||||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue