summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2023-05-27Add support for nested panics to miriAmanieu d'Antras-32/+53
2023-05-25Rollup merge of #111950 - cjgillot:expn-noinline, r=oli-obkMichael Goulet-5/+8
Remove ExpnKind::Inlined. Suggested in https://github.com/rust-lang/rust/pull/111815#issuecomment-1561903339 r? ``@oli-obk``
2023-05-25Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelixbors-38/+51
Support #[global_allocator] without the allocator shim This makes it possible to use liballoc/libstd in combination with `--emit obj` if you use `#[global_allocator]`. This is what rust-for-linux uses right now and systemd may use in the future. Currently they have to depend on the exact implementation of the allocator shim to create one themself as `--emit obj` doesn't create an allocator shim. Note that currently the allocator shim also defines the oom error handler, which is normally required too. Once `#![feature(default_alloc_error_handler)]` becomes the only option, this can be avoided. In addition when using only fallible allocator methods and either `--cfg no_global_oom_handling` for liballoc (like rust-for-linux) or `--gc-sections` no references to the oom error handler will exist. To avoid this feature being insta-stable, you will have to define `__rust_no_alloc_shim_is_unstable` to avoid linker errors. (Labeling this with both T-compiler and T-lang as it originally involved both an implementation detail and had an insta-stable user facing change. As noted above, the `__rust_no_alloc_shim_is_unstable` symbol requirement should prevent unintended dependence on this unstable feature.)
2023-05-25Manually add inlined frames in the interpreter stacktrace.Camille GILLOT-5/+8
2023-05-23Update to latest clippyOli Scherer-16/+16
2023-05-23Merge from rustcOli Scherer-10/+8
2023-05-23Preparing for merge from rustcOli Scherer-1/+1
2023-05-23Rollup merge of #111756 - Urgau:rename_drop_forget_copy_ref_lints, r=fee1-deadDylan DPC-4/+4
Rename `{drop,forget}_{copy,ref}` lints to more consistent naming This PR renames previous uplifted lints in https://github.com/rust-lang/rust/pull/109732 to more consistent naming. I followed the renaming done [here](https://github.com/rust-lang/rust/issues/53224) and also advocated in this [clippy issue](https://github.com/rust-lang/rust-clippy/issues/2845): - `drop_copy` to `dropping_copy_types` - `forget_copy` to `forgetting_copy_types` - `drop_ref` to `dropping_references` - `forget_ref` to `forgetting_references`
2023-05-21Use a signal handler to observe ctrl+c and cleanly drop the measureme profilerBen Kimock-0/+56
2023-05-21Rename `drop_ref` lint to `dropping_references`Urgau-1/+1
2023-05-21Rename `drop_copy` lint to `dropping_copy_types`Urgau-3/+3
2023-05-19Drive-by-cleanup: Don't emit `thir::ExprKind::NeverToAny` for `! -> !`Maybe Waffle-6/+4
2023-05-18Merge from rustcRalf Jung-2/+1
2023-05-18Preparing for merge from rustcRalf Jung-1/+1
2023-05-16Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obkNilstrieb-2/+1
Suppress "erroneous constant used" for constants tainted by errors When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not. Fixes #110891.
2023-05-16Merge from rustcRalf Jung-2/+2
2023-05-16Preparing for merge from rustcRalf Jung-1/+1
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-2/+2
2023-05-15Suppress "erroneous constant used" for constants tainted by errorsTomasz Miąsko-2/+1
When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not.
2023-05-13Auto merge of #2895 - RalfJung:simd_bitmask, r=RalfJungbors-2/+42
support array return types in simd_bitmask Fixes https://github.com/rust-lang/miri/issues/2734 As usual I am stomped by the simd_bitmask behavior wrt endianess. I confirmed that for little endian, Miri matches what rustc currently does, but I can't test rustc on big endian. `@workingjubilee` `@calebzulawski` could you have a look whether those new tests make sense?
2023-05-13support array return types in simd_bitmaskRalf Jung-2/+42
2023-05-13cargo-miri: fix forwarding arguments to cargoRalf Jung-30/+33
2023-05-13implement SIMD ptr castsRalf Jung-5/+33
2023-05-13fmt and fix lintRalf Jung-2/+1
2023-05-13Merge from rustcRalf Jung-0/+9
2023-05-13Preparing for merge from rustcRalf Jung-1/+1
2023-05-12Auto merge of #111506 - RalfJung:miri, r=oli-obkbors-4/+7
update Miri and run mir-opt-level=4 tests in rustc CI so issues like https://github.com/rust-lang/rust/issues/111422 are caught before they land. r? `@oli-obk` due to the bootstrap changes
2023-05-12Auto merge of #2890 - oli-obk:ui_test, r=RalfJungbors-21/+58
Add `./miri run-dep` for running a file with test dependencies available fixes #2443
2023-05-12Document arguments and interesting flagsOli Scherer-1/+3
2023-05-12opt-level 4 should work again nowRalf Jung-2/+1
2023-05-12bump rustc (no josh changes)Ralf Jung-1/+1
2023-05-12Auto merge of #109732 - Urgau:uplift_drop_forget_ref_lints, r=davidtwcobors-0/+9
Uplift `clippy::{drop,forget}_{ref,copy}` lints This PR aims at uplifting the `clippy::drop_ref`, `clippy::drop_copy`, `clippy::forget_ref` and `clippy::forget_copy` lints. Those lints are/were declared in the correctness category of clippy because they lint on useless and most probably is not what the developer wanted. ## `drop_ref` and `forget_ref` The `drop_ref` and `forget_ref` lint checks for calls to `std::mem::drop` or `std::mem::forget` with a reference instead of an owned value. ### Example ```rust let mut lock_guard = mutex.lock(); std::mem::drop(&lock_guard) // Should have been drop(lock_guard), mutex // still locked operation_that_requires_mutex_to_be_unlocked(); ``` ### Explanation Calling `drop` or `forget` on a reference will only drop the reference itself, which is a no-op. It will not call the `drop` or `forget` method on the underlying referenced value, which is likely what was intended. ## `drop_copy` and `forget_copy` The `drop_copy` and `forget_copy` lint checks for calls to `std::mem::forget` or `std::mem::drop` with a value that derives the Copy trait. ### Example ```rust let x: i32 = 42; // i32 implements Copy std::mem::forget(x) // A copy of x is passed to the function, leaving the // original unaffected ``` ### Explanation Calling `std::mem::forget` [does nothing for types that implement Copy](https://doc.rust-lang.org/std/mem/fn.drop.html) since the value will be copied and moved into the function on invocation. ----- Followed the instructions for uplift a clippy describe here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751 cc `@m-ou-se` (as T-libs-api leader because the uplifting was discussed in a recent meeting)
2023-05-12Pass arguments to the interpreted program via `run-dep`Oli Scherer-47/+42
2023-05-12fmtRalf Jung-1/+3
2023-05-12Merge from rustcRalf Jung-37/+24
2023-05-12Preparing for merge from rustcRalf Jung-1/+1
2023-05-11miri: Move patterns for simd testsJubilee Young-35/+17
It isn't clear to me why these error patterns do not trigger, but I am not going to waste time analyzing bugs in compiletest.
2023-05-11Remove a misleading part of a function nameOli Scherer-3/+3
2023-05-11Stop ignoring the `--manifest-path`Oli Scherer-3/+3
2023-05-11Bless miri testsbjorn3-6/+6
2023-05-11Fix review commentsbjorn3-7/+6
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-05-11Improve miri commentsbjorn3-1/+14
2023-05-11Fix fs miri test on AArch64bjorn3-1/+1
2023-05-11Fix allocator shim handling in miribjorn3-31/+32
2023-05-11Add `./miri run-dep` for running a file with test dependencies availableOli Scherer-4/+44
2023-05-11Emit the compiler flags againOli Scherer-0/+2
2023-05-11fix deny_lint testRalf Jung-2/+7
2023-05-10Auto merge of #2879 - saethlin:measureme, r=RalfJungbors-2/+18
Include the current Crate name in the measureme output name See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/measureme.20flamegraph.20panics/near/356367013 cc `@andjo403` Currently, attempting to use `MIRIFLAGS=-Zmiri-measureme=miri cargo miri test` on a crate with multiple test targets (which is very common) will produce a corrupted measureme output file, because the various interpreter processes will stomp each other's output. This change does not entirely prevent this, but the various test targets seem to always have different crate names, so if nothing else this will make the broken measureme files much harder to encounter by accident, while also making it clear what they are all for.
2023-05-10Adjust tests for new drop and forget lintsUrgau-0/+9
2023-05-10Explain the paddingBen Kimock-0/+4