Commit graph

312890 commits

Author SHA1 Message Date
Guillaume Gomez
2bc2a0db69 For now, ignore target checking for doc attributes in attr_parsing 2025-12-10 20:18:42 +01:00
Guillaume Gomez
9fdec8194e Fix new merge conflict 2025-12-10 12:35:17 +01:00
Guillaume Gomez
3ea9462167 Remove Cfg::matches and use eval_config_entry instead 2025-12-10 12:28:08 +01:00
Guillaume Gomez
64aaeacd71 Update to new API, allowing to remove check_doc_cfg.rs file from librustdoc 2025-12-10 12:28:08 +01:00
Guillaume Gomez
40907f522d Fix doc alias suggestion 2025-12-10 12:28:08 +01:00
Guillaume Gomez
6230b56eaa Update clippy code 2025-12-10 12:28:08 +01:00
Guillaume Gomez
4191e94715 Improve spans for auto_cfg(hide/show) errors 2025-12-10 12:28:08 +01:00
Guillaume Gomez
1da7684c7d Improve code and add more comments 2025-12-10 12:28:07 +01:00
Guillaume Gomez
06238bd93e Update rustdoc JSON output to new attribute API 2025-12-10 12:28:07 +01:00
Guillaume Gomez
2340f8054c Update to new lint API 2025-12-10 12:28:07 +01:00
Guillaume Gomez
8d4f59bed7 Clean up code 2025-12-10 12:28:07 +01:00
Guillaume Gomez
348d9d98e0 Correctly iterate doc comments in intra-doc resolution in rustc_resolve 2025-12-10 12:28:07 +01:00
Guillaume Gomez
4936973d49 Fix ui tests 2025-12-10 12:28:05 +01:00
Guillaume Gomez
aa3bf6fde9 Update rustc_resolve unit tests 2025-12-10 12:27:34 +01:00
Guillaume Gomez
a36c462fb8 Update clippy code to new doc attribute API 2025-12-10 12:27:34 +01:00
Guillaume Gomez
3fa499bab0 Sort fluent messages 2025-12-10 12:27:34 +01:00
Guillaume Gomez
e4f57dd4b3 Finish fixing ui tests 2025-12-10 12:27:34 +01:00
Guillaume Gomez
d1277ccffa Update check_doc_cfg pass in rustdoc, remove old rustc_attr_parsing::cfg_matches API 2025-12-10 12:27:34 +01:00
Guillaume Gomez
9c8c67bfdd Fix warning messages 2025-12-10 12:27:34 +01:00
Guillaume Gomez
976d45452a Update rustdoc unit tests 2025-12-10 12:27:34 +01:00
Guillaume Gomez
5c47240ad1 Correctly handle doc(test(attr(...))) 2025-12-10 12:27:34 +01:00
Guillaume Gomez
57870b7242 Fix doc(auto_cfg) attribute parsing 2025-12-10 12:27:34 +01:00
Guillaume Gomez
d35ec316c5 Keep a list of CfgEntry instead of just one 2025-12-10 12:27:33 +01:00
Guillaume Gomez
368a103902 Fix Cfg add/or operations 2025-12-10 12:27:33 +01:00
Guillaume Gomez
92edc499a6 Correctly handle doc items inlining 2025-12-10 12:27:33 +01:00
Guillaume Gomez
148e522112 Correctly differentiate between sugared and raw doc comments 2025-12-10 12:27:33 +01:00
Guillaume Gomez
04bcd83eb5 Move doc = "" parsing out of DocParser to keep doc attributes order 2025-12-10 12:27:33 +01:00
Guillaume Gomez
131323f910 Migrate doc(cfg) to new Attribute API 2025-12-10 12:27:33 +01:00
Guillaume Gomez
acb32df7b1 Continue migration to new Attribute API for doc attribute 2025-12-10 12:27:33 +01:00
Jana Dönszelmann
3f08e4dcd9 start using parsed doc attributes everywhere 2025-12-10 12:27:33 +01:00
Jana Dönszelmann
df007cf800 rewrite doc attribute (non-doc-comments) 2025-12-10 12:27:33 +01:00
bors
bad50269f8 Auto merge of #147602 - JohnTitor:dedup-lifetime-capture-errors, r=estebank
Deduplicate higher-ranked lifetime capture errors in impl Trait

  Previously, when an `impl Trait` captured multiple higher-ranked
  lifetimes from an outer `impl Trait`, the compiler would emit a
  separate error for each captured lifetime. This resulted in verbose
  and confusing diagnostics, especially in edition 2024 where implicit
  captures caused duplicate errors.

  This commit introduces error accumulation that collects all capture
  spans and lifetime declaration spans, then emits a single consolidated
  diagnostic using MultiSpan. The new error shows all captured lifetimes
  with visual indicators and lists all declarations in a single note.

r? `@estebank`
Fixes https://github.com/rust-lang/rust/issues/143022
2025-12-10 06:52:27 +00:00
bors
2e667b0c64 Auto merge of #146948 - folkertdev:hint-prefetch, r=Amanieu
add `core::hint::prefetch_{read, write}_{data, instruction}`

tracking issue: https://github.com/rust-lang/rust/issues/146941
acp: https://github.com/rust-lang/libs-team/issues/638

well, we don't expose `prefetch_write_instruction`, that one doesn't really make sense in practice.

The implementation is straightforward, the docs can probably use some tweaks. Especially for the instruction version it's a little awkward.

r? `@Amanieu`
2025-12-10 03:18:26 +00:00
Folkert de Vries
b9e3e4162a
remove explicit discriminants 2025-12-10 00:17:57 +01:00
Folkert de Vries
6407023007
Add a separate function for a non-temporal read prefetch 2025-12-10 00:08:54 +01:00
Folkert de Vries
a3b78e0320
add core::hint::prefetch_{read, write}_{data, instruction}
well, we don't expose `prefetch_write_instruction`, that one doesn't really make sense in practice.
2025-12-10 00:08:54 +01:00
bors
5f1173bb2b Auto merge of #149818 - matthiaskrgr:rollup-uw85yss, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144938 (Enable `outline-atomics` by default on more AArch64 platforms)
 - rust-lang/rust#146579 (Handle macro invocation in attribute during parse)
 - rust-lang/rust#149400 (unstable proc_macro tracked::* rename/restructure)
 - rust-lang/rust#149664 (attempt to fix unreachable code regression )
 - rust-lang/rust#149806 (Mirror `ubuntu:24.04` on ghcr)

Failed merges:

 - rust-lang/rust#149789 (Cleanup in the attribute parsers)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-09 22:05:52 +00:00
Matthias Krüger
a00807ed93
Rollup merge of #149806 - Kobzol:mirror-ubuntu-24.04, r=marcoieni
Mirror `ubuntu:24.04` on ghcr

The miri job wants to use it (https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Adding.20a.20C.2B.2B.20dependency.20to.20Miri.3F/with/560654845), and sooner or later we will likely migrate our CI to it too.

r? `@marcoieni`
2025-12-09 17:36:50 +01:00
Matthias Krüger
6188f82198
Rollup merge of #149664 - Kivooeo:infallible-type-unreachable-code, r=davidtwco
attempt to fix unreachable code regression

For some reason it works, it checks function output type and suppress warning if type is uninhabited

~~This double negations in code breaks my mind actually~~

I'd love to revisit this part in future and try to find a proper solution maybe, but for now I feel like it's enough before release to fix the issue? I really wonder what team does think, especially `@cjgillot` and other people who are more confident in this part of compiler than I do

I tried a lot of things here, it's only approach that pass all tests included new regression one

fixes https://github.com/rust-lang/rust/issues/149571

r? compiler
2025-12-09 17:36:49 +01:00
Matthias Krüger
679ab9e061
Rollup merge of #149400 - Skgland:tracked_mod, r=Amanieu
unstable proc_macro tracked::* rename/restructure

Picking up what should be the uncontroversial part of rust-lang/rust#87173 (closed due to inactivity over two years ago).

Part of rust-lang/rust#99515.

- move `proc_macro::tracked_env::var` to `proc_macro::tracked::env_var`
- move `proc_macro::tracked_path::path` to `proc_macro::tracked::path`
- change the argument of `proc_macro::tracked::path` from `AsRef<str>` to `AsRef<Path>`.
2025-12-09 17:36:48 +01:00
Matthias Krüger
90dc2b6e2d
Rollup merge of #146579 - estebank:issue-146325, r=jdonszelmann
Handle macro invocation in attribute during parse

```
error: expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found macro `concat`
  --> $DIR/macro-in-attribute.rs:4:21
   |
LL | #[deprecated(note = concat!("a", "b"))]
   |                     ^^^^^^^^^^^^^^^^^ macros are not allowed here
```

Fix rust-lang/rust#146325.
2025-12-09 17:36:48 +01:00
Matthias Krüger
76370238b0
Rollup merge of #144938 - tgross35:more-outline-atomics, r=davidtwco
Enable `outline-atomics` by default on more AArch64 platforms

The baseline Armv8.0 ISA doesn't have atomics instructions, but in
practice most hardware is at least Armv8.1-A (2014), which includes
single-instruction atomics as part of the LSE feature. As a performance
optimization for these cases, GCC and LLVM have the `-moutline-atomics` flag
to turn atomic operations into calls to symbols like `__aarch64_cas1_acq`.
These can do runtime feature detection and use the LSE instructions if
available, falling back to more portable load-exclusive/store-exclusive
loops.

Since the recent 3b50253b57 ("compiler-builtins: plumb LSE support
for aarch64 on linux") our builtins support this LSE optimization, and
since 6936bb975a ("Dynamically enable LSE for aarch64 rust provided
intrinsics"), std will set the flag as part of its startup code. The first
commit in this PR configures this to work on all platforms built with
`outline-atomics`, not just Linux.

Thus, enable `outline-atomics` by default on Android, OpenBSD, Windows,
and Fuchsia platforms that don't have LSE in the baseline. The feature is
already enabled on Linux. Platform-specific details are included in each
commit message.

The current implementation can still be accessed by setting
`-Ctarget-feature=-outline-atomics`. Setting `-Ctarget-feature=+lse` or
a relevant CPU will use the single-instruction atomics without the call
overhead. https://rust.godbolt.org/z/dsdrzszoe

Link: https://learn.arm.com/learning-paths/servers-and-cloud-computing/lse/intro/
Original Clang outline-atomics benchmarks: https://reviews.llvm.org/D91157#2435844

try-job: aarch64-msvc-*
try-job: arm-android
try-job: dist-android
try-job: dist-aarch64-llvm-mingw
try-job: dist-aarch64-msvc
try-job: dist-various-*
try-job: test-various
2025-12-09 17:36:47 +01:00
bors
c61a3a44d1 Auto merge of #147984 - petrochenkov:expambig, r=yaahc
resolve: Preserve ambiguous glob reexports in crate metadata

So in cross-crate scenarios they can work in the same way as in crate-local scenarios.

Change Description: https://github.com/rust-lang/rust/pull/147984#issuecomment-3455514826

Resurrection of https://github.com/rust-lang/rust/pull/114682.
One of unblocking steps for https://github.com/rust-lang/rust/pull/145108.
Fixes https://github.com/rust-lang/rust/issues/36837.
2025-12-09 16:22:54 +00:00
Kivooeo
2a2da782d3 add check for uninhabited types along side never 2025-12-09 13:18:09 +00:00
bors
e2893f7c95 Auto merge of #149757 - jdonszelmann:revert-duplicate-span-lowering, r=nnethercote
Revert "early return on duplicate span lowerings"

r? `@nnethercote`

reverts rust-lang/rust#149060 because of perf regressions that are still wild to me
2025-12-09 11:38:27 +00:00
Vadim Petrochenkov
51780a53f6 resolve: Preserve ambiguous glob reexports in crate metadata
So in cross-crate scenarios they can work in the same way as in crate-local scenarios.
2025-12-09 13:40:02 +03:00
Jakub Beránek
75df299225
Mirror ubuntu:24.04 on ghcr 2025-12-09 11:30:03 +01:00
bors
d5525a7300 Auto merge of #149798 - matthiaskrgr:rollup-wjgs9x6, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#147585 (Suppress the error for private fields with non_exhaustive attribute)
 - rust-lang/rust#149215 (Emit `check-cfg` lints during attribute parsing rather than evaluation)
 - rust-lang/rust#149652 (Add release notes for 1.92.0)
 - rust-lang/rust#149720 (rustdoc book: mention inner doc attribute)
 - rust-lang/rust#149730 (lint: emit proper diagnostic for unsafe binders in improper_ctypes instead of ICE)
 - rust-lang/rust#149754 (Retire `opt_str2` from compiletest cli parsing)
 - rust-lang/rust#149755 (bootstrap: Use a `CompiletestMode` enum instead of bare strings)
 - rust-lang/rust#149763 (Add inline attribute to generated delegation function if needed)
 - rust-lang/rust#149772 (test: Add a test for 146133)
 - rust-lang/rust#149779 (Fix typo "an" → "and")
 - rust-lang/rust#149782 (Remove `[no-mentions]` handler in the triagebot config)

Failed merges:

 - rust-lang/rust#148491 ( Correctly provide suggestions when encountering `async fn` with a `dyn Trait` return type)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-09 08:20:51 +00:00
Matthias Krüger
288e97018a
Rollup merge of #149782 - Urgau:triagebot-remove-no-mentions, r=Kobzol
Remove `[no-mentions]` handler in the triagebot config

This PR removes the `[no-mentions]` handler in the triagebot config as [GitHub is removing notifications for ``@-mentions`` in commit messages on December 8th 2025.](https://github.blog/changelog/2025-11-07-removing-notifications-for-mentions-in-commit-messages/)

cf. https://github.com/rust-lang/triagebot/issues/2225
2025-12-09 06:17:28 +01:00
Matthias Krüger
2fffbb5f0c
Rollup merge of #149779 - tbu-:pr_an_false, r=joboet
Fix typo "an" → "and"
2025-12-09 06:17:27 +01:00