about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-07-31Add VxWorks platfrom support documentsB I Mohammed Abbas-6/+58
2024-07-31Auto merge of #128075 - Oneirical:try-your-damnetest, r=jieyouxubors-8/+97
Migrate `rlib-format-packed-bundled-libs-2`, `native-link-modifier-whole-archive` and `no-builtins-attribute` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: x86_64-msvc try-job: test-various try-job: armhf-gnu try-job: aarch64-apple try-job: x86_64-gnu-llvm-18
2024-07-30Rollup merge of #128398 - awilfox:awilfox/fix-tidy-quote, r=jieyouxuMatthias Krüger-1/+1
tidy: Fix quote in error message I noticed that the backticks around the error code wasn't done properly in this string when I was building Rust 1.80.0 and found it is still this way in nightly. Example: ``` warning: Error code `E0595` needs to have at least one UI test in the `tests/error-codes/` directory`! warning: Error code E0602`` has a UI test file, but doesn't contain its own error code! warning: Error code `E0619` needs to have at least one UI test in the `tests/error-codes/` directory`! ``` This commit fixes it to match the other warning strings.
2024-07-30Rollup merge of #128382 - RalfJung:cargo-miri-assert, r=oli-obkMatthias Krüger-1/+4
cargo-miri: better error when we seem to run inside bootstrap but something is wrong Cc https://github.com/rust-lang/miri/issues/3775
2024-07-30Rollup merge of #128376 - compiler-errors:finish-ur-vegetables, r=jieyouxuMatthias Krüger-5/+7
Mark `Parser::eat`/`check` methods as `#[must_use]` These methods return a `bool`, but we probably should either use these values or explicitly throw them away (e.g. when we just want to unconditionally eat a token if it exists). I changed a few places from `eat` to `expect`, but otherwise I tried to leave a comment explaining why the `eat` was okay. This also adds a test for the `pattern_type!` macro, which used to silently accept a missing `is` token.
2024-07-30Rollup merge of #128367 - ojeda:rfl-ci-build-doctests-and-docs, r=KobzolMatthias Krüger-1/+5
CI: rfl: build the generated doctests and documentation Cc ``@tgross35`` r? ``@Kobzol`` try-job: x86_64-rust-for-linux
2024-07-30Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68bors-450/+461
Bump bootstrap compiler to new beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-07-30Auto merge of #124339 - oli-obk:supports_feature, r=wesleywiserbors-0/+1
allow overwriting the output of `rustc --version` Our wonderful bisection folk [have to work around](https://github.com/rust-lang/rust/issues/123276#issuecomment-2075001510) crates that do incomplete nightly/feature detection, as otherwise the bisection just points to where the feature detection breaks, and not to the actual breakage they are looking for. This is also annoying behaviour to nightly users who did not opt-in to those nightly features. Most nightly users want to be in control of the nightly breakage they get, by * choosing when to update rustc * choosing when to update dependencies * choosing which nightly features they are willing to take the breakage for The reason this breakage occurs is that the build script of some crates run `rustc --version`, and if the version looks like nightly or dev, it will enable nightly features. These nightly features may break in random ways whenever we change something in nightly, so every release of such a crate will only work with a small range of nightly releases. This causes bisection to fail whenever it tries an unsupported nightly, even though that crate is not related to the bisection at all, but is just an unrelated dependency. This PR (and the policy I want to establish with this FCP) is only for situations like the `version_check`'s `supports_feature` function. It is explicitly not for `autocfg` or similar feature-detection-by-building-rust-code, irrespective of my opinions on it and the similarity of nightly breakage that can occur with such schemes. These cause much less breakage, but should the breakage become an issue, they should get covered by this policy, too. This PR allows changing the version and release strings reported by `rustc --version` via the `RUSTC_OVERRIDE_VERSION_STRING` env var. The bisection issue is then fixed by https://github.com/rust-lang/cargo-bisect-rustc/pull/335. I mainly want to establish a compiler team policy: > We do not consider feature detection on nightly (on stable via compiler version numbering is fine) a valid use case that we need to support, and if it causes problems, we are at liberty to do what we deem best - either actively working to prevent it or to actively ignore it. We may try to work with responsive and cooperative authors, but are not obligated to. Should they subvert the workarounds that nightly users or cargo-bisect-rustc can use, we should be able to land rustc PRs that target the specific crates that cause issues for us and outright replace their build script's logic to disable nightly detection. I am not including links to crates, PRs or issues here, as I don't actually care about the specific use cases and don't want to make it trivial to go there and leave comments. This discussion is going to be interesting enough on its own, without branching out.
2024-07-30Revert "opt-dist: dont overrwite config.toml when verifying"Mark Rousskov-14/+17
This reverts commit c81a40bbc02bb44aa99b3a94322dbf07e7a62ce1.
2024-07-30tidy: Fix quote in error messageA. Wilcox-1/+1
2024-07-30Suppress must_use on eat calls in rustfmtMichael Goulet-5/+7
2024-07-30Test RUSTC_OVERRIDE_VERSION_STRINGOli Scherer-0/+1
2024-07-30cargo-miri: better error when we seem to run inside bootstrap but something ↵Ralf Jung-1/+4
is wrong
2024-07-30Rollup merge of #128339 - GuillaumeGomez:click-code-example, r=notriddleMatthias Krüger-3/+37
[rustdoc] Make the buttons remain when code example is clicked Follow-up of https://github.com/rust-lang/rust/pull/125779. One current issue we have with "run" button and the newly added copy code button is that if you're on mobile devices, you can't use them. I took a look at how `mdbook` is handling it and when you click on a code example, they show the buttons. I think it's a really good idea as if you want to copy the code on your mobile device, you will click on it, showing the buttons. Feature can be tested [here](https://rustdoc.crud.net/imperio/click-code-example/foo/struct.Bar.html). r? `@notriddle`
2024-07-29CI: rfl: build the documentationMiguel Ojeda-0/+3
Since the `rfl` CI job has not had almost any issue for some weeks, it is a good time to try to increase a bit the scope of what it tests. The kernel does not use any particular `rustdoc` unstable issue (apart from the doctests ones) so far, so in principle it should not introduce extra issues here, and may be a good extra test case for Rust. In addition, it may help to test new unstable features in the future. In the worst case, we can revert it. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-07-29CI: rfl: build the generated doctestsMiguel Ojeda-1/+2
We were already generating the doctests, which should already catch most issues with our hack around `--test-builder` and `--no-run`. However, we were not building the result of that transformation, thus build it for completeness and to ensure the hack may not have produced something completely broken. In the worst case, we can revert it. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-07-29Rollup merge of #128342 - onur-ozkan:ci-env-usage, r=KobzolMatthias Krüger-8/+6
simplify the use of `CiEnv` self-explanatory
2024-07-29Rollup merge of #126247 - notriddle:notriddle/word-wrap-item-table, ↵Matthias Krüger-11/+160
r=GuillaumeGomez rustdoc: word wrap CamelCase in the item list table and sidebar This is an alternative to https://github.com/rust-lang/rust/pull/126209. That is, it fixes the issue that affects the very long type names in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs. This is, necessarily, a pile of nasty heuristics. We need to balance a few issues: - Sometimes, there's no real word break. For example, `BTreeMap` should be `BTree<wbr>Map`, not `B<wbr>Tree<wbr>Map`. - Sometimes, there's a legit word break, but the name is tiny and the HTML overhead isn't worth it. For example, if we're typesetting `TyCtx`, writing `Ty<wbr>Ctx` would have an HTML overhead of 50%. Line breaking inside it makes no sense. # Screenshots | Before | After | | ------ | ----- | | ![image](https://github.com/rust-lang/rust/assets/1593513/d51201fd-46c0-4f48-aee6-a477eadba288) | ![image](https://github.com/rust-lang/rust/assets/1593513/d8e77582-adcf-4966-bbfd-19dfdad7336a)
2024-07-29Make the buttons remain when code example is clickedGuillaume Gomez-3/+37
2024-07-29rustdoc: move the wbr after the underscore, instead of beforeMichael Howell-8/+8
2024-07-29rustdoc: properly handle path wrappingMichael Howell-4/+19
2024-07-29rustdoc: use `<wbr>` in sidebar headersMichael Howell-4/+24
This also improves sidebar layout, so instead of BTreeM ap you get this BTree Map
2024-07-29rustdoc: avoid redundant HTML when there's already line breaksMichael Howell-0/+10
2024-07-29Fix tidy call in runtest with custom HTML elementMichael Howell-0/+1
2024-07-29rustdoc: word wrap CamelCase in the item list tableMichael Howell-4/+107
This is an alternative to ee6459d6521cf6a4c2e08b6e13ce3c6ce5d55ed0. That is, it fixes the issue that affects the very long type names in https://docs.rs/async-stripe/0.31.0/stripe/index.html#structs. This is, necessarily, a pile of nasty heuristics. We need to balance a few issues: - Sometimes, there's no real word break. For example, `BTreeMap` should be `BTree<wbr>Map`, not `B<wbr>Tree<wbr>Map`. - Sometimes, there's a legit word break, but the name is tiny and the HTML overhead isn't worth it. For example, if we're typesetting `TyCtx`, writing `Ty<wbr>Ctx` would have an HTML overhead of 50%. Line breaking inside it makes no sense.
2024-07-29rewrite raw-dylib-stdcall-ordinal to rmakeOneirical-1/+0
2024-07-29rewrite raw-dylib-link-ordinal to rmakeOneirical-1/+0
2024-07-29rewrite raw-dylib-import-name-type to rmakeOneirical-1/+0
2024-07-29rewrite share-generics-dylib to rmakeOneirical-1/+0
2024-07-29simplify the use of `CiEnv`onur-ozkan-8/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29Rollup merge of #128333 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-204/+807
Miri subtree update r? `@ghost`
2024-07-29Rollup merge of #128322 - ojeda:rfl-ci-update, r=KobzolMatthias Krüger-1/+1
CI: move RFL job forward to v6.11-rc1 The tag has been released today, and since the original hash we had in the Rust CI (which was ~v6.10-rc1), we have accumulated a fair amount of changes and new code. In particular, v6.11-rc1 is the first Linux tag where the kernel is supporting an actual minimum Rust version (1.78.0), rather than a single version. --- Let's try to do the move independently first. r? ``@Kobzol`` try-job: x86_64-rust-for-linux
2024-07-29Rollup merge of #128277 - RalfJung:offset_from_wildcard, r=oli-obkMatthias Krüger-88/+100
miri: fix offset_from behavior on wildcard pointers offset_from wouldn't behave correctly when the "end" pointer was a wildcard pointer (result of an int2ptr cast) just at the end of the allocation. Fix that by expressing the "same allocation" check in terms of two `check_ptr_access_signed` instead of something specific to offset_from, which is both more canonical and works better with wildcard pointers. The second commit just improves diagnostics: I wanted the "pointer is dangling (has no provenance)" message to say how many bytes of memory it expected to see (since if it were 0 bytes, this would actually be legal, so it's good to tell the user that it's not 0 bytes). And then I was annoying that the error looks so different for when you deref a dangling pointer vs an out-of-bounds pointer so I made them more similar. Fixes https://github.com/rust-lang/miri/issues/3767
2024-07-29ignore `crates` if running unit testsonur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29remove the requirement of `Builder` arg in `doc::Std::new` functiononur-ozkan-18/+2
`crates` field is handled in the `Step::make_run` just like in any other `Std` implementation, so we don't need to resolve them in `Std::new`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29allow running `x doc` on std for no_std targetsonur-ozkan-8/+2
Since we now handle library crates properly, there's no need to panic for `no_std` targets anymore. `x doc library` now generates documentation for the `alloc` crate from standard library. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29handle no_std targets on std buildsonur-ozkan-8/+22
This change unifies the `Step::run_make` logic and improves it by skipping std specific crates for no_std targets. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-07-29Rollup merge of #128269 - onur-ozkan:improve-cargo-invocations, ↵Matthias Krüger-117/+151
r=Mark-Simulacrum improve cargo invocations on bootstrap Fixes few of the `FIXME`s on cargo invocations and should be considered as blocker for https://github.com/rust-lang/rust/issues/128180.
2024-07-29Rollup merge of #127290 - its-the-shrimp:document_rustdoc_json_types, ↵Matthias Krüger-52/+533
r=aDotInTheVoid Fully document `rustdoc-json-types` 100% of `rustdoc-json-types` is now documented Here's the summary from rustdoc with `-Zunstable-options --show-coverage`: ``` +-------------------------------------+------------+------------+------------+------------+ | File | Documented | Percentage | Examples | Percentage | +-------------------------------------+------------+------------+------------+------------+ | src/rustdoc-json-types/lib.rs | 314 | 100.0% | 23 | 31.9% | +-------------------------------------+------------+------------+------------+------------+ | Total | 314 | 100.0% | 23 | 31.9% | +-------------------------------------+------------+------------+------------+------------+ ```
2024-07-29fully document rustdoc-json-typesschvv31n-52/+533
2024-07-29CI: move RFL job forward to v6.11-rc1Miguel Ojeda-1/+1
The tag has been released today, and since the original hash we had in the Rust CI (which was ~v6.10-rc1), we have accumulated a fair amount of changes and new code. In particular, v6.11-rc1 is the first Linux tag where the kernel is supporting an actual minimum Rust version (1.78.0), rather than a single version. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-07-29Reformat `use` declarations.Nicholas Nethercote-796/+753
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-28step cfg(bootstrap)Mark Rousskov-8/+2
2024-07-28Bump stage0 to 1.81 betaMark Rousskov-428/+442
2024-07-28Rollup merge of #127860 - klensy:dedup, r=Mark-SimulacrumGuillaume Gomez-2/+2
deps: dedup object, wasmparser, wasm-encoder * dedups one `object`, additional dupe will be removed, with next `thorin-dwp` update * `wasmparser` pinned to minor versions, so full merge isn't possible * same with `wasm-encoder` Turned off some features for `wasmparser` (see features https://github.com/bytecodealliance/wasm-tools/blob/v1.208.1/crates/wasmparser/Cargo.toml) in `run-make-support`, looks working?
2024-07-28Rollup merge of #125779 - GuillaumeGomez:copy-code, r=rustdoc-teamGuillaume Gomez-48/+135
[rustdoc] Add copy code feature This PR adds a "copy code" to code blocks. Since this is a JS only feature, the HTML is generated with JS when the user hovers the code block to prevent generating DOM unless needed. Two things to note: 1. I voluntarily kept the current behaviour of the run button (only when hovering a code block with a mouse) so it doesn't do anything on mobile. I plan to send a follow-up where the buttons would "expandable" or something. Still need to think which approach would be the best. 2. I used a picture and not text like the run button to remain consistent with the "copy path" button. I'd also prefer for the run button to use a picture (like what is used in mdbook) but again, that's something to be discussed later on. The rendering looks like this: ![Screenshot from 2024-06-03 21-29-48](https://github.com/rust-lang/rust/assets/3050060/a0b18f9c-b3dd-4a65-89a7-5a7a303b5c2b) ![Screenshot from 2024-06-03 21-30-20](https://github.com/rust-lang/rust/assets/3050060/b3b084ff-2716-4160-820b-d4774681a961) It can be tested [here](https://guillaume-gomez.fr/rustdoc/bar/struct.Bar.html) (without the run button) and [here](https://guillaume-gomez.fr/rustdoc/foo/struct.Bar.html) (with the run button). Fixes #86851. r? ``@notriddle``
2024-07-28dedup objectklensy-2/+2
waiting on thorin-dwp update dedup one wasmparser run-make-support: drop some features for wasmparser dedupe wasm-encoder
2024-07-28Auto merge of #128301 - matthiaskrgr:rollup-9fyf587, r=matthiaskrgrbors-182/+374
Rollup of 3 pull requests Successful merges: - #125889 (Add migration lint for 2024 prelude additions) - #128215 (Update the reference) - #128263 (rustdoc: use strategic ThinVec/Box to shrink `clean::ItemKind`) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-28Rollup merge of #128263 - notriddle:notriddle/clean-up-again, r=GuillaumeGomezMatthias Krüger-89/+120
rustdoc: use strategic ThinVec/Box to shrink `clean::ItemKind`
2024-07-28Rollup merge of #128215 - ehuss:update-reference, r=KobzolMatthias Krüger-93/+254
Update the reference This updates the reference to use the new mdbook-spec preprocessor, which is a Cargo library inside the reference submodule. Note that this PR contains a bunch of bootstrap cleanup commits to assist with making sure the submodules are working correctly. All of the cleanup PRs should have a description in their commit. I'd be happy to move those to a separate PR if that makes review easier. The main changes for the reference are: - Move the `doc::Reference` bootstrap step out of the generic macro into a custom step. - This step needs to build rustdoc because the new mdbook-spec plugin uses rustdoc for generating links. - PATH is updated so that the rustdoc binary can be found. - rustbook now includes the mdbook-spec plugin as a dependency. - rustbook enables the mdbook-spec preprocessor. I did a bunch of testing with the various commands and setups, such as: - `submodules=true` and `submodules=false` - having all submodules deinitialized - not in a git repository However, there are probably thousands of different permutations of different commands, settings, and environments, so there is a chance I'm missing something.