about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-09-27Apply first review round suggestionsGuillaume Gomez-14/+2
2025-09-27Improve code comments and extend tests for `doc_cfg` featureGuillaume Gomez-2/+4
2025-09-27Correctly handle target_feature in rustdoc cfgGuillaume Gomez-26/+11
2025-09-27fmtGuillaume Gomez-5/+3
2025-09-27Improve code and better check `doc(cfg(...))` attributesGuillaume Gomez-36/+57
2025-09-27Add code documentation, improve code and improve error messageGuillaume Gomez-5/+22
2025-09-27Put back the `doc_cfg` code behind a nightly featureGuillaume Gomez-1/+5
2025-09-27Rename `CfgInfo::doc_auto_cfg_active` into `auto_cfg_active`Guillaume Gomez-9/+9
2025-09-27Update book for `doc_cfg` featureGuillaume Gomez-0/+268
2025-09-27Remove `doc_cfg` related content from rustdoc book unstable features chapterGuillaume Gomez-82/+0
2025-09-27Remove useless code in `propagate_doc_cfg.rs`Guillaume Gomez-18/+1
2025-09-27Implement RFC 3631Guillaume Gomez-161/+370
2025-09-27Auto merge of #146636 - Mark-Simulacrum:bootstrap-bump, r=jieyouxubors-515/+502
Bump bootstrap compiler to 1.91 beta https://forge.rust-lang.org/release/process.html#default-branch-bootstrap-update-tuesday
2025-09-26Bump stage0Mark Rousskov-500/+500
2025-09-26Apply cfg(bootstrap) replacementMark Rousskov-13/+0
2025-09-26Update CURRENT_RUSTC_VERSION post-bumpMark Rousskov-2/+2
2025-09-26Rollup merge of #147027 - GuillaumeGomez:tyalias-disambiguator, r=lolbinarycatMatthias Krüger-1/+3
Add new `tyalias` intra-doc link disambiguator Fixes https://github.com/rust-lang/rust/issues/146855. Alternative to rust-lang/rust#146866. This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them. cc ``@fmease`` r? lolbinarycat
2025-09-26Rollup merge of #146758 - mati865:amd64_mingw_no_rs_objects, r=petrochenkovMatthias Krüger-0/+2
Stop linking rs{begin,end} objects on x86_64-*-windows-gnu Until now, x86_64-pc-windows-gnu linked `rsbegin.o` and `rsend.o` just like i686-pc-windows-gnu, even though they were no-ops for it. This was likely done for the simplicity back when it was introduced. Today the things are different and these startup/end objects harm other features, like `build-std`. Given the demotion of i686-pc-windows-gnu from tier 1, there is no point in hurting x86_64-pc-windows-gnu, which remains a tier 1. The files are still shipped in case downstream crates expect them, as in case of the unmaintained `xargo`. Fixes https://github.com/rust-lang/rust/issues/146739
2025-09-26Rollup merge of #146523 - thejpster:demote-armebv7r-targets, r=jackh726Matthias Krüger-3/+3
Demote both armebv7r-none-* targets. OK, slightly more controversial than https://github.com/rust-lang/rust/pull/146520 and https://github.com/rust-lang/rust/pull/146522 - I'd like to drop the bare-metal **big-endian** Armv7-R targets down to Tier 3. The reason is simple - we cannot test them in https://github.com/rust-embedded/cortex-ar/. This because QEMU support for Big Endian Armv7-R is broken. I tried quite hard, but all the strings I printed with semihosting came out byte swapped (or "etybawa depp") because of how QEMU kludges the access to memory in big-endian mode. The target also has only a single maintainer. Although, if ````@chrisnc```` wants to put up a case for keeping it at Tier 2 though, I'm happy to hear it! This PR wil be rebased once https://github.com/rust-lang/rust/pull/146419 completes the queue.
2025-09-26Rollup merge of #145113 - petrochenkov:lessfinalize, r=lcnrMatthias Krüger-7/+4
resolve: Do not finalize shadowed bindings I.e. do not mark them as used, or non-speculatively loaded, or similar. Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
2025-09-26Mention `tyalias` in intra-doc link rustdoc book chapterGuillaume Gomez-1/+1
2025-09-26Auto merge of #146595 - Shourya742:make-cargo-test-work-for-self-test, r=Kobzolbors-394/+337
Make cargo test work for bootstrap self test This PR enables the bootstrap self-test to run via cargo test. I have removed the detect_src_and_out test for now, but it will be reintroduced in a follow-up PR where all bootstrap tests will be migrated to use testCtx. r? `@Kobzol` try-job: aarch64-apple
2025-09-26Add new `tyalias` intra-doc link disambiguatorGuillaume Gomez-0/+2
2025-09-26Auto merge of #147054 - matthiaskrgr:rollup-660g92w, r=matthiaskrgrbors-65/+295
Rollup of 7 pull requests Successful merges: - rust-lang/rust#146283 (Resolve: (Ref)Cell wrappers to deny mutation during spec resolution.) - rust-lang/rust#146453 (Add general arm-linux.md platform doc.) - rust-lang/rust#146991 (const_caller_location to use real Span instead of `DUMMY_SP`) - rust-lang/rust#146994 (Add `clippy::unconditional_recursion` to `./x clippy ci`) - rust-lang/rust#147038 (Rename verbosity functions in bootstrap) - rust-lang/rust#147047 (rustdoc: put the toolbar on the all item index) - rust-lang/rust#147049 (std: fix warning in VEXos stdio module) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-26Rollup merge of #147047 - notriddle:toolbar-index, r=GuillaumeGomezMatthias Krüger-3/+13
rustdoc: put the toolbar on the all item index
2025-09-26Rollup merge of #147038 - Kobzol:bootstrap-verbose-fn, r=jieyouxuMatthias Krüger-58/+46
Rename verbosity functions in bootstrap Just a small cleanup, these function names have been bothering me for a while. I realized that we can delete some of them outright, rather than just renaming them. r? ``@jieyouxu``
2025-09-26Rollup merge of #146994 - cuviper:clippy-ci-recursion, r=KobzolMatthias Krüger-0/+2
Add `clippy::unconditional_recursion` to `./x clippy ci` The clippy lint catches some things that rustc's equivalent builtin lint does not, for example rust-lang/rust#146940: error: function cannot return without recursing --> library/std/src/path.rs:3428:5 | 3428 | / fn eq(&self, other: &String) -> bool { 3429 | | self == &*other 3430 | | } | |_____^ | note: recursive call site --> library/std/src/path.rs:3429:9 | 3429 | self == &*other | ^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion = note: requested on the command line with `-D clippy::unconditional-recursion`
2025-09-26Rollup merge of #146453 - thejpster:arm-linux-docs, r=petrochenkovMatthias Krüger-4/+234
Add general arm-linux.md platform doc. Adds a new page that covers all 32-bit Arm Linux systems. This means that we can reduce the amount of information required in the target specific pages to just the Tier level, the maintainer, and any specific details for that target. I have no changed those pages yet, though. Let's start with this.
2025-09-26Auto merge of #145882 - m-ou-se:format-args-extend-1-arg, r=petrochenkovbors-22/+38
Extended temporary argument to format_args!() in all cases Fixes https://github.com/rust-lang/rust/issues/145880 by removing the special case.
2025-09-25rustdoc: put the toolbar on the all item indexMichael Howell-3/+13
2025-09-25Auto merge of #147037 - matthiaskrgr:rollup-xtgqzuu, r=matthiaskrgrbors-346/+431
Rollup of 8 pull requests Successful merges: - rust-lang/rust#116882 (rustdoc: hide `#[repr]` if it isn't part of the public ABI) - rust-lang/rust#135771 ([rustdoc] Add support for associated items in "jump to def" feature) - rust-lang/rust#141032 (avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if`) - rust-lang/rust#142401 (Add proper name mangling for pattern types) - rust-lang/rust#146293 (feat: non-panicking `Vec::try_remove`) - rust-lang/rust#146859 (BTreeMap: Don't leak allocators when initializing nodes) - rust-lang/rust#146924 (Add doc for `NonZero*` const creation) - rust-lang/rust#146933 (Make `render_example_with_highlighting` return an `impl fmt::Display`) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-25resolve: Do not finalize shadowed bindingsVadim Petrochenkov-7/+4
I.e. do not mark them as used, or non-speculative loaded, or similar. Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
2025-09-25Add `clippy::unconditional_recursion` to `./x clippy ci`Josh Stone-0/+2
The clippy lint catches some things that rustc's equivalent builtin lint does not, for example rust-lang/rust#146940: error: function cannot return without recursing --> library/std/src/path.rs:3428:5 | 3428 | / fn eq(&self, other: &String) -> bool { 3429 | | self == &*other 3430 | | } | |_____^ | note: recursive call site --> library/std/src/path.rs:3429:9 | 3429 | self == &*other | ^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unconditional_recursion = note: requested on the command line with `-D clippy::unconditional-recursion`
2025-09-25Rename `verbose` to `do_if_verbose`Jakub Beránek-37/+40
2025-09-25Rollup merge of #146933 - yotamofek:pr/rustdoc/highlight_no_write_str, ↵Matthias Krüger-95/+80
r=GuillaumeGomez Make `render_example_with_highlighting` return an `impl fmt::Display` Removes some more usages of `write_str`. Shouldn't affect runtime, but makes the codebase a bit more consistent. Each commit can be reviewed separately
2025-09-25Rollup merge of #142401 - oli-obk:pattern-mango, r=petrochenkovMatthias Krüger-0/+28
Add proper name mangling for pattern types requires adding demangler support first https://github.com/rust-lang/rustc-demangle/pull/81 needed for https://github.com/rust-lang/rust/pull/136006#discussion_r2139792593 as otherwise we will have symbol collisions
2025-09-25Rollup merge of #141032 - petrosagg:extract-if-ub, r=joboetMatthias Krüger-0/+10
avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if` The implementation of the `Vec::extract_if` iterator violates the safety contract adverized by `slice::from_raw_parts` by always constructing a mutable slice for the entire length of the vector even though that span of memory can contain holes from items already drained. The safety contract of `slice::from_raw_parts` requires that all elements must be properly initialized. As an example we can look at the following code: ```rust let mut v = vec![Box::new(0u64), Box::new(1u64)]; for item in v.extract_if(.., |x| **x == 0) { drop(item); } ``` In the second iteration a `&mut [Box<u64>]` slice of length 2 will be constructed. The first slot of the slice contains the bitpattern of an already deallocated box, which is invalid. This fixes the issue by only creating references to valid items and using pointer manipulation for the rest. I have also taken the liberty to remove the big `unsafe` blocks in place of targetted ones with a SAFETY comment. The approach closely mirrors the implementation of `Vec::retain_mut`. **Note to reviewers:** The diff is easier to follow with whitespace hidden.
2025-09-25Rollup merge of #135771 - GuillaumeGomez:jump-to-def-perf, r=fmeaseMatthias Krüger-92/+152
[rustdoc] Add support for associated items in "jump to def" feature Fixes https://github.com/rust-lang/rust/issues/135485. r? ``@fmease``
2025-09-25Rollup merge of #116882 - fmease:rustdoc-generalized-priv-repr-heuristic, ↵Matthias Krüger-159/+161
r=rustdoc rustdoc: hide `#[repr]` if it isn't part of the public ABI > [!IMPORTANT] > Temporarily stacked on top of PR https://github.com/rust-lang/rust/pull/146527; only the last commit is relevant! Follow-up to rust-lang/rust#115439. Unblocks rust-lang/rust#116743, CC ``@dtolnay.`` Fixes rust-lang/rust#66401. Fixes rust-lang/rust#128364. Fixes rust-lang/rust#137440. Only display the representation `#[repr(REPR)]` (where `REPR` is not `Rust` or `transparent`) of a given type if none of its variants (incl. the synthetic variants of structs) are `#[doc(hidden)]` and all of its fields are public and not `#[doc(hidden)]` since it's likely not meant to be considered part of the public ABI otherwise. `--document-{private,hidden}-items` works as expected in this context, too. Moreover, we now also factor in the presence of `#[doc(hidden)]` when checking whether to show `repr(transparent)` or not.
2025-09-25Remove `is_verbose_than` functionJakub Beránek-6/+1
2025-09-25Remove `verbose_than` functionJakub Beránek-15/+5
2025-09-25Make `cargo test` work againJakub Beránek-8/+30
2025-09-25Ensure that `--build-dir` is always specified in testsJakub Beránek-23/+4
2025-09-25Rollup merge of #147013 - fmease:fix-docs-doctest-build-arg, r=GuillaumeGomezStuart Cook-21/+5
rustdoc: Fix documentation for `--doctest-build-arg` In https://github.com/rust-lang/rust/pull/139863, I forgot to update the documentation. Tracking issue: https://github.com/rust-lang/rust/issues/134172
2025-09-25Rollup merge of #147008 - neuschaefer:bootstrap-jobs, r=KobzolStuart Cook-0/+2
bootstrap.py: Respect build.jobs while building bootstrap tool On resource-constrained systems, it is vital to respect the value of build.jobs, in order to avoid overwhelming the available memory.
2025-09-25Rollup merge of #146735 - Qelxiros:const_mul_add, r=tgross35,RalfJungStuart Cook-41/+5
unstably constify float mul_add methods Tracking issue: rust-lang/rust#146724 r? `@tgross35`
2025-09-25Rollup merge of #146667 - calebzulawski:simd-mono-lane-limit, r=lcnr,RalfJungStuart Cook-0/+5
Add an attribute to check the number of lanes in a SIMD vector after monomorphization Allows std::simd to drop the `LaneCount<N>: SupportedLaneCount` trait and maintain good error messages. Also, extends rust-lang/rust#145967 by including spans in layout errors for all ADTs. r? ``@RalfJung`` cc ``@workingjubilee`` ``@programmerjake``
2025-09-25Rollup merge of #145973 - vexide:vex-std, r=tgross35Stuart Cook-8/+19
Add `std` support for `armv7a-vex-v5` This PR adds standard library support for the VEX V5 Brain (`armv7a-vex-v5` target). It is more-or-less an updated version of the library-side work done in rust-lang/rust#131530. This was a joint effort between me, `@lewisfm,` `@max-niederman,` `@Gavin-Niederman` and several other members of the [`vexide` project](https://github.com/vexide/). ## Background VEXos is a fairly unconventional operating system, with user code running in a restricted enviornment with regards to I/O capabilities and whatnot. As such, several OS-dependent APIs are unsupported or have partial support (such as `std::net`, `std::process`, and most of `std::thread`). A more comprehensive list of what does or doesn't work is outlined in the [updated target documentation](https://github.com/vexide/rust/blob/vex-std/src/doc/rustc/src/platform-support/armv7a-vex-v5.md). Despite these limitations, we believe that `libstd` support on this target still has value to users, especially given the popular use of this hardware for educational purposes. For some previous discussion on this matter, see [this comment](https://github.com/rust-lang/rust/pull/131530#issuecomment-2432856841). ## SDK Linkage VEXos doesn't really ship with an official `libc` or POSIX-style platform API (and though it does port newlib, these are stubbed on top of the underlying SDK). Instead, VEX provides their own SDK for calling platform APIs. Their official SDK is kept proprietary (with public headers), though open-source implementations exist. Following the precedent of the `armv6k-nintendo-3ds` team's work in rust-lang/rust#95897, we've opted not to directly link `libstd` to any SDK with the expectation that users will provide their own with one of the following options: - [`vex-sdk-download`](https://github.com/vexide/vex-sdk/tree/main/packages/vex-sdk-download), which downloads an official proprietary SDK from VEX using a build script. - [`vex-sdk-jumptable`](https://crates.io/crates/vex-sdk-jumptable), which is a compatible, open-source reimplementation of the SDK using firmware jumps. - [`vex-sdk-pros`](https://github.com/vexide/vex-sdk/tree/main/packages/vex-sdk-pros), which uses the [PROS kernel](https://github.com/purduesigbots/pros) as a provider for SDK functions. - Linking their own implementation or stubbing the functions required by libstd. The `vex-sdk` crate used in the VEXos PAL provides `libc`-style FFI bindings for any compatible system library, so any of these options *should* work fine. A functional demo project using `vex-sdk-download` can be found [here](https://github.com/vexide/armv7a-vex-v5-demo/tree/main). ## Future Work This PR implements virtually everything we are currently able to implement given the current capabilities of the platform. The exception to this is file directory enumeration, though the implementation of that is sufficiently [gross enough](https://github.com/vexide/vexide/blob/c6c5bad11e035cf4e51d429dca7e427210185ed4/packages/vexide-core/src/fs/mod.rs#L987) to drive us away from supporting this officially. Additionally, I have a working branch implementing the `panic_unwind` runtime for this target, which is something that would be nice to see in the future, though given the volume of compiler changes i've deemed it out-of-scope for this PR.
2025-09-25bootstrap.py: Respect build.jobs while building bootstrap toolJ. Neuschäfer-0/+2
On resource-constrained systems, it is vital to respect the value of build.jobs, in order to avoid overwhelming the available memory.
2025-09-25rustdoc: hide `#[repr(...)]` if it isn't part of the public ABILeón Orell Valerian Liehr-26/+76