1
Fork 0
Commit graph

285495 commits

Author SHA1 Message Date
Nicholas Nethercote
8d2c63f514 Don't use kw::Empty in hir::Lifetime::ident.
`hir::Lifetime::ident` currently sometimes uses `kw::Empty` for elided
lifetimes and sometimes uses `kw::UnderscoreLifetime`, and the
distinction is used when creating some error suggestions, e.g. in
`Lifetime::suggestion` and `ImplicitLifetimeFinder::visit_ty`. I found
this *really* confusing, and it took me a while to understand what was
going on.

This commit replaces all uses of `kw::Empty` in `hir::Lifetime::ident`
with `kw::UnderscoreLifetime`. It adds a new field
`hir::Lifetime::is_path_anon` that mostly replaces the old
empty/underscore distinction and makes things much clearer.

Some other notable changes:

- Adds a big comment to `Lifetime` talking about permissable field
  values.

- Adds some assertions in `new_named_lifetime` about what ident values
  are permissible for the different `LifetimeRes` values.

- Adds a `Lifetime::new` constructor that does some checking to make
  sure the `is_elided` and `is_anonymous` states are valid.

- `add_static_impl_trait_suggestion` now looks at `Lifetime::res`
  instead of the ident when creating the suggestion. This is the one
  case where `is_path_anon` doesn't replace the old empty/underscore
  distinction.

- A couple of minor pretty-printing improvements.
2025-03-28 10:15:23 +11:00
binarycat
d487087415 search.js: revert usage of nonundef for now (not available under test)
specifically, `storage.js` is not loaded during `rustdoc-js`
and `rustdoc-js-std` tests.
2025-03-27 17:24:21 -05:00
bors
7586a9f99a Auto merge of #138702 - m-ou-se:spawn-in-atexit, r=Mark-Simulacrum
Allow spawning threads after TLS destruction

Fixes #138696
2025-03-27 21:46:58 +00:00
Nicholas Nethercote
cfd00f9c16 Remove ImplicitObjectLifetimeDefault case from suggestion.
It has no effect on anything in the test suite.

This means it can also be rewritten as a neater pairwise `match`.
2025-03-28 08:25:07 +11:00
Nicholas Nethercote
c6d8d65496 Remove LifetimeSuggestionPosition and Lifetime::suggestion_position.
They both are only used in `Lifetime::suggestion`. This commit inlines
and removes them.
2025-03-28 08:25:07 +11:00
Nicholas Nethercote
4924e0a067 Add a HIR pretty-printing test focused on lifetimes.
HIR printing currently gets very little testing. This increases coverage
a bit, with a focus on lifetimes.

There are some FIXME comments for cases that are printed in a dubious
fashion. This PR won't address those; the point of adding this test is
to ensure that the subsequent commits don't hurt pretty-printing.
2025-03-28 08:25:06 +11:00
binarycat
65624d9ea5 tester.js: ignore displayTypeSignature if it is null 2025-03-27 16:00:44 -05:00
Ben Kimock
c9adf541a8 saethlin goes on vacation 2025-03-27 15:40:03 -04:00
bors
3f5502370b Auto merge of #139023 - jhpratt:rollup-4ou6ei4, r=jhpratt
Rollup of 7 pull requests

Successful merges:

 - #138844 (expand: Leave traces when expanding `cfg` attributes)
 - #138926 (Remove `kw::Empty` uses from `rustc_middle`.)
 - #138989 (Clean up a few things in rustc_hir_analysis::check::region)
 - #138999 (Report compiletest pass mode if forced)
 - #139014 (Improve suggest construct with literal syntax instead of calling)
 - #139015 (Remove unneeded LLVM CI test assertions)
 - #139016 (Add job duration changes to post-merge analysis report)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-27 18:33:31 +00:00
Yotam Ofek
bec69704c0 Use abs_diff where applicable 2025-03-27 18:29:06 +00:00
Michael Goulet
ed0a798828 Drive-by get rid of a bunch of unnecessary :? 2025-03-27 17:45:18 +00:00
Michael Goulet
c00343a5b4 Do not trim paths in MIR validator 2025-03-27 17:45:02 +00:00
Jacob Pratt
1b8089d553
Rollup merge of #139016 - Kobzol:post-merge-analysis-durations, r=marcoieni
Add job duration changes to post-merge analysis report

This should help us observe large regressions in job duration changes.

I would also like to add quick links to GH jobs/workflow to the post-merge workflow, but for that I first need to store some CI metadata to the bootstrap metrics, to make it easier to lookup the corresponding GH workflows (otherwise we'd need to look them up by commit SHA, which would be much more complicated). The last commit adds this metadata. Once this PR is merged, and the metadata will be available in the metrics stored on S3, I'll send a follow-up PR that uses the metadata to add links to job names in the post-merge workflow report.

r? `@marcoieni`
2025-03-27 13:11:21 -04:00
Jacob Pratt
ecaa35f676
Rollup merge of #139015 - Kobzol:llvm-ci-test-fixes, r=onur-ozkan
Remove unneeded LLVM CI test assertions

The `download_ci_llvm` bootstrap test was checking implementation details of the LLVM CI download check, which isn't very useful. It was essentially testing "if function_that_checks_if_llvm_ci_is_available returns true, we enable CI LLVM", but the usage of the function was an implementation detail. After https://github.com/rust-lang/rust/pull/138704, the inner implementation has changed, so the test now breaks if LLVM is updated.

I don't think that it's very useful to test implementation details like this, without taking the outside git state into account. Ideally, we should mock the git state for the test, otherwise the test will randomly break when executed in environments which the test does not control (e.g. on CI when a LLVM change happens).

I only kept the part of the test that checks that LLVM CI isn't used when we specify `download-ci-llvm = false`, as that should hold under all conditions, CI/local, and all git states.

I also kept the `if-unchanged` assertion, but only on CI, and as a temporary measure. After https://github.com/rust-lang/rust/pull/138591, we should have a proper way of mocking the git state to make the test robust, and make it test what we actually want.

Fixes [this](https://github.com/rust-lang/rust/pull/138784#issuecomment-2751460456).

r? `@ghost`
2025-03-27 13:11:21 -04:00
Jacob Pratt
d517a4f0ae
Rollup merge of #139014 - xizheyin:issue-138931, r=oli-obk
Improve suggest construct with literal syntax instead of calling

Closing #138931

When constructing a structure through a format similar to calling a constructor, we can use verbose suggestions to hint at using literal syntax for clearer advice. The case of multiple fields is also considered here, provided that the field has the same number of arguments as CallExpr.

r? compiler
2025-03-27 13:11:20 -04:00
Jacob Pratt
ed752193cc
Rollup merge of #138999 - jieyouxu:spellout-pass-mode, r=wesleywiser
Report compiletest pass mode if forced

This is very non-obvious if it fails in PR CI, because the starting invocation is miles away from the final test suite outcome.
2025-03-27 13:11:19 -04:00
Jacob Pratt
322d1c1974
Rollup merge of #138989 - m-ou-se:clean-up-things, r=jdonszelmann,dingxiangfei2009
Clean up a few things in rustc_hir_analysis::check::region

Each commit is independent. They are all small clean-ups in rustc_hir_analysis::check::region.
2025-03-27 13:11:18 -04:00
Jacob Pratt
10debec01a
Rollup merge of #138926 - nnethercote:less-kw-Empty-rustc_middle, r=lcnr
Remove `kw::Empty` uses from `rustc_middle`.

There are several places in `rustc_middle` that check for an empty lifetime name. These checks appear to be totally unnecessary, because empty lifetime names aren't produced here. (Empty lifetime names *are* possible in `hir::Lifetime`. Perhaps there was some confusion between it and the `rustc_middle` types?)

This commit removes the `kw::Empty` checks.

r? `@lcnr`
2025-03-27 13:11:18 -04:00
Jacob Pratt
3a8621d681
Rollup merge of #138844 - petrochenkov:cfgtrace2, r=nnethercote
expand: Leave traces when expanding `cfg` attributes

This is the same as https://github.com/rust-lang/rust/pull/138515, but for `cfg(true)` instead of `cfg_attr`.

The difference is that `cfg(true)`s already left "traces" after themselves - the `cfg` attributes themselves, with `expanded_inert_attrs` set to true, with full tokens, available to proc macros.
This is not a reasonably expected behavior, but it could not be removed without a replacement, because a [major rustdoc feature](https://github.com/rust-lang/rfcs/pull/3631) and a number of clippy lints rely on it. This PR implements a replacement.

This needs a crater run, because it changes observable behavior (in an intended way) - proc macros can no longer see expanded `cfg(true)` attributes.

(Some minor unnecessary special casing for `sym::cfg_attr` is also removed in this PR.)

r? `@nnethercote`
2025-03-27 13:11:17 -04:00
Guillaume Gomez
5d274408d4 Only take outer attributes into account when generating content between first non-crate items and the crate items 2025-03-27 17:43:29 +01:00
Augie Fackler
1437dec799 rustc_resolve: prevent iteration of refids for completeness
This came up in review, and it should help some future author
not introduce non-deterministic output here.
2025-03-27 12:39:48 -04:00
bit-aloo
02444322c0
add changeInfo to change tracker 2025-03-27 22:02:44 +05:30
bit-aloo
eaa0613e8d
feat(config): Add ChangeId enum for suppressing warnings
Introduces the `ChangeId` enum to allow suppressing `change_id` warnings.
Now, `ChangeId` supports both numeric values and the string literal `"ignore"`.
Numeric values behave as expected, while `"ignore"` is used to suppress warning messages.
2025-03-27 22:02:38 +05:30
Jakub Beránek
27cca0a161 Add CI metadata to bootstrap metrics
This will allow us to provide links to CI workflows, jobs and summaries in the post-merge analysis report.
2025-03-27 17:03:08 +01:00
Augie Fackler
77eb97d9a9 librustdoc: also stabilize iteration order here 2025-03-27 11:59:04 -04:00
Guillaume Gomez
49f1e9cd8d Remove recursion in check_item 2025-03-27 16:44:21 +01:00
Guillaume Gomez
1494da4ffb Add new regression test for doctest 2025-03-27 16:23:50 +01:00
bors
217693a1f0 Auto merge of #138927 - nnethercote:rearrange-Item-ItemInner, r=GuillaumeGomez
rustdoc: Rearrange `Item`/`ItemInner`.

The `Item` struct is 48 bytes and contains a `Box<ItemInner>`;
`ItemInner` is 104 bytes. This is an odd arrangement. Normally you'd
have one of the following.

- A single large struct, which avoids the allocation for the `Box`, but
  can result in lots of wasted space in unused parts of a container like
  `Vec<Item>`, `HashSet<Item>`, etc.

- Or, something like `struct Item(Box<ItemInner>)`, which requires the
  `Box` allocation but gives a very small Item size, which is good for
  containers like `Vec<Item>`.

`Item`/`ItemInner` currently gets the worst of both worlds: it always
requires a `Box`, but `Item` is also pretty big and so wastes space in
containers. It would make sense to push it in one direction or the
other. #138916 showed that the first option is a regression for rustdoc,
so this commit does the second option, which improves speed and reduces
memory usage.

r? `@GuillaumeGomez`
2025-03-27 15:22:17 +00:00
joboet
3371d498b1
std: get rid of pre-Vista fallback code
We haven't had any Windows XP targets for a long while now...
2025-03-27 15:41:46 +01:00
Ralf Jung
ab8836f548
Merge pull request #4240 from RalfJung/aarch64-linux-android
run a few more concurrency tests on aarch64-linux-android
2025-03-27 14:36:26 +00:00
Guillaume Gomez
2004dacef2 Improve code 2025-03-27 15:22:39 +01:00
Ralf Jung
c845ff0d71 run a few more concurrency tests on aarch64-linux-android 2025-03-27 15:05:37 +01:00
bjorn3
8364234af6
Merge pull request #1566 from rust-lang/arm64_fixes
Fix the half and bytecount crates on arm64
2025-03-27 14:50:23 +01:00
Mara Bos
6c2161a07c Mark test as only-unix. 2025-03-27 14:11:11 +01:00
xizheyin
4648650d89
Improve suggest construct with literal syntax instead of calling
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-27 20:09:37 +08:00
Guillaume Gomez
8327bb6ad3 Add expect to the list of non-crate attributes for doctest generation 2025-03-27 13:01:25 +01:00
Guillaume Gomez
f333ad8656 Improve code comment 2025-03-27 13:00:49 +01:00
Guillaume Gomez
be13105d73 Improve comment and test for generated doctest with code comments 2025-03-27 12:56:08 +01:00
xizheyin
d0353f5c7a
Add ui test for struct construction by calling syntax
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-27 18:50:39 +08:00
Jakub Beránek
a37cef9ee6 Add a note about interpreting job duration changes 2025-03-27 11:38:54 +01:00
Jakub Beránek
4a43675353 Add cache for job metrics 2025-03-27 11:38:54 +01:00
Jakub Beránek
a3bafca14a Add job duration changes stats in post-merge analysis 2025-03-27 11:38:49 +01:00
Guillaume Gomez
123ea25542 Correctly handle line comments in attributes and generate extern crates
outside of wrapping function
2025-03-27 11:18:43 +01:00
Guillaume Gomez
6f7e8d441a Correctly handle fn main in macro 2025-03-27 11:18:43 +01:00
Guillaume Gomez
01fb7c3ac6 Update rustdoc-ui tests 2025-03-27 11:18:43 +01:00
Guillaume Gomez
1f1c630a58 Greatly simplify doctest parsing and information extraction 2025-03-27 11:18:43 +01:00
Jakub Beránek
215c2c2f49 Remove some asserts from the download_ci_llvm bootstrap test 2025-03-27 11:05:49 +01:00
Nicholas Nethercote
5a6ed74a6c Remove kw::Empty uses from src/librustdoc.
Much like the ones in the previous commit.
2025-03-27 19:10:14 +11:00
bors
ecb170afc8 Auto merge of #139012 - Zalathar:rollup-qgt5yfo, r=Zalathar
Rollup of 10 pull requests

Successful merges:

 - #130883 (Add environment variable query)
 - #138624 (Add mipsel maintainer)
 - #138672 (Avoiding calling queries when collecting active queries)
 - #138935 (Update wg-prio triagebot config)
 - #138946 (Un-bury chapters from the chapter list in rustc book)
 - #138964 (Implement lint against using Interner and InferCtxtLike in random compiler crates)
 - #138977 (Don't deaggregate InvocationParent just to reaggregate it again)
 - #138980 (Collect items referenced from var_debug_info)
 - #138985 (Use the correct binder scope for elided lifetimes in assoc consts)
 - #138987 (Always emit `native-static-libs` note, even if it is empty)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-27 07:47:39 +00:00
Mara Bos
3237b5092b Add needs-threads to test. 2025-03-27 08:46:35 +01:00