about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-06Rollup merge of #140673 - GuillaumeGomez:clean-rustdoc-tests, r=notriddleStuart Cook-0/+48
Clean rustdoc tests folder We were starting to have way too many tests in the `tests/rustdoc/` folder so I moved some of them in sub-folders. We now have less than 300 tests at the "top level" so I guess it's good enough for now. So this PR just moves tests in sub-folders and that's pretty much it. :smiley: r? ``@notriddle``
2025-05-06Rollup merge of #140634 - smrobtzz:mips-elf-fixes, r=workingjubileeStuart Cook-27/+66
Use more accurate ELF flags on MIPS Changes the MIPS ELF flags used for metadata objects to be closer to what LLVM uses so the linker doesn't complain
2025-05-06Rollup merge of #140598 - ShE3py:iter-misc-docs, r=workingjubileeStuart Cook-0/+3
Steer docs to `utf8_chunks` and `Iterator::take` - Adds `limit` as an alias of `take` (as this is [what Java calls this operation](https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#limit-long-)); - Says that [`Utf8Chunks`](https://doc.rust-lang.org/std/str/struct.Utf8Chunks.html) comes from [`[u8]::utf8_chunks`](https://doc.rust-lang.org/std/primitive.slice.html#method.utf8_chunks). ``@rustbot`` label +A-docs
2025-05-06Rollup merge of #140532 - celinval:chores-smir-ra, r=oli-obkStuart Cook-3/+13
Fix RustAnalyzer discovery of rustc's `stable_mir` crate This fixes issues with RustAnalyzer not finding `stable_mir` crate since RA discovery traverses the dependency graph of `rustc_driver` crate. This change also aligns with the long term architecture plan for these crates, since we are moving towards having stable_mir depend on rustc_smir and not the other way around. See [this doc](https://hackmd.io/jBRkZLqAQL2EVgwIIeNMHg) for more details. I believe a similar function will come handy eventually for `stable_mir` users, but I'm keeping it as part of `rustc_internal` since its current format initializes the StableMir context and requires `TyCtxt`. Finally, I added the `rustc_internal` module re-export under a feature since the APIs from this module shall not be stabilized.
2025-05-06Rollup merge of #140393 - joboet:sys_common_process, r=thomccStuart Cook-136/+176
std: get rid of `sys_common::process` Move the public `CommandEnvs` into the `process` module (and make it a wrapper type for an internal iterator type) and everything else into `sys::process` as per #117276. Something went wrong with a force push, so I can't reopen #139020. This is unchanged from that PR, apart from a rebase. r? ```@thomcc```
2025-05-06Rollup merge of #140251 - Zalathar:coverage-dump-path, r=clubby789Stuart Cook-410/+684
coverage-dump: Resolve global file IDs to filenames The coverage-dump tool, used by coverage tests, currently includes “global file ID” numbers in its dump output. This PR adds support for parsing coverage filename information from LLVM assembly `.ll` files, and resolving those file IDs to the corresponding filename, for inclusion in dump output. This makes dump output more informative, especially for test cases involving multiple files, and will be important for testing expansion region support in the future. --- The bootstrap changes don't necessarily have to land at the same time (e.g. they could be deferred to after the stage0 redesign if requested), but I would prefer to land them now if possible.
2025-05-06Rollup merge of #140035 - fee1-dead-contrib:push-oszwkkvmpkks, ↵Stuart Cook-22/+970
r=jieyouxu,wesleywiser Implement RFC 3503: frontmatters Tracking issue: #136889 Supercedes #137193. This implements [RFC 3503](https://github.com/rust-lang/rfcs/blob/master/text/3503-frontmatter.md). This might break rust-analyzer. Will look into how to fix that. Suggestions welcome for how to improve diagnostics.
2025-05-06Rollup merge of #139773 - thaliaarchi:vec-into-iter-last, r=workingjubileeStuart Cook-9/+53
Implement `Iterator::last` for `vec::IntoIter` Avoid iterating everything when we have random access to the last element.
2025-05-06Rollup merge of #139764 - dtolnay:extractif, r=AmanieuStuart Cook-40/+49
Consistent trait bounds for ExtractIf Debug impls Closes #137654. Refer to that issue for a table of the **4** different impl signatures we previously had in the standard library for Debug impls of various ExtractIf iterator types. The one we are standardizing on is the one so far only used by `alloc::collections::linked_list::ExtractIf`, which is _no_ `F: Debug` bound, _no_ `F: FnMut` bound, only `T: Debug` bound. This PR applies the following signature changes: ```diff /* alloc::collections::btree_map */ pub struct ExtractIf<'a, K, V, F, A = Global> where - F: 'a + FnMut(&K, &mut V) -> bool, Allocator + Clone, impl Debug for ExtractIf<'a, K, V, F, + A, > where K: Debug, V: Debug, - F: FnMut(&K, &mut V) -> bool, + A: Allocator + Clone, ``` ```diff /* alloc::collections::btree_set */ pub struct ExtractIf<'a, T, F, A = Global> where - T: 'a, - F: 'a + FnMut(&T) -> bool, Allocator + Clone, impl Debug for ExtractIf<'a, T, F, A> where T: Debug, - F: FnMut(&T) -> bool, A: Allocator + Clone, ``` ```diff /* alloc::collections::linked_list */ impl Debug for ExtractIf<'a, T, F, + A, > where T: Debug, + A: Allocator, ``` ```diff /* alloc::vec */ impl Debug for ExtractIf<'a, T, F, A> where T: Debug, - F: Debug, A: Allocator, - A: Debug, ``` ```diff /* std::collections::hash_map */ pub struct ExtractIf<'a, K, V, F> where - F: FnMut(&K, &mut V) -> bool, impl Debug for ExtractIf<'a, K, V, F> where + K: Debug, + V: Debug, - F: FnMut(&K, &mut V) -> bool, ``` ```diff /* std::collections::hash_set */ pub struct ExtractIf<'a, T, F> where - F: FnMut(&T) -> bool, impl Debug for ExtractIf<'a, T, F> where + T: Debug, - F: FnMut(&T) -> bool, ``` I have made the following changes to bring these types into better alignment with one another. - Delete `F: Debug` bounds. These are especially problematic because Rust closures do not come with a Debug impl, rendering the impl useless. - Delete `A: Debug` bounds. Allocator parameters are unstable for now, but in the future this would become an API commitment that we do not debug-print a representation of the allocator when printing an iterator. - Delete `F: FnMut` bounds. Requires `hashbrown` PR: https://github.com/rust-lang/hashbrown/pull/616. **API commitment:** we commit to not doing RefCell voodoo inside ExtractIf to have some way for its Debug impl (which takes &amp;self) to call a FnMut closure, if this is even possible. - Add `T: Debug` bounds (or `K`/`V`), even on Debug impls that do not currently make use of them, but might in the future. **Breaking change.** Must backport into Rust 1.87 (current beta) or do a de-stabilization PR in beta to delay those types by one release. - Render using `debug_struct` + `finish_non_exhaustive`, instead of `debug_tuple`. - Do not render the _entire_ underlying collection. - Show a "peek" field indicating the current position of the iterator.
2025-05-06Rollup merge of #139550 - Urgau:rmeta-remap-path-scope, r=nnethercoteStuart Cook-64/+205
Fix `-Zremap-path-scope` rmeta handling This PR fixes the conditional remapping (`-Zremap-path-scope`) of rmeta file paths ~~by using the `debuginfo` scope~~ by conditionally embedding the local path in addition to the remapped path. Fixes https://github.com/rust-lang/rust/issues/139217
2025-05-05Consistent trait bounds for ExtractIf Debug implsDavid Tolnay-40/+49
2025-05-06coverage-dump: Dump filenames instead of global file IDs (and bless)Zalathar-308/+307
2025-05-06coverage-dump: Make filenames available to covfun record dumpingZalathar-3/+87
Actually printing the filenames is deferred to a subsequent commit that will simultaneously bless all affected tests.
2025-05-06coverage-dump: Include filenames hash in covfun line dataZalathar-26/+102
2025-05-06coverage-dump: Extract a common parser method for maybe-compressed bytesZalathar-23/+41
2025-05-06coverage-dump: Extract some common code to an `llvm_utils` submoduleZalathar-48/+51
2025-05-06bootstrap: Add check/test/run steps for src/tools/coverage-dumpZalathar-4/+98
This also causes the coverage-dump unit tests to run in CI and `./x test` by default.
2025-05-06Auto merge of #131160 - ↵bors-60/+54
ismailarilik:handle-potential-query-instability-lint-for-rustc-middle, r=oli-obk Handle `rustc_middle` cases of `rustc::potential_query_instability` lint This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_middle/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/lib.rs#L29) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors. A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447 r? `@compiler-errors`
2025-05-05Auto merge of #140682 - GuillaumeGomez:rollup-6xjf6zn, r=GuillaumeGomezbors-278/+518
Rollup of 11 pull requests Successful merges: - #140080 (mir-opt: Use one MirPatch in MatchBranchSimplification) - #140115 (mir-opt: execute MatchBranchSimplification after GVN) - #140357 (bypass linker configuration and cross target check on `x check`) - #140374 (Resolve instance for SymFn in global/naked asm) - #140559 (Removing rustc_type_ir in the rustc_infer codebase) - #140605 (`fn check_opaque_type_parameter_valid` defer error) - #140636 (implement `PanicTracker` to track `t` panics) - #140661 (Make `-Zfixed-x18` into a target modifier) - #140670 (calculate step duration in a panic-safe way) - #140672 (Deeply normalize in the new solver in WF) - #140676 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-05Rollup merge of #140676 - rustbot:docs-update, r=ehussGuillaume Gomez-0/+0
Update books ## rust-lang/reference 9 commits in 3bf3402aea982b876eb56c87da17b0685c6461d5..387392674d74656f7cb437c05a96f0c52ea8e601 2025-05-03 21:29:09 UTC to 2025-04-22 15:25:03 UTC - Document `let_chains` again (rust-lang/reference#1740) - Add: orphan rule rationale. (rust-lang/reference#1755) - Remove apologies about the Reference (rust-lang/reference#1792) - Clean up some inline assembly examples (rust-lang/reference#1804) - Remove StructExprTuple and StructExprUnit (rust-lang/reference#1803) - Improve documentation of struct expressions (rust-lang/reference#1799) - Clarify interaction of asm-goto with IBT (rust-lang/reference#1790) - naked functions (rust-lang/reference#1689) - Relabel grammarRailroad-Button (rust-lang/reference#1798) ## rust-lang/rust-by-example 3 commits in 0d7964d5b22cf920237ef1282d869564b4883b88..8a8918c698534547fa8a1a693cb3e7277f0bfb2f 2025-04-30 12:20:49 UTC to 2025-04-22 17:42:30 UTC - The example is not meant to be compiled. Changed the code block ann… (rust-lang/rust-by-example#1926) - Non-tail recursive call note in testcase_linked_list.md (rust-lang/rust-by-example#1924) - docs: mark illustrative 'static lifetime example with `ignore` (rust-lang/rust-by-example#1923)
2025-05-05Rollup merge of #140672 - compiler-errors:deeply-normalize, r=lcnrGuillaume Gomez-64/+137
Deeply normalize in the new solver in WF We need to deeply normalize types we check for well-formedness, since we only collect implied bounds from normalized signature types. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/194 r? lcnr
2025-05-05Rollup merge of #140670 - onur-ozkan:129959, r=KobzolGuillaume Gomez-1/+1
calculate step duration in a panic-safe way obvious/self-explanatory change. Fixes #129959
2025-05-05Rollup merge of #140661 - Darksonn:fixedx18-tm, r=wesleywiserGuillaume Gomez-1/+38
Make `-Zfixed-x18` into a target modifier As part of #136966, the `-Zfixed-x18` flag should be turned into a target modifier. This is a blocker to stabilization of the flag. The flag was originally added in #124655 and the MCP for its addition is [MCP#748](https://github.com/rust-lang/compiler-team/issues/748). On some aarch64 targets, the x18 register is used as a temporary caller-saved register by default. When the `-Zfixed-x18` flag is passed, this is turned off so that the compiler doesn't use the x18 register. This allows end-users to use the x18 register for other purposes. For example, by accessing it with inline asm you can use the register as a very efficient thread-local variable. Another common use-case is to store the stack pointer needed by the shadow-call-stack sanitizer. There are also some aarch64 targets where not using x18 is the default – in those cases the flag is a no-op. Note that this flag does not *on its own* cause an ABI mismatch. What actually causes an ABI mismatch is when you have different compilation units that *disagree* on what it should be used for. But having a CU that uses it and another CU that doesn't normally isn't enough to trigger an ABI problem. However, we still consider the flag to be a target modifier in all cases, since it is assumed that you are passing the flag because you intend to assign some other meaning to the register. Rejecting all flag mismatches even if not all are unsound is consistent with [RFC#3716](https://rust-lang.github.io/rfcs/3716-target-modifiers.html). See the headings "not all mismatches are unsound" and "cases that are not caught" for additional discussion of this. On aarch64 targets where `-Zfixed-x18` is not a no-op, it is an error to pass `-Zsanitizer=shadow-call-stack` without also passing `-Zfixed-x18`.
2025-05-05Rollup merge of #140636 - onur-ozkan:panic-tracker-for-t-macro, r=KobzolGuillaume Gomez-5/+26
implement `PanicTracker` to track `t` panics Trying to understand panics triggered by `t` macro is very exhausting (especially on CI failures) because it doesn't provide any information about where the macro was originally invoked. This change adds that missing information when an inner call inside the `t` macro panics. Resolves #137557
2025-05-05Rollup merge of #140605 - lcnr:defer-opaque-type-error, r=compiler-errorsGuillaume Gomez-35/+61
`fn check_opaque_type_parameter_valid` defer error Will be used in #139587 to silence opaque type errors if there are other borrowck failures. I think it can be merged separately. r? `@compiler-errors`
2025-05-05Rollup merge of #140559 - rperier:type-ir-to-type-middle, r=compiler-errorsGuillaume Gomez-33/+31
Removing rustc_type_ir in the rustc_infer codebase cc #138449 This is a second refactoring of rustc_type_ir to use rustc_middle instead, this time that's for rustc_infer
2025-05-05Rollup merge of #140374 - compiler-errors:global_asm-bug, r=lcnrGuillaume Gomez-31/+109
Resolve instance for SymFn in global/naked asm `Instance::expect_resolve` ensures that we're actually going from trait item -> impl item. Fixes #140373
2025-05-05Rollup merge of #140357 - onur-ozkan:133840, r=clubby789Guillaume Gomez-9/+11
bypass linker configuration and cross target check on `x check` I was going to handle this using the untracked env approach, but I realized it somehow doesn't regress https://github.com/rust-lang/rust/issues/130108 anymore... Anyway, if it works, it works. 😄 No need to dig deeper but my guess is we moved some cache-invalidating env from these functions to others. Fixes https://github.com/rust-lang/rust/issues/133840 try-job: aarch64-apple
2025-05-05Rollup merge of #140115 - dianqk:gvn-matchbr, r=oli-obkGuillaume Gomez-76/+90
mir-opt: execute MatchBranchSimplification after GVN This can provide more opportunities for MatchBranchSimplification. Currently, rustc does not optimize the following code into a single statement at mir-opt, and this PR fixes the first case. ```rust pub fn match1(c: bool, v1: i32, v2: i32) -> i32 { if c { v1 - v2 } else { v1 - v2 } } pub fn match2(c: bool, v1: i32) -> i32 { if c { v1 - 1 } else { v1 - 1 } } ``` https://rust.godbolt.org/z/Y8xPMjrfM r? mir-opt
2025-05-05Rollup merge of #140080 - dianqk:one-mirpatch, r=oli-obkGuillaume Gomez-23/+14
mir-opt: Use one MirPatch in MatchBranchSimplification
2025-05-05Auto merge of #140664 - RalfJung:miri-sync, r=RalfJungbors-1541/+1796
Miri subtree update r? `@ghost`
2025-05-05Take into-account `-Zremap-path-scope` when embedding filenamesUrgau-64/+205
2025-05-05Update booksrustbot-0/+0
2025-05-05Apply suggestions from code reviewsmrobtzz-1/+17
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-05-05Use more accurate ELF flags on MIPSSam Roberts-27/+50
2025-05-05Deeply normalize in the new solver in WFMichael Goulet-64/+137
2025-05-05Created `tests/rustdoc/async` subfolder to limit number of files at the top ↵Guillaume Gomez-0/+0
level
2025-05-05Created `tests/rustdoc/extern` subfolder to limit number of files at the top ↵Guillaume Gomez-0/+6
level
2025-05-05Move primitive rustdoc tests into the `primitive` sub folderGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/enum` subfolder to limit number of files at the top levelGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/assoc` subfolder to limit number of files at the top ↵Guillaume Gomez-0/+0
level
2025-05-05Created `tests/rustdoc/impl` subfolder to limit number of files at the top levelGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/doc-cfg` subfolder to limit number of files at the ↵Guillaume Gomez-0/+0
top level
2025-05-05Created `tests/rustdoc/macro` subfolder to limit number of files at the top ↵Guillaume Gomez-0/+20
level
2025-05-05Created `tests/rustdoc/private` subfolder to limit number of files at the ↵Guillaume Gomez-0/+0
top level
2025-05-05Move intra-doc tests into the expected subfolderGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/jump-to-def` subfolder to limit number of files at ↵Guillaume Gomez-0/+0
the top level
2025-05-05Created `tests/rustdoc/auto` subfolder to limit number of files at the top levelGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/anchors` subfolder to limit number of files at the ↵Guillaume Gomez-0/+0
top level
2025-05-05Created `tests/rustdoc/source-code-pages` subfolder to limit number of files ↵Guillaume Gomez-0/+0
at the top level