about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-06-23Rollup merge of #141597 - Oneirical:unquestionable-instruction, r=jieyouxuMatthias Krüger-0/+5
Document subdirectories of UI tests with README files Part of rust-lang/rust#133895 and the [2025 Google Summer of Code](https://blog.rust-lang.org/2025/05/08/gsoc-2025-selected-projects/) associated project. When adding a new UI test, one is faced with hundreds of subdirectories in `tests/ui` reflecting various categories. Knowing where to put the new test is not trivial, as many of the categories have slightly misleading names. For example, `moves` does not only refer to the `move` keyword but to functions taking ownership in general, whereas `allocator` does not refer to allocation in general but rather to the very specific `allocator_api` and `global_allocator` features. Many contributors will therefore place their test at the top level of ̀`tests/ui` where it will be mixed with hundreds of unrelated tests. This PR is a tentative move towards more clearly defined tag/categories, with a SUMMARY.md file documenting the true purpose of each subdirectory, placed inside `tests/ui`. r? ``@jieyouxu``
2025-06-22Update cargoEric Huss-0/+0
2025-06-23Don't run doctestsChayim Refael Friedman-0/+32
2025-06-23In "Wrap return type" assist, don't wrap exit points if they already have ↵Chayim Refael Friedman-34/+133
the right type
2025-06-22Port `#[no_mangle]` to new attribute parsing infrastructureJonathan Brouwer-24/+22
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-22ci: aarch64-gnu: Stop skipping `panic_abort_doc_tests`Martin Nordholts-2/+1
The skipped test passes since nightly-2024-11-29. Let's stop skipping it to increase the chance of detecing a regression.
2025-06-22Add a SUMMARY.md outlining immediate subdirectories of the ui test suiteOneirical-0/+5
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
2025-06-22Rollup merge of #142877 - ↵Guillaume Gomez-0/+3
yotamofek:pr/rustdoc/comment-eslint-installation-req, r=GuillaumeGomez Document why tidy checks if `eslint` is installed via `npm` Discussion here: rust-lang/rust#142851
2025-06-22Rollup merge of #142868 - klensy:dc, r=oli-obkGuillaume Gomez-2/+1
remove few allow(dead_code) Few from serial/parallel compiler leftovers and few from bootstrap.
2025-06-22Document why tidy checks if `eslint` is installed via `npm`Yotam Ofek-0/+3
2025-06-22Check rustdoc-json-types FORMAT_VERSION correct changeGuillaume Gomez-0/+25
2025-06-22Port `#[must_use]` to new attribute parsing infrastructureJonathan Brouwer-22/+42
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-22Use `join_with_double_colon` in `write_shared.rs`.Nicholas Nethercote-2/+2
For consistency. Also, it's faster because `join_with_double_colon` does a better job estimating the allocation size than `join` from `itertools`.
2025-06-22remove few from bootstrap tooklensy-2/+1
2025-06-22Rollup merge of #142776 - dtolnay:hirattrstyle2, r=jdonszelmannJacob Pratt-3/+10
All HIR attributes are outer Fixes https://github.com/rust-lang/rust/issues/142649. Closes https://github.com/rust-lang/rust/pull/142759. All HIR attributes, including parsed and not yet parsed, will now be rendered as outer attributes by `rustc_hir_pretty`. The original style of the corresponding AST attribute(s) is not relevant for pretty printing, only for diagnostics. r? ````@jdonszelmann````
2025-06-22Rollup merge of #142747 - nnethercote:json-conversion-cleanups, r=aDotInTheVoidJacob Pratt-189/+169
rustdoc_json: conversion cleanups A bunch of clean-to-types conversion cleanups I found while working on perf-related stuff in rustdoc_json. r? ```@aDotInTheVoid```
2025-06-22Rollup merge of #140254 - bjorn3:rustc_panic_abort_abort, r=petrochenkovJacob Pratt-12/+0
Pass -Cpanic=abort for the panic_abort crate The panic_abort crate must be compiled with panic=abort, but cargo doesn't allow setting the panic strategy for a single crate the usual way using `panic="abort"`, but luckily per-package rustflags do allow this. Bootstrap previously handled this in its rustc wrapper, but for example the build systems of cg_clif and cg_gcc don't use the rustc wrapper, so they would either need to add one, patch the standard library or be unable to build a sysroot suitable for both panic=abort and panic=unwind (as is currently the case). Required for https://github.com/rust-lang/rustc_codegen_cranelift/issues/1567
2025-06-22Merge pull request #20056 from ShoyuVanilla/fmt-args-newChayim Refael Friedman-46/+412
Minic rustc's new `format_args!` expansion
2025-06-22Minic rustc's new `format_args!` expansionShoyu Vanilla-41/+366
2025-06-22Implement region negation to minicore and add a flag `fmt_before_1_89_0`Shoyu Vanilla-8/+49
2025-06-22Auto merge of #141856 - folkertdev:run-make-forward-compiletest-runner, ↵bors-1/+28
r=jieyouxu forward the bootstrap `runner` to `run-make` The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions. The configuration can look like this ```toml # in bootstrap.toml [target.s390x-unknown-linux-gnu] runner = "qemu-s390x -L /usr/s390x-linux-gnu" ``` Any C compilation automatically sets the correct target. Calls to rustc must use `.target(target())`. Then, a command like below will work by cross-compiling to the given target, and using the given runner for that target to execute the binary: ``` ./x test tests/run-make/c-link-to-rust-va-list-fn --target s390x-unknown-linux-gnu ``` The runner can also be used for e.g. running with `valgrind`. This PR also enables its use in the test case that I care about, hopefully that actually does work on the platforms that CI uses. We should probably run some try jobs to be sure? r? `@jieyouxu` try-job: test-various try-job: armhf-gnu
2025-06-21add nvptx_target_featureJed Brown-0/+40
Add target features for sm_* and ptx*, both of which form a partial order, but cannot be combined to a single partial order. These mirror the LLVM target features, but we do not provide LLVM target processors (which imply both an sm_* and ptx* feature). Add some documentation for the nvptx target.
2025-06-22forward the bootstrap `runner` to `run-make`Folkert de Vries-1/+28
The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions.
2025-06-21Auto merge of #142667 - yotamofek:pr/rustdoc/more-write-shared-perf, ↵bors-27/+12
r=nnethercote Avoid a few more allocations in `write_shared.rs` Inspired by rust-lang/rust#141421 , avoids a few `Vec`, `PathBuf` and `String` allocations in `write_shared.rs`. I don't think these will show up on benchmarks, but are still worthwhile IMHO. Also includes a few small cleanups. r? nnethercote - if you'd like :)
2025-06-22Rename some methods.Nicholas Nethercote-8/+12
- `convert_static` -> `from_clean_static` - `from_function` -> `from_clean_function` To match the pre-existing `from_clean_item` and `FromClean::from_clean`. I left `JsonRenderer::convert_item` unchanged because it's a bit different.
2025-06-22Use `FromClean` more.Nicholas Nethercote-121/+156
The `FromClean` trait is used a lot for converting to rustdoc-json format. But it's not used universally; there are still some ad hoc functions and methods for converting. This commit fixes this inconsistency by using `FromClean` more. The commit also introduces `FromClean` for `Box` and `Option`. This lets a lot of `as_ref` and `map` calls be removed in favour of simple `into_json` calls.
2025-06-22Remove some code.Nicholas Nethercote-32/+1
It's just replicating exactly what is done by `<Vec<GenericParamDef> as FromClean>::into_json`
2025-06-22Remove some dead code.Nicholas Nethercote-25/+0
We currently have both `FromClean<clean::Constant> for Constant` and `FromClean<clean::ConstantKind> for Constant` which are basically identical, but the former is unused.
2025-06-22Use `sym::asterisk` to avoid a `Symbol::intern` call.Nicholas Nethercote-5/+2
2025-06-21Merge pull request #20050 from ↵Chayim Refael Friedman-3/+11
LHolten/better-docs-for-exclude-imports-in-symbol-search Add better documentation for excluding imports from symbol search
2025-06-21All HIR attributes are outerDavid Tolnay-3/+10
2025-06-21or_fun_call: lint more methods (#15071)Samuel Tardieu-1/+1
Extend `or_fun_call` lint with new checks for Option::get_or_insert, Result::map_or. changelog: [`or_fun_call`]: lint more methods
2025-06-21Merge pull request #20047 from ShoyuVanilla/comp-time-depsLukas Wirth-2/+24
internal: Utilize `cargo check --compile-time-deps`
2025-06-21Rollup merge of #142804 - zachs18:rename-layouts-to-layoutdata-in-comments, ↵Matthias Krüger-1/+1
r=saethlin Rename `LayoutS` to `LayoutData` in comments `LayoutS` was renamed to `LayoutData`, but some comments in the compiler were not changed. This updates comments in the compiler (and one section of commented-out code in rust-analyzer) to refer to `LayoutData` instead of `LayoutS`. cc <https://github.com/rust-lang/rust/pull/132252>, `@workingjubilee`
2025-06-21Rollup merge of #142787 - samueltardieu:diag-items-for-clippy, ↵Matthias Krüger-24/+16
r=Manishearth,Urgau Add diagnostic items for Clippy Clippy still uses some paths to access items from the standard library. Adding the missing diagnostic items allows removing the last remaining paths. Closes rust-lang/rust-clippy#5393
2025-06-21Rollup merge of #142785 - epage:link, r=ehussMatthias Krüger-0/+1
fix(linkcheck): Build using the lockfile This is to unblock cargo from servo/html5ever#623 I ran `linkcheck.sh` locally and it now works
2025-06-21Rollup merge of #142502 - nnethercote:rustdoc-json-GenericArgs, r=aDotInTheVoidMatthias Krüger-19/+64
rustdoc_json: improve handling of generic args This PR fixes some inconsistencies and inefficiencies in how generic args are handled by rustdoc-json-types. r? `@aDotInTheVoid`
2025-06-21fix: Correct grammar in remove all unused imports assistZakaria Elkatani-1/+1
2025-06-21internal: Utilize `cargo check --compile-time-deps`Shoyu Vanilla-2/+24
2025-06-21rustdoc_json: represent generic args consistently.Nicholas Nethercote-21/+19
They show up in three places: once as `Option<Box<GenericArgs>>`, once as `Box<GenericArgs>`, and once as `GenericArgs`. The first option is best. It is more compact because generic args are often missing. This commit changes the latter two to the former. Example output, before and after, for the `AssocItemConstraint` change: ``` {"name":"Offset","args":{"angle_bracketed":{"args":[],"constraints":[]}},"binding":{...}} {"name":"Offset","args":null,"binding":{...}} ``` Example output, before and after, for the `Type::QualifiedPath` change: ``` {"qualified_path":{"name":"Offset","args":{"angle_bracketed":{"args":[],"constraints":[]}}, ...}} {"qualified_path":{"name":"Offset","args":null, ...}} ``` This reduces JSON output size, but not by much (e.g. 0.5%), because `AssocItemConstraint` and `Type::QualifiedPath` are uncommon.
2025-06-21Fix some comments.Nicholas Nethercote-3/+3
As per the previous commit, generic args here can only appear on the final segment. So make the comments obey that constraint.
2025-06-21rustdoc_json: Fix handling of paths with no generic args.Nicholas Nethercote-1/+18
A path without generic args, like `Reader`, currently has JSON produced like this: ``` {"path":"Reader","id":286,"args":{"angle_bracketed":{"args":[],"constraints":[]}}} ``` Even though `types::Path::args` is `Option` and allows for "no args", instead it gets represented as "empty args". (More like `Reader<>` than `Reader`.) This is due to a problem in `clean::Path::from_clean`. It only produces `None` if the path is an empty string. This commit changes it to also produce `None` if there are no generic args. The example above becomes: ``` {"path":"Reader","id":286,"args":null} ``` I looked at a few examples and saw this reduce the size of the JSON output by 3-9%. The commit also adds an assertion that non-final segments don't have any generics; something the old code was implicitly relying on. Note: the original sin here is that `clean::PathSegment::args` is not an `Option`, unlike `{ast,hir}::PathSegment::args`. I want to fix that, but it can be done separately.
2025-06-21rustdoc_json: Add static asserts for the size of important types.Nicholas Nethercote-0/+30
A lot of these are large! Lots of room for improvement in the future.
2025-06-20Rollup merge of #142677 - GuillaumeGomez:check-format-version-update, r=KobzolTrevor Gross-2/+109
Add CI check to ensure that rustdoc JSON `FORMAT_VERSION` is correctly updated Follow-up of https://github.com/rust-lang/rust/pull/142601. Tested it locally with: `BASE_COMMIT=1bb335244c311a07cee165c28c553c869e6f64a9 src/ci/docker/host-x86_64/mingw-check-1/validate-rustdoc-json-format-version-update.sh` (where `BASE_COMMIT` value was the commit before I made a wrong change with the `FORMAT_VERSION` update). This is a first version. I plan to send a follow-up to also ensure that `FORMAT_VERSION` is updated if any code change is done in `rustdoc-json-types`. For that I just need to check that a line not starting with `/` and not an empty line was updated. Fun times with `grep` ahead. :') cc `@aDotInTheVoid` r? `@nnethercote`
2025-06-20Rollup merge of #142384 - celinval:chores-rayon-mv, r=oli-obkTrevor Gross-1/+1
Bringing `rustc_rayon_core` in tree as `rustc_thread_pool` This PR moves [`rustc_rayon_core`](https://github.com/rust-lang/rustc-rayon/tree/5fadf44/rayon-core) from commit `5fadf44` as suggested in [this zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fparallel-rustc/topic/Bringing.20.60rustc_rayon_core.60.20in.20tree). I tried to split the work into separate commits so it is easy to review. The first commit is a simple copy and paste from the fork, and subsequent changes were made to use the new crate and to ensure the new crate complies with different format and lint expectations. **Call-out:** I was also wondering if I need to make any further changes to accommodate licensing requirements. r? oli-obk
2025-06-21formatjnyfah-1/+1
2025-06-21revert changesjnyfah-95/+10
2025-06-20Auto merge of #142794 - tgross35:rollup-iae7okj, r=tgross35bors-122/+80
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - rust-lang/rust#142491 (Rework #[cold] attribute parser) - rust-lang/rust#142494 (Fix missing docs in `rustc_attr_parsing`) - rust-lang/rust#142495 (Better template for `#[repr]` attributes) - rust-lang/rust#142497 (Fix random failure when JS code is executed when the whole file was not read yet) - rust-lang/rust#142575 (Ensure copy* intrinsics also perform the static self-init checks) - rust-lang/rust#142650 (Refactor Translator) - rust-lang/rust#142713 (mbe: Refactor transcription) - rust-lang/rust#142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-20configure.py: fix edge casebinarycat-1/+1
2025-06-20fmtNia Espera-7/+6