about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2025-01-30Auto merge of #136035 - SpecificProtagonist:miri-zeroed-alloc, r=oli-obkbors-49/+29
miri: optimize zeroed alloc When allocating zero-initialized memory in MIR interpretation, rustc allocates zeroed memory, marks it as initialized and then re-zeroes it. Remove the last step. I don't expect this to have much of an effect on performance normally, but in my case in which I'm creating a large allocation via mmap it gets in the way.
2025-01-29Rollup merge of #136147 - RalfJung:required-target-features-check-not-add, ↵León Orell Valerian Liehr-2/+2
r=workingjubilee ABI-required target features: warn when they are missing in base CPU Part of https://github.com/rust-lang/rust/pull/135408: instead of adding ABI-required features to the target we build for LLVM, check that they are already there. Crucially we check this after applying `-Ctarget-cpu` and `-Ctarget-feature`, by reading `sess.unstable_target_features`. This means we can tweak the ABI target feature check without changing the behavior for any existing user; they will get warnings but the target features behave as before. The test changes here show that we are un-doing the "add all required target features" part. Without the full #135408, there is no way to take a way an ABI-required target feature with `-Ctarget-cpu`, so we cannot yet test that part. Cc ``@workingjubilee``
2025-01-28Rollup merge of #135748 - compiler-errors:len-2, r=RalfJung,oli-obkMatthias Krüger-0/+35
Lower index bounds checking to `PtrMetadata`, this time with the right fake borrow semantics 😸 Change `Rvalue::RawRef` to take a `RawRefKind` instead of just a `Mutability`. Then introduce `RawRefKind::FakeForPtrMetadata` and use that for lowering index bounds checking to a `PtrMetadata`. This new `RawRefKind::FakeForPtrMetadata` acts like a shallow fake borrow in borrowck, which mimics the semantics of the old `Rvalue::Len` operation we're replacing. We can then use this `RawRefKind` instead of using a span desugaring hack in CTFE. cc ``@scottmcm`` ``@RalfJung``
2025-01-28miri: optimize zeroed allocSpecificProtagonist-49/+29
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-01-28ABI-required target features: warn when they are missing in base CPU (rather ↵Ralf Jung-2/+2
than silently enabling them)
2025-01-28Represent the raw pointer for a array length check as a new kind of fake borrowMichael Goulet-0/+35
2025-01-26Merge pull request #4154 from RalfJung/linux-futexRalf Jung-3/+2
make linux-futex test less flaky
2025-01-26make linux-futex test less flakyRalf Jung-3/+2
2025-01-26Pre-intern name when searching module childrenMark Rousskov-1/+2
This avoids a good deal of work, since each module child can now just be compared via u32 comparison, rather than fetching the raw &str (requiring locking and indexing into the interner) and then comparing the two strings (also relatively expensive).
2025-01-26many-seeds: do not use more than 8 threadsRalf Jung-4/+3
2025-01-26many-seeds: in keep-going mode, print how many tests failedRalf Jung-2/+8
2025-01-26prevent weird macOS linker errors from breaking the buildRalf Jung-1/+3
2025-01-26Merge from rustcThe Miri Cronjob Bot-3/+5
2025-01-26Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-01-25Auto merge of #133154 - estebank:issue-133137, r=wesleywiserbors-3/+5
Reword resolve errors caused by likely missing crate in dep tree Reword label and add `help`: ``` error[E0432]: unresolved import `some_novel_crate` --> f704.rs:1:5 | 1 | use some_novel_crate::Type; | ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `some_novel_crate` | = help: if you wanted to use a crate named `some_novel_crate`, use `cargo add some_novel_crate` to add it to your `Cargo.toml` ``` Fix #133137.
2025-01-25Merge from rustcThe Miri Cronjob Bot-2/+2
2025-01-25Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-01-24Rollup merge of #135976 - WaffleLapkin:tailcall-nodrop, r=oli-obkMatthias Krüger-2/+2
Don't drop types with no drop glue when building drops for tailcalls this is required as otherwise drops of `&mut` refs count as a usage of a 'two-phase temporary' causing an ICE. fixes #128097 The underlying issue is that the current code generates drops for `&mut` which are later counted as a second use of a two-phase temporary: `bat t.rs -p` ```rust #![expect(incomplete_features)] #![feature(explicit_tail_calls)] fn f(x: &mut ()) { let _y = String::new(); become f(x); } fn main() {} ``` `rustc t.rs -Zdump_mir=f` ```text error: internal compiler error: compiler/rustc_borrowck/src/borrow_set.rs:298:17: found two uses for 2-phase borrow temporary _4: bb2[1] and bb3[0] --> t.rs:6:5 | 6 | become f(x); | ^^^^^^^^^^^ thread 'rustc' panicked at compiler/rustc_borrowck/src/borrow_set.rs:298:17: Box<dyn Any> stack backtrace: [REDACTED] error: aborting due to 1 previous error ``` `bat ./mir_dump/t.f.-------.renumber.0.mir -p -lrust` ```rust // MIR for `f` 0 renumber fn f(_1: &mut ()) -> () { debug x => _1; let mut _0: (); let mut _2: !; let _3: std::string::String; let mut _4: &mut (); scope 1 { debug _y => _3; } bb0: { StorageLive(_3); _3 = String::new() -> [return: bb1, unwind: bb4]; } bb1: { FakeRead(ForLet(None), _3); StorageLive(_4); _4 = &mut (*_1); drop(_3) -> [return: bb2, unwind: bb3]; } bb2: { StorageDead(_3); tailcall f(Spanned { node: move _4, span: t.rs:6:14: 6:15 (#0) }); } bb3 (cleanup): { drop(_4) -> [return: bb4, unwind terminate(cleanup)]; } bb4 (cleanup): { resume; } } ``` Note how `_4 is moved into the tail call in `bb2` and dropped in `bb3`. This PR adds a check that the locals we drop need dropping. r? `@oli-obk` (feel free to reassign, I'm not sure who would be a good reviewer, but thought you might have an idea) cc `@beepster4096,` since you wrote the original drop implementation.
2025-01-24bless miri testWaffle Lapkin-2/+2
I'm not sure why the span improved but that's nice!
2025-01-24fmtThe Miri Cronjob Bot-1/+1
2025-01-24Merge from rustcThe Miri Cronjob Bot-19/+6
2025-01-24Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-01-24Reword "crate not found" resolve messageEsteban Küber-3/+5
``` error[E0432]: unresolved import `some_novel_crate` --> file.rs:1:5 | 1 | use some_novel_crate::Type; | ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `some_novel_crate` ``` On resolve errors where there might be a missing crate, mention `cargo add foo`: ``` error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope` --> $DIR/conflicting-impl-with-err.rs:4:11 | LL | impl From<nope::Thing> for Error { | ^^^^ use of unresolved module or unlinked crate `nope` | = help: if you wanted to use a crate named `nope`, use `cargo add nope` to add it to your `Cargo.toml` ```
2025-01-23Remove RunCompilerbjorn3-1/+1
It has become nothing other than a wrapper around run_compiler.
2025-01-23Remove the need to manually call set_using_internal_featuresbjorn3-19/+6
2025-01-22fix no-std-smoke testRalf Jung-0/+1
2025-01-23fmtThe Miri Cronjob Bot-4/+2
2025-01-23Merge from rustcThe Miri Cronjob Bot-161/+113
2025-01-23Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-01-21Auto merge of #134299 - RalfJung:remove-start, r=compiler-errorsbors-76/+53
remove support for the (unstable) #[start] attribute As explained by `@Noratrieb:` `#[start]` should be deleted. It's nothing but an accidentally leaked implementation detail that's a not very useful mix between "portable" entrypoint logic and bad abstraction. I think the way the stable user-facing entrypoint should work (and works today on stable) is pretty simple: - `std`-using cross-platform programs should use `fn main()`. the compiler, together with `std`, will then ensure that code ends up at `main` (by having a platform-specific entrypoint that gets directed through `lang_start` in `std` to `main` - but that's just an implementation detail) - `no_std` platform-specific programs should use `#![no_main]` and define their own platform-specific entrypoint symbol with `#[no_mangle]`, like `main`, `_start`, `WinMain` or `my_embedded_platform_wants_to_start_here`. most of them only support a single platform anyways, and need cfg for the different platform's ways of passing arguments or other things *anyways* `#[start]` is in a super weird position of being neither of those two. It tries to pretend that it's cross-platform, but its signature is a total lie. Those arguments are just stubbed out to zero on ~~Windows~~ wasm, for example. It also only handles the platform-specific entrypoints for a few platforms that are supported by `std`, like Windows or Unix-likes. `my_embedded_platform_wants_to_start_here` can't use it, and neither could a libc-less Linux program. So we have an attribute that only works in some cases anyways, that has a signature that's a total lie (and a signature that, as I might want to add, has changed recently, and that I definitely would not be comfortable giving *any* stability guarantees on), and where there's a pretty easy way to get things working without it in the first place. Note that this feature has **not** been RFCed in the first place. *This comment was posted [in May](https://github.com/rust-lang/rust/issues/29633#issuecomment-2088596042) and so far nobody spoke up in that issue with a usecase that would require keeping the attribute.* Closes https://github.com/rust-lang/rust/issues/29633 try-job: x86_64-gnu-nopt try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: test-various
2025-01-21remove support for the #[start] attributeRalf Jung-76/+53
2025-01-20Rollup merge of #135333 - vayunbiyani:test-environment, r=RalfJungMatthias Krüger-85/+60
Partial progress on #132735: Replace extern "rust-intrinsic" with #[rustc_intrinsic] across the codebase Part of #132735: Replace `extern "rust-intrinsic"` with `#[rustc_intrinsic]` macro - Updated all instances of `extern "rust-intrinsic"` to use the `#[rustc_intrinsic]` macro. - Skipped `.md` files and test files to avoid unnecessary changes.
2025-01-20Updated several files to use rust intrinsic macros instead of the legacy ↵vayunbiyani-85/+60
extern "rust-intrinsic" blocks
2025-01-19fix location of pipe moduleRalf Jung-2/+3
2025-01-19Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-01-15Merge from rustcThe Miri Cronjob Bot-6/+6
2025-01-15Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-01-14Merge pull request #4138 from geetanshjuneja/derefRalf Jung-1/+1
Use deref_poiner_as instead of deref_pointer
2025-01-13Included Abdroid to an epoll test targetsYoh Deadfall-1/+1
2025-01-13Illumos: Added epoll and eventfdYoh Deadfall-8/+41
2025-01-13Added deref_poiner_as in _NSGetExecutablePathgeetanshjuneja-1/+1
2025-01-12Added Android to epoll and eventfd test targetsYoh Deadfall-3/+3
2025-01-12Merge pull request #4135 from RalfJung/unsup-targetsRalf Jung-166/+185
Add FreeBSD maintainer; test all of Solarish
2025-01-12turns out Solarish targets support our entire test suiteRalf Jung-10/+16
2025-01-12remove a rustfmt::skipRalf Jung-155/+168
2025-01-12record YohDeadfall as FreeBSD maintainerRalf Jung-1/+1
2025-01-11Merge pull request #4134 from RalfJung/miri-script-raOli Scherer-9/+15
adjust the way we build miri-script in RA, to fix proc-macros
2025-01-11avoid issues due to MIRI_TEST_TARGET being set from the outsideRalf Jung-0/+4
2025-01-11adjust the way we build miri-script in RA, to fix proc-macrosRalf Jung-9/+11
2025-01-11Supported fioclex for ioctl on macosgeetanshjuneja-0/+70