| Age | Commit message (Collapse) | Author | Lines |
|
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``
|
|
|
|
|
|
the right type
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
The skipped test passes since nightly-2024-11-29. Let's stop skipping
it to increase the chance of detecing a regression.
|
|
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
|
|
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
|
|
remove few allow(dead_code)
Few from serial/parallel compiler leftovers and few from bootstrap.
|
|
|
|
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
For consistency. Also, it's faster because `join_with_double_colon` does
a better job estimating the allocation size than `join` from
`itertools`.
|
|
|
|
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````
|
|
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```
|
|
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
|
|
Minic rustc's new `format_args!` expansion
|
|
|
|
|
|
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
|
|
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.
|
|
The runner was already forwarded to `compiletest`, this just passes it on to `run-make` and uses it in the `run` functions.
|
|
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 :)
|
|
- `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.
|
|
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.
|
|
It's just replicating exactly what is done by `<Vec<GenericParamDef> as
FromClean>::into_json`
|
|
We currently have both `FromClean<clean::Constant> for Constant` and
`FromClean<clean::ConstantKind> for Constant` which are basically
identical, but the former is unused.
|
|
|
|
LHolten/better-docs-for-exclude-imports-in-symbol-search
Add better documentation for excluding imports from symbol search
|
|
|
|
Extend `or_fun_call` lint with new checks for Option::get_or_insert,
Result::map_or.
changelog: [`or_fun_call`]: lint more methods
|
|
internal: Utilize `cargo check --compile-time-deps`
|
|
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`
|
|
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
|
|
fix(linkcheck): Build using the lockfile
This is to unblock cargo from servo/html5ever#623
I ran `linkcheck.sh` locally and it now works
|
|
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`
|
|
|
|
|
|
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.
|
|
As per the previous commit, generic args here can only appear on the
final segment. So make the comments obey that constraint.
|
|
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.
|
|
A lot of these are large! Lots of room for improvement in the future.
|
|
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`
|
|
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
|
|
|
|
|
|
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
|
|
|
|
|