about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-09-01constify impl Try for ControlFlowNathaniel McCallum-2/+4
2025-09-01Consolidate staging of test steps in message groupsJakub Beránek-133/+88
2025-09-01Auto merge of #143290 - azhogin:azhogin/link-pub-async-impls, r=oli-obkbors-15/+245
pub async fn impl is monomorphized when func itself is monomorphized Implentation coroutine (`func::{closure#0}`) is monomorphized, when func itself is monomorphized. Currently, when `pub async fn foo(..)` is exported from lib and used in several dependent crates, only 'header' function is monomorphized in the defining crate. 'header' function, returning coroutine object, is monomorphized, but the coroutine's poll function (which actually implements all the logic for the function) is not. In such situation, `func::{closure#0}` will be monomorphized in every dependency. This PR adds monomorphization for `func::{closure#0}` (coroutine poll function), when func itself is monomorphized. Simple test with one lib async function and ten dependent crates (executable) that use the function, shows 5-7% compilation time improvement (single-threaded).
2025-09-01Merge pull request #2567 from ↵Tshepang Mbambo-9/+9
rust-lang/revert-2556-date-sweep-2025-08-diag-tests Revert "dates: refresh diagnostics/ and tests/ annotated dates to August 2025"
2025-09-01Revert "dates: refresh diagnostics/ and tests/ annotated dates to August 2025"Tshepang Mbambo-9/+9
2025-09-01Merge pull request #2566 from rust-lang/revert-2557-date-sweep-2025-08-infraTshepang Mbambo-12/+12
Revert "dates: refresh infra/tooling date annotations to Aug 2025"
2025-09-01Revert "dates: refresh infra/tooling date annotations to Aug 2025"Tshepang Mbambo-12/+12
2025-09-01Merge pull request #2565 from rust-lang/revert-2558-date-sweep-2025-08-queriesTshepang Mbambo-3/+3
Revert "dates: refresh query-system date annotations to 2025-08 (preserve style)"
2025-09-01Revert "dates: refresh query-system date annotations to 2025-08 (preserve ↵Tshepang Mbambo-3/+3
style)"
2025-09-01Merge pull request #2564 from ↵Tshepang Mbambo-9/+9
rust-lang/revert-2559-date-sweep-2025-08-types-traits Revert "dates: refresh type system & traits date annotations to Aug/2025"
2025-09-01Revert "dates: refresh type system & traits date annotations to Aug/2025"Tshepang Mbambo-9/+9
2025-09-01Auto merge of #146077 - Zalathar:rollup-l7ip5yi, r=Zalatharbors-479/+597
Rollup of 5 pull requests Successful merges: - rust-lang/rust#145468 (dedup recip, powi, to_degrees, and to_radians float tests) - rust-lang/rust#145643 (coverage: Build an "expansion tree" and use it to unexpand raw spans) - rust-lang/rust#145754 (fix(lexer): Don't require frontmatters to be escaped with indented fences) - rust-lang/rust#146060 (fixup nix dev shell again) - rust-lang/rust#146068 (compiletest: Capture panic messages via a custom panic hook) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-01Rollup merge of #146068 - Zalathar:panic-hook, r=jieyouxuStuart Cook-0/+152
compiletest: Capture panic messages via a custom panic hook Currently, output-capture of panic messages relies on special cooperation between `#![feature(internal_output_capture)]` and the default panic hook. That's a problem if we want to perform our own output capture, because the default panic hook won't know about our custom output-capture mechanism. We can work around that by installing a custom panic hook that prints equivalent panic messages to a buffer instead. The custom hook is always installed, but delegates to the default panic hook unless a panic-capture buffer has been installed on the current thread. A panic-capture buffer is only installed on compiletest test threads (by the executor), and only if output-capture is enabled. --- Right now this PR doesn't provide any particular concrete benefits. But it will be essential as part of further efforts to replace compiletest's use of `#![feature(internal_output_capture)]` with our own output-capture mechanism. r? jieyouxu
2025-09-01Rollup merge of #146060 - WaffleLapkin:fixup-nix-dev-shell-again, r=NoratriebStuart Cook-0/+3
fixup nix dev shell again r? Noratrieb
2025-09-01Rollup merge of #145754 - epage:escape, r=SparrowLiiStuart Cook-74/+51
fix(lexer): Don't require frontmatters to be escaped with indented fences The RFC only limits hyphens at the beginning of lines and not if they are indented or embedded in other content. Sticking to that approach was confirmed by the T-lang liason at https://github.com/rust-lang/rust/issues/141367#issuecomment-3202217544 There is a regression in error message quality which I'm leaving for someone if they feel this needs improving. Tracking issue: rust-lang/rust#136889 Fixes rust-lang/rust#141367
2025-09-01Rollup merge of #145643 - Zalathar:tree, r=SparrowLiiStuart Cook-162/+286
coverage: Build an "expansion tree" and use it to unexpand raw spans Historically and currently, coverage instrumentation assumes that all of a function's spans are in the same file and have the same syntax context. The spans extracted directly from MIR don't satisfy that assumption, so there is an “unexpansion” step that walks up each span's expansion-call-site tree to find a suitable span in the same context as the function's body span. (That unexpansion step is what allows us to have somewhat reasonable coverage instrumentation for macros like `println!`, and for syntax like `for` and `?` that undergo desugaring expansion.) The current unexpansion code mostly works fine in that “flat” single-file single-context world. But it's not suitable for incremental work towards proper expansion-aware coverage instrumentation, which would allow a function's coverage spans to encompass multiple expansion contexts and multiple files. This PR therefore replaces the current unexpansion code with a more sophisticated system that uses the raw MIR spans to reconstruct an “expansion tree”, and then uses that tree to help perform most of the unexpansion work. Building the tree is “overkill” for current unexpansion needs (though it does give some minor edge-case improvements), but my hope is that having the explicit tree available will be a big help when taking the next steps towards proper expansion-region support.
2025-09-01Rollup merge of #145468 - karolzwolak:float-tests-dedup, r=tgross35Stuart Cook-243/+105
dedup recip, powi, to_degrees, and to_radians float tests Deduplicates recip, powi, to_degrees, and to_radians float tests. I had to fiddle and slightly increase the tolerances for a few comparisons, so maybe not all of the tests are worth deduplicating. Part of rust-lang/rust#141726. Best reviewed commit-by-commit. r? `@tgross35`
2025-09-01Merge pull request #4554 from RalfJung/helpRalf Jung-12/+27
improve output for 'cargo miri test --help'
2025-09-01Do not run `lint-docs` tests in stage 1 `x test` by defaultJakub Beránek-8/+11
2025-09-01Remove `Compiler::with_stage`Jakub Beránek-6/+1
2025-09-01Rename `compiler` to `test_compiler`Jakub Beránek-47/+54
2025-09-01Add some compiletest suites snapshot testsJakub Beránek-35/+133
2025-09-01Remove outdated commentJakub Beránek-3/+0
2025-09-01improve output for 'cargo miri test --help'Ralf Jung-12/+27
2025-09-01pub async fn implementation coroutine (func::{closure#0}) is monomorphized, ↵Andrew Zhogin-15/+245
when func itself is monomorphized
2025-09-01Add compiler error when trying to use concat metavar expr in repetitionsjullang-6/+35
Replace unimplemented()! with a more helpful compiler error.
2025-09-01Merge pull request #4553 from rust-lang/rustup-2025-09-01Ralf Jung-982/+2677
Automatic Rustup
2025-09-01Merge ref '828e45ad11ce' from rust-lang/rustThe Miri Cronjob Bot-981/+2676
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 828e45ad11ce4ab56dd64e93f1fb5dd8f0c0ae93 Filtered ref: 10ab51e1b1b8eadb430163bd78ef39c0721cfbf8 This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-01Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to 828e45ad11ce4ab56dd64e93f1fb5dd8f0c0ae93.
2025-09-01Auto merge of #146072 - Zalathar:rollup-0svnrfe, r=Zalatharbors-591/+691
Rollup of 6 pull requests Successful merges: - rust-lang/rust#145421 (`dump_mir` cleanups) - rust-lang/rust#145968 (Add `Bound::copied`) - rust-lang/rust#146004 (resolve: Refactor `struct ExternPreludeEntry`) - rust-lang/rust#146042 (Detect negative literal inferred to unsigned integer) - rust-lang/rust#146046 (Suggest method name with maybe ty mismatch) - rust-lang/rust#146051 (Change std f32 test to pass under Miri) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-01Capture panic messages via a custom panic hookZalathar-0/+152
2025-09-01Rollup merge of #146051 - LorrensP-2158466:miri-libstd-fix, r=RalfJungStuart Cook-2/+2
Change std f32 test to pass under Miri Adds `APPROX_DELTA` to 2 tests of `f32::log` reported in [#miri > Miri test-libstd Failure (2025-08)](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/Miri.20test-libstd.20Failure.20.282025-08.29). I changed 2 lines, the first one is the actual failure. The second one is precautionary.
2025-09-01Rollup merge of #146046 - ↵Stuart Cook-1/+39
chenyukang:yukang-fix-method-exists-for-ret-ty-error, r=estebank Suggest method name with maybe ty mismatch Fixes rust-lang/rust#146008 I think it's ok to suggest method name even when the return ty mismatch, since we only reporting in `Applicability::MaybeIncorrect`, user may add `()` and continue to fix following errors. r? ```@estebank```
2025-09-01Rollup merge of #146042 - estebank:issue-83413, r=lcnrStuart Cook-27/+103
Detect negative literal inferred to unsigned integer ``` error[E0277]: the trait bound `usize: Neg` is not satisfied --> $DIR/negative-literal-infered-to-unsigned.rs:2:14 | LL | for x in -5..5 { | ^^ the trait `Neg` is not implemented for `usize` | help: consider specifying an integer type that can be negative | LL | for x in -5isize..5 { | +++++ ``` Applying this suggestion will always end up in another E0308 error at the point where the unsigned inference comes from, which should help with understanding what the actual problem is. Fix rust-lang/rust#83413.
2025-09-01Rollup merge of #146004 - petrochenkov:epentry, r=nnethercoteStuart Cook-53/+56
resolve: Refactor `struct ExternPreludeEntry` Avoid impossible combinations of fields and apply the first part of https://github.com/rust-lang/rust/pull/144737 (do not resolve erroneous entries repeatedly, keep them as `PendingBinding::Ready(None)` instead).
2025-09-01Rollup merge of #145968 - connortsui20:bound-copied, r=joboetStuart Cook-2/+30
Add `Bound::copied` Tracking Issue: https://github.com/rust-lang/rust/issues/145966 Some questions: - [x] Should I update the documentation for `cloned` to actual used a `Clone` type instead of an integer? - [x] I removed the `must_use` since this is a cheap copy, does that make sense?
2025-09-01Rollup merge of #145421 - nnethercote:dump_mir-cleanups, r=davidtwcoStuart Cook-506/+461
`dump_mir` cleanups I found this code hard to read, so I cleaned it up. Details in individual commits. r? ``@davidtwco``
2025-08-31rustdoc-search: skip loading unneeded fnDataMichael Howell-12/+13
2025-09-01Auto merge of #145663 - Kobzol:bootstrap-test, r=jieyouxubors-384/+760
Enforce in bootstrap that test must have stage at least 1 (except for compiletest) This PR cleans up a bunch of test steps and adds metadata to them. I didn't yet touch the most complicated step (`CompileTest`), I'm leaving that for another PR. Testing anything on stage 0 is only possible for compiletest and with `build.allow-compiletest-stage0`. Testing anything else on stage 0 will either produce a nice error or crash with a stage being subtracted below zero. r? `@jieyouxu` try-job: dist-x86_64-linux try-job: aarch64-gnu try-job: arm-android try-job: `x86_64-gnu-llvm-20*` try-job: `x86_64-msvc-*` try-job: aarch64-apple try-job: test-various
2025-09-01Introduce `MirDumper` and `MirWriter`.Nicholas Nethercote-276/+275
MIR dumping is a mess. There are lots of functions and entry points, e.g. `dump_mir`, `dump_mir_with_options`, `dump_polonius_mir`, `dump_mir_to_writer`. Also, it's crucial that `create_dump_file` is never called without `dump_enabled` first being checked, but there is no mechanism for ensuring this and it's hard to tell if it is satisfied on all paths. (`dump_enabled` is checked twice on some paths, however!) This commit introduces `MirWriter`, which controls the MIR writing, and encapsulates the `extra_data` closure and `options`. Two existing functions are now methods of this type. It sets reasonable defaults, allowing the removal of many `|_, _| Ok(())` closures. The commit also introduces `MirDumper`, which is layered on top of `MirWriter`, and which manages the creation of the dump files, encapsulating pass names, disambiguators, etc. Four existing functions are now methods of this type. - `MirDumper::new` will only succeed if dumps are enabled, and will return `None` otherwise, which makes it impossible to dump when you shouldn't. - It also sets reasonable defaults for various things like disambiguators, which means you no longer need to specify them in many cases. When they do need to be specified, it's now done via setter methods. - It avoids some repetition. E.g. `dump_nll_mir` previously specifed the pass name `"nll"` four times and the disambiguator `&0` three times; now it specifies them just once, to put them in the `MirDumper`. - For Polonius, the `extra_data` closure can now be specified earlier, which avoids having to pass some arguments through some functions.
2025-09-01Indent some functions.Nicholas Nethercote-322/+322
This commit exists purely to simplify reviewing: these functions will become methods in the next commit. This commit indents them so that the next commit is more readable.
2025-09-01Use trait object references for closures.Nicholas Nethercote-59/+39
The dynamic dispatch cost doesn't matter for MIR dumping, which is perf-insensitive. And it's necessary for the next commit, which will store some `extra_data` closures in a struct.
2025-09-01Avoid unnecessary `mut`-ness for various closures.Nicholas Nethercote-16/+16
2025-09-01Inline and remove `dump_mir_for_pass`.Nicholas Nethercote-16/+6
The code is more readable without it.
2025-09-01Inline and remove `dump_matched_mir_node`.Nicholas Nethercote-25/+11
It has a single call site.
2025-08-31Split `ObligationCauseCode::BinOp` for unops to `UnOp`Esteban Küber-28/+27
2025-08-31Ignore test when dylibs are not supportedbjorn3-0/+1
2025-08-31Auto merge of #146038 - notriddle:polarity, r=GuillaumeGomezbors-72/+267
rustdoc-search: split function inverted index by input/output Fixes rust-lang/rust#146015 With a patch applied to count the number of unifications, and running the query `Option<T>, (T -> U) -> Option<U>` before: performed unifyFunctionType on 17484 functions after: performed unifyFunctionType on 3055 functions preview: https://notriddle.com/rustdoc-html-demo-12/polarity/doc/std/index.html https://notriddle.com/rustdoc-html-demo-12/polarity/compiler-doc/rustc_hir/index.html
2025-08-31fix: `assertions_on_result_states` avoid changing return type in more cases ↵Samuel Tardieu-16/+43
(#15591) Fixes https://github.com/rust-lang/rust-clippy/issues/9916 changelog: [`assertions_on_result_states`]: avoid changing return type in more cases
2025-08-31Merge pull request #4466 from nia-e/native-structsRalf Jung-133/+454
native-lib: allow passing structs as arguments