Commit graph

167229 commits

Author SHA1 Message Date
Boxy Uwu
2f2f518819 bump channel 2025-12-08 10:01:43 +00:00
bors
112a4af313 Auto merge of #149656 - flip1995:clippy-beta-backport, r=Mark-Simulacrum
[beta] Clippy beta backport

All 3 PRs are fixing bugs that were introduced in 1.92 (current beta) and would land on the next stable.

- https://github.com/rust-lang/rust-clippy/pull/16079
- https://github.com/rust-lang/rust-clippy/pull/15984
- https://github.com/rust-lang/rust-clippy/pull/15939

I verified that all of those commits are already synced to `main`.

r? `@Mark-Simulacrum`
2025-12-08 03:19:34 +00:00
Jason Newcomb
f5e067bb50
fix(double_parens): don't lint in proc-macros (#15939)
Fixes https://github.com/rust-lang/rust-clippy/issues/15852

changelog: [`double_parens`]: don't lint in proc-macros
2025-12-04 20:32:28 +01:00
Samuel Tardieu
25cde47717
Fix replace_box FP when the box is moved (#15984)
Closes rust-lang/rust-clippy#15968

changelog: [`replace_box`] fix FP when the box is moved

r? samueltardieu As you wish

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

-
[Beta-nomination](https://github.com/rust-lang/rust-clippy/pull/15984#issuecomment-3469127087)
by [samueltardieu](https://github.com/samueltardieu)

*Managed by `@rustbot`—see
[help](https://forge.rust-lang.org/triagebot/note.html) for details*

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
2025-12-04 20:31:50 +01:00
Jason Newcomb
2a33be7472
Taking a raw pointer on a union field is a safe operation (#16079)
changelog: [`multiple_unsafe_ops_per_block`]: taking a raw pointer on a
union field is a safe operation

Fixes rust-lang/rust-clippy#16076

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_SUMMARY_START -->

### Summary Notes

- [Beta
nomination](https://github.com/rust-lang/rust-clippy/pull/16079#issuecomment-3524699179)
by [samueltardieu](https://github.com/samueltardieu)

*Managed by `@rustbot`—see
[help](https://forge.rust-lang.org/triagebot/note.html) for details*

<!-- TRIAGEBOT_SUMMARY_END -->
<!-- TRIAGEBOT_END -->
2025-12-04 20:31:25 +01:00
Wesley Wiser
9deb2c4c92 Revert "Replace NullOp::SizeOf and NullOp::AlignOf by lang items."
This reverts commit 5dfbf67f94.
2025-12-04 10:49:32 -06:00
Jakub Beránek
519b57bcb3
Use branch name instead of HEAD when unshallowing 2025-12-03 18:45:45 +01:00
Redddy
fdcfd0559a Rename master branch references to main
(cherry picked from commit 4eb0beb3d9)
2025-12-03 09:44:45 -08:00
Jakub Beránek
a81d13f102 Change default branch to main
(cherry picked from commit bc0126d451)
2025-12-02 16:39:01 -08:00
Jakub Beránek
953e1eaa8a Generalize branch name in scripts
(cherry picked from commit ae830ef494)
2025-12-02 16:18:45 -08:00
Scott Schafer
1c8bd26240 fix(rustdoc): Color doctest errors
(cherry picked from commit c523b65245)
2025-12-02 15:51:07 -08:00
Tomasz Miąsko
7ace3ff5e0 rustdoc: Use configured target modifiers when collecting doctests
To support loading dependencies with target modifiers and avoid ABI
mismatch errors.

(cherry picked from commit accd1fe76c)
2025-12-02 15:50:55 -08:00
Josh Stone
786168f456 Update stage0 to 1.91.0 2025-10-30 14:07:45 -07:00
Josh Stone
6284cb18d4 Set channel to beta 2025-10-27 10:27:32 -07:00
bors
8aab621cd5 Auto merge of #148043 - lqd:revert-146121, r=wesleywiser
Revert "fix: Filter suggestion parts that match existing code"

As requested by `@wesleywiser` in https://github.com/rust-lang/rust/issues/147973#issuecomment-3437393773 this is a revert of https://github.com/rust-lang/rust/pull/146121 due to the handful of diagnostics ICEs that have been since reported, and found in the beta crater run.

This should thus also be backported to beta so the ICEs don't make it to next week's stable.

Works around (after backport)
- https://github.com/rust-lang/rust/issues/146261
- https://github.com/rust-lang/rust/issues/146706
- https://github.com/rust-lang/rust/issues/146834 but I didn't add a test for this allowed-by-default lint
- as well as the crater run regressions from https://github.com/rust-lang/rust/issues/147973 of which I only added the MCVE as a test.

The proper fix would likely be https://github.com/rust-lang/rust/pull/147849 but it's still currently at the MCP stage. In the meantime, this PR would still emit the same overlapping suggestions, but still use a debug-assert...

r? `@wesleywiser`
2025-10-24 09:50:35 +00:00
Stuart Cook
b8ca0d40ff
Rollup merge of #148021 - GuillaumeGomez:simplify-mod-render, r=notriddle
[rustdoc] Simplify module rendering and HTML tags handling

Extracted code from rust-lang/rust#145458.

This PR simplifies the rendering of modules, in particular the HTML tags handling. Instead of having all items in a `vec`, we make a map with their types as key, allowing to then iterate over the types, which allows us to open and close the HTML tag at every turn without the need to check if a tag was opened or not, or to check it's still the same kind of type.

For a better review experience: enable "Hide whitespace", the diff will be much smaller.

r? `@notriddle`
2025-10-24 14:53:46 +11:00
Guillaume Gomez
90c047b3d9 Replace the FxHashMap with an FxIndexMap 2025-10-23 21:45:37 +02:00
Rémy Rakic
a2b48332ba Revert "Auto merge of #146121 - Muscraft:filter-suggestion-parts, r=petrochenkov"
This reverts commit 99317ef14d, reversing
changes made to 9cd272dc85.
2025-10-23 18:18:35 +00:00
bors
11d2046fe9 Auto merge of #148022 - Zalathar:rollup-3m6ty9u, r=Zalathar
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#140463 (Document MaybeUninit bit validity)
 - rust-lang/rust#148017 (Add TidyFlags and merge DiagCtx)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-23 11:22:38 +00:00
Stuart Cook
5ff30d3daf
Rollup merge of #148017 - simp4t7:add-tidy-flags, r=Kobzol
Add TidyFlags and merge DiagCtx

Adds a struct `TidyFlags` and merges it with `DiagCtx` into `TidyCtx`. Removes the need to pass `bless` into individual check functions in tidy.
2025-10-23 22:10:15 +11:00
Guillaume Gomez
c18cd774b3 [rustdoc] Simplify module rendering and HTML tags handling 2025-10-23 12:59:29 +02:00
T
dbeb7faaed add TidyFlags and merge DiagCtx
reorder impl block

changed is_bless to is_bless_enabled
2025-10-23 08:19:38 +00:00
bors
469357eb48 Auto merge of #148014 - jhpratt:rollup-aglren3, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#134316 (Add `String::replace_first` and `String::replace_last`)
 - rust-lang/rust#147713 (Retire ast::TyAliasWhereClauses.)
 - rust-lang/rust#148011 (Revert constification of `AsRef for Cow` due to inference failure )

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-23 08:17:05 +00:00
Jacob Pratt
0185feb7db
Rollup merge of #147713 - cjgillot:where-cfg, r=fmease
Retire ast::TyAliasWhereClauses.

`ast::TyAliasWhereClauses` is a tentative to avoid forgetting predicates when manipulating the AST.
It is incompatible with `cfg` attributes on where clauses.

This PR uses a regular `WhereClause` for the "second" clause.

Fixes https://github.com/rust-lang/rust/issues/138010
cc https://github.com/rust-lang/rust/pull/138037
2025-10-23 01:22:06 -04:00
bors
4b3ba5844e Auto merge of #147793 - cjgillot:no-null-op, r=scottmcm,oli-obk
Replace NullOp::SizeOf and NullOp::AlignOf by lang items.

Part of https://github.com/rust-lang/rust/issues/146411

Fixes https://github.com/rust-lang/rust/issues/119729
Keeps https://github.com/rust-lang/rust/issues/136175 as it involves `offset_of!` which this PR does not touch.

r? `@ghost`
2025-10-23 05:09:25 +00:00
Stuart Cook
2f7e07bb4a
Rollup merge of #148001 - Muscraft:fix-diff-symbol-unchanged-lines, r=fmease
fix: Don't add diff symbol to unchanged lines

When rendering a "multi-line" suggestion with the [`Diff`](dc1feabef2/compiler/rustc_errors/src/emitter.rs (L3078)) format, `rustc` uses a [diff symbol](dc1feabef2/compiler/rustc_errors/src/emitter.rs (L3017-L3022)) for
[any line that has a highlight part](dc1feabef2/compiler/rustc_errors/src/emitter.rs (L2705-L2713)). This includes highlight parts that are highlighting nothing, i.e., a span of `0..0`. This leads `rustc` to add a diff symbol unnecessarily to lines that have no changes and are not highlighted. This PR makes it so that `rustc` will not add a diff symbol to lines that contain no changes/highlights.

Note: This PR is part of my ongoing effort to have `rustc` use `annotate-snippets` for rendering. This change will make it so that `rustc` and `annotate-snippets` will match in this case.
2025-10-23 12:06:32 +11:00
Stuart Cook
b397b6b5b7
Rollup merge of #147762 - weihanglo:rustdoc-depinfo-stdout, r=fmease
feat(rustdoc): `--emit=depinfo` output to stdout via `-`

rustdoc's `--emit=depinfo` flag now supports using `-` to write the output to stdout,
aligning with rustc's behavior.

This will fix <https://github.com/rust-lang/rust/issues/147649>.

### How to review

* The first commit demonstrates that `rustdoc --emit=depinfo=-` hasn't yet supported emitting to stdout.
* The second implements it and the diff shows how the behavior changes.
2025-10-23 12:06:32 +11:00
Camille Gillot
15c91bf308 Retire ast::TyAliasWhereClauses. 2025-10-23 00:40:01 +00:00
Camille Gillot
5dfbf67f94 Replace NullOp::SizeOf and NullOp::AlignOf by lang items. 2025-10-23 00:38:28 +00:00
Scott Schafer
c7f014ddc6
fix: Don't add diff symbol to unchanged lines 2025-10-22 15:30:57 -06:00
bors
1d23d06800 Auto merge of #147997 - jhpratt:rollup-nupruru, r=jhpratt
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#145617 (docs(style): Specify the frontmatter style)
 - rust-lang/rust#147830 (Reword unstable fingerprints ICE to ask for reproduction)
 - rust-lang/rust#147988 (Remove unused field `style` from `AttributeKind::CrateName`)
 - rust-lang/rust#147990 (Fix invalid jump to def link generated on derive attributes)
 - rust-lang/rust#147991 ([rustdoc] Check `doc(cfg())` even of private/hidden items)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-22 19:38:56 +00:00
Jacob Pratt
071b9dea8d
Rollup merge of #147991 - GuillaumeGomez:check-doc-cfg-private-hidden, r=fmease
[rustdoc] Check `doc(cfg())` even of private/hidden items

Fixes regression found out by `@fmease` [here](https://github.com/rust-lang/rust/pull/138907#discussion_r2382597615).

In short: the pass which checks the `doc(cfg())` attributes needed to be moved before the private/hidden stripping items passes.
2025-10-22 13:20:26 -04:00
Jacob Pratt
fc0370a0e3
Rollup merge of #147990 - GuillaumeGomez:fix-derive-link, r=notriddle
Fix invalid jump to def link generated on derive attributes

Fixes https://github.com/rust-lang/rust/issues/147820.

The issue was that we only handled bang macros whereas we should handle all of them.

r? `@notriddle`
2025-10-22 13:20:25 -04:00
Jacob Pratt
98632ac0f6
Rollup merge of #145617 - epage:style, r=joshtriplett
docs(style): Specify the frontmatter style

Taken from [a style team discussion](https://github.com/rust-lang/style-team/issues/212#issuecomment-3185911143).

Assumptions on my part:
- I specify that frontmatter fences should not have trailing whitespace
- We aren't specifying when to include the infostring (one idea being if there is no shebang)
- Keep it simple and have a single example instead of showing allowed several variations

Tracking issue: rust-lang/rust#136889

Closes rust-lang/style-team#212
2025-10-22 13:20:22 -04:00
bors
dc1feabef2 Auto merge of #147207 - Muscraft:anstyle-anstream, r=davidtwco
refactor: Move to anstream + anstyle for styling

`rustc` uses [`termcolor`](https://crates.io/crates/termcolor) for styling and writing, while `annotate-snippets` uses [`anstyle`](https://crates.io/crates/anstyle) for styling and currently writes directly to a `String`. When rendering directly to a terminal, there isn't/shouldn't be any differences. Still, there are differences in the escape sequences, which leads to slightly different output in JSON and SVG tests. As part of my work to have `rustc` use `annotate-snippets`, and to reduce the test differences between the two, I switched `rustc` to use `anstlye` and [`anstream`](https://crates.io/crates/anstream) for styling and writing.

The first commit migrates to `anstyle` and `anstream` and notably does not change the output. This is because it includes extra formatting to ensure that `anstyle` + `anstream` match the current output exactly. Most of this code is unnecessary, as it adds redundant resets or uses 256-color (8-bit) when it could be using 4-bit color. The subsequent commits remove this extra formatting while maintaining the correct output when rendered.

[Zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/147480-t-compiler.2Fdiagnostics/topic/annotate-snippets.20hurdles)
2025-10-22 16:22:51 +00:00
Guillaume Gomez
e1e851dc57 [rustdoc] Check doc(cfg()) even of private/hidden items 2025-10-22 17:32:20 +02:00
Guillaume Gomez
21db004f58 Fix invalid jump to def link generated on derive attributes 2025-10-22 16:59:57 +02:00
bors
4d94478977 Auto merge of #147826 - Muscraft:update-typos, r=Noratrieb
Update typos

I saw that `typos` was a few versions out of date and figured it would be a good idea to update it. Upgrading to `1.38.1` adds the [July](https://github.com/crate-ci/typos/issues/1331), [August](https://github.com/crate-ci/typos/issues/1345), and [September](https://github.com/crate-ci/typos/issues/1370) dictionary updates. As part of this change, I also sorted the configuration file.
2025-10-22 13:11:47 +00:00
bors
b2ee1b333a Auto merge of #147957 - matthiaskrgr:rollup-aqt593u, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#141445 (Add `FromIterator` impls for `ascii::Char`s to `String`s)
 - rust-lang/rust#142339 (Add NonNull pattern types)
 - rust-lang/rust#147768 (Code refactoring on hir report_no_match_method_error)
 - rust-lang/rust#147788 (const Cell methods)
 - rust-lang/rust#147932 (Create UTF-8 version of `OsStr`/`OsString`)
 - rust-lang/rust#147933 (os_str: Make platform docs more consistent)
 - rust-lang/rust#147948 (PassWrapper: Access GlobalValueSummaryInfo::SummaryList via getter for LLVM 22+)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-22 06:43:38 +00:00
Matthias Krüger
f6d324fb8d
Rollup merge of #142339 - oli-obk:not-null-pattern-types, r=BoxyUwU
Add NonNull pattern types

These are the final piece missing for

* https://github.com/rust-lang/rust/pull/136006

We cannot use the previous scheme of using an integer range for raw pointers, as we're not just changing the layout of raw pointers anymore, but also the type representation. And we can't represent "any provenance or NonZero<usize>" natively as patterns. So I created a new `!null` pattern. Since this is all unstable representation stuff for replacing rustc_layout_scalar_range_start with pattern types, the divergence from normal patterns is fine, especially since T-lang seems interested in exploring general negation patterns

r? `@BoxyUwU`
2025-10-22 07:12:09 +02:00
bors
0d7813d9a2 Auto merge of #147954 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

7 commits in 367fd9f213750cd40317803dd0a5a3ce3f0c676d..344c4567c634a25837e3c3476aac08af84cf9203
2025-10-15 15:01:32 +0000 to 2025-10-21 21:29:43 +0000
- refactor: Centralize CONTEXT style (rust-lang/cargo#16135)
- chore(triagebot): `A-json-output` for machine_message.rs (rust-lang/cargo#16133)
- refactor: JSON message with less allocations (rust-lang/cargo#16130)
- More warning conversions (rust-lang/cargo#16126)
- fix(check): Fix suggested command for bin package (rust-lang/cargo#16127)
- fix(script): Remove name sanitiztion outside what is strictly required (rust-lang/cargo#16120)
- refactor: Centralize some more styling (rust-lang/cargo#16124)

r? ghost
2025-10-22 03:32:44 +00:00
Weihang Lo
8b7f9dcdac
Update cargo submodule 2025-10-21 20:54:47 -04:00
bors
96fe3c31c2 Auto merge of #147022 - Zalathar:no-args, r=wesleywiser
Remove current code for embedding command-line args in PDB

The compiler currently has code that will obtain a list of quoted command-line arguments, and pass it through to TargetMachine creation, so that the command-line args can be embedded in PDB output.

This PR removes that code, due to subtle concerns that might not have been apparent when it was originally added.

---

Those concerns include:
- The entire command-line quoting process is repeated every time a target-machine-factory is created. In incremental builds this typically occurs 500+ times, instead of happening only once. The repeated quoting constitutes a large chunk of instructions executed in the `large-workspace` benchmark.
  - See https://github.com/rust-lang/rust/pull/146804#issuecomment-3317322958 for an example of the perf consequences of skipping all that work.
  - This overhead occurs even when building for targets or configurations that don't emit PDB output.
- Command-line arguments are obtained in a way that completely bypasses the query system, which is a problem for the integrity of incremental compilation.
  - Fixing this alone is likely to inhibit incremental rebuilds for most or all CGUs, even in builds that don't emit PDB output.
- Command-line arguments and the executable path are obtained in a way that completely bypasses the compiler's path-remapping system, which is a reproducibility hazard.
  - https://github.com/rust-lang/rust/issues/128842

---

Relevant PRs:
- https://github.com/rust-lang/rust/pull/113492
- https://github.com/rust-lang/rust/pull/130446
- https://github.com/rust-lang/rust/pull/131805
- https://github.com/rust-lang/rust/pull/146700
- https://github.com/rust-lang/rust/pull/146973

Zulip thread:
- https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Some.20PDB.20info.20bypasses.20the.20query.20system.20and.20path.20remapping/with/541432211

---

According to rust-lang/rust#96475, one of the big motivations for embedding the command-line arguments was to enable tools like Live++. [It appears that Live++ doesn't actually support Rust yet](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/embeded.20compiler.20args.20and.20--remap-path-prefix/near/523800010), so it's possible that there aren't any existing workflows for this removal to break.

In the future, there could be a case for reintroducing some or all of this functionality, guarded behind an opt-in flag so that it doesn't cause problems for other users. But as it stands, the current implementation puts a disproportionate burden on other users and on compiler maintainers.
2025-10-22 00:21:08 +00:00
Matthias Krüger
8baad706b1
Rollup merge of #147934 - Zalathar:directive, r=jieyouxu
compiletest: More directive handling tweaks

- Follow-up to rust-lang/rust#147903.

---

These are some more preparatory changes that were extracted from a larger overhaul of directive handling that I'm still working on.

---

The revision check was introduced by rust-lang/rust#61778, and later modified by rust-lang/rust#113603. It doesn't appear to be doing anything particularly load-bearing (since a bogus mode seems to cause a panic later anyway), and getting rid of it avoids the need to pass the current test revision to directive-handling code.

- rust-lang/rust#61778
- rust-lang/rust#113603

r? jieyouxu
2025-10-21 17:26:41 +02:00
Matthias Krüger
9671020233
Rollup merge of #147929 - Zalathar:target, r=jieyouxu
compiletest: Don't set `TARGET` for non run-make tests

There are a few tests that were using `TARGET` to quietly do nothing on `i586` targets, but it's cleaner to just add support for `//@ ignore-i586` instead.

This lets us get rid of an unsafe `env::set_var` in compiletest, which really should have been setting the environment variable on individual build/run subprocess commands anyway.

- The original code and tests were introduced way back in rust-lang/rust#39068
2025-10-21 17:26:40 +02:00
Oli Scherer
375899c940 Allow unsizing pattern types with pointer base 2025-10-21 11:22:51 +00:00
Oli Scherer
ad4bd083f3 Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
Zalathar
860a84c04a Remove bad-directive detection that has been subsumed by the allowlist
Now that all directive names are checked against a list of known-good names,
these ad-hoc checks can never fire.
2025-10-21 17:14:52 +11:00
Zalathar
891b8475bd Remove a confused use of revision from update_pass_mode 2025-10-21 16:52:44 +11:00
Zalathar
a58115426e Don't set TARGET for non run-make tests
If something like this is needed again in the future, please set environment
variables for the build and run subprocesses, instead of setting them on the
compiletest process.
2025-10-21 12:54:31 +11:00