304366 Commits

Author SHA1 Message Date
Vadim Petrochenkov
e26b1754cb resolve: Remove ScopeSet::Late
The difference between `Late` and `All` only matters when `finalize` is enabled.
So add a `stage` field to `Finalize` and use it instead.
2025-08-22 16:52:16 +03:00
Vadim Petrochenkov
a47c3729b4 resolve: Remove derive fallback lint id from ScopeSet::Late 2025-08-22 16:52:16 +03:00
Vadim Petrochenkov
b82b947a5c resolve: Remove Module from ScopeSet::Late
It can be passed in a more usual way through `ParentScope`
2025-08-22 16:52:16 +03:00
Vadim Petrochenkov
774d96a29f resolve: early_resolve_ident_in_lexical_scope -> resolve_ident_in_scope_set 2025-08-22 16:52:16 +03:00
Karol Zwolak
698db13cd0 improve float to_degrees/to_radians rounding comments and impl
* revise comments explaining why we are using literal or expression
* add unspecified precision comments as we don't guarantee precision
* use expression in `f128::to_degrees()`
* make `f64::to_degrees()` impl consistent with other functions
2025-08-22 15:42:01 +02:00
Philipp Krones
9a348e8da8
Merge commit '877967959ae8da9814df4f2614971f4d784bf53f' into clippy-subtree-update 2025-08-22 14:57:22 +02:00
Philipp Krones
877967959a
Rustup (#15531)
Letting rustbot assign a reviewer, so that someone can double check
9de86f40d7e1a2cbcc308e39fdbc7447d691c527.

changelog: none
2025-08-22 12:36:32 +00:00
Philipp Krones
60374e257a
Bump nightly version -> 2025-08-22 2025-08-22 14:26:37 +02:00
Philipp Krones
9de86f40d7
Dogfood fixes 2025-08-22 14:26:24 +02:00
Philipp Krones
567b65e537
Ignore unexpected_cfgs warning for bootstrap 2025-08-22 14:25:53 +02:00
Philipp Krones
284b596ac4
Merge remote-tracking branch 'upstream/master' into rustup 2025-08-22 14:25:23 +02:00
lcnr
17ac2fc96d change HIR typeck unification handling approach 2025-08-22 13:39:38 +02:00
Amanda Stjerna
7dd56b10ad Region inference: Use outlives-static constraints in constraint search
Revise the extra `r: 'static` constraints added upon universe issues
to add an explanation, and use that explanation during constraint blame
search. This greatly simplifies the region inference logic, which
now does not need to reverse-engineer the event that caused a region
to outlive 'static.
2025-08-22 13:38:22 +02:00
bors
f5703d5dd3 Auto merge of #144689 - JonathanBrouwer:share_parse_path, r=jdonszelmann
Rewrite the new attribute argument parser

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

This rewrites the parser, should improve performance and maintainability.
This can be reviewed commit by commit
2025-08-22 10:27:12 +00:00
Jakub Beránek
c058ce594b
Sort Config fields and remove some muts from bindings 2025-08-22 12:08:58 +02:00
Josh Triplett
52fadd8f96 Migrate BuiltinLintDiag::HiddenUnicodeCodepoints to use LintDiagnostic directly 2025-08-22 03:01:35 -07:00
Josh Triplett
863387ca6a Remove unused BuiltinLintDiag variant InnerAttributeUnstable
This variant doesn't appear to have ever been used.

There's a matching message in `rustc_resolve`, that used to have a FIXME
for porting it to the new diagnostic infrastructure, but that message is
using `feature_err`, which doesn't use buffered lints. Thus, even when
that does get ported, it won't use `BuiltinLintDiag`.
2025-08-22 02:14:21 -07:00
Josh Triplett
690a5782f8 Migrate BuiltinLintDiag::MissingAbi to use LintDiagnostic directly 2025-08-22 02:01:01 -07:00
Josh Triplett
b5c714cfc1 Migrate BuiltinLintDiag::UnexpectedBuiltinCfg to use LintDiagnostic directly 2025-08-22 02:01:01 -07:00
Josh Triplett
c99320156d Refactor lint buffering to avoid requiring a giant enum
Lint buffering currently relies on a giant enum `BuiltinLintDiag`
containing all the lints that might potentially get buffered. In
addition to being an unwieldy enum in a central crate, this also makes
`rustc_lint_defs` a build bottleneck: it depends on various types from
various crates (with a steady pressure to add more), and many crates
depend on it.

Having all of these variants in a separate crate also prevents detecting
when a variant becomes unused, which we can do with a dedicated type
defined and used in the same crate.

Refactor this to use a dyn trait, to allow using `LintDiagnostic` types
directly.

This requires boxing, but all of this is already on the slow path
(emitting an error).

Because the existing `BuiltinLintDiag` requires some additional types in
order to decorate some variants, which are only available later in
`rustc_lint`, use an enum `DecorateDiagCompat` to handle both the `dyn
LintDiagnostic` case and the `BuiltinLintDiag` case.
2025-08-22 01:59:56 -07:00
Philipp Krones
6d89c55e1a
Fixunnecessary_safety_comment does not lint for the first line (#15354)
Closes rust-lang/rust-clippy#14553
Closes rust-lang/rust-clippy#14554

changelog: [`unnecessary_safety_comment`] fix FN for the first line in
file
2025-08-22 08:33:46 +00:00
Ralf Jung
78bdd86c67 miri: also detect aliasing of in-place argument and return place 2025-08-22 10:21:33 +02:00
WANG Rui
d61353ff43 tests: Ignore basic-stepping.rs on LoongArch 2025-08-22 15:58:52 +08:00
bors
831e291d3b Auto merge of #145358 - Kobzol:symbol-name-sort, r=nnethercote
Sort mono items by symbol name

Trying to claw back cycles/branch/cache miss losses from https://github.com/rust-lang/rust/pull/144722.
2025-08-22 07:13:07 +00:00
Jonathan Brouwer
ec5b2cce8e
Updated uitests for new parser 2025-08-22 08:58:45 +02:00
Jonathan Brouwer
17e34f6b24
Use the new attribute parser throughout the codebase 2025-08-22 08:58:45 +02:00
Philipp Krones
e408b25c42
chore: remove redundant word in comment (#15530)
remove redundant word in comment
changelog: none
2025-08-22 06:42:57 +00:00
xihuwenhua
e1d4f099e5 doc: fix some typos in comment
Signed-off-by: xihuwenhua <xihuwenhua@outlook.com>
2025-08-22 14:42:26 +08:00
Jonathan Brouwer
549314bdb7
Rewrite the new attribute parser 2025-08-22 08:38:37 +02:00
xihuwenhua
ffbbbdc381 chore: remove redundant word in comment
Signed-off-by: xihuwenhua <xihuwenhua@outlook.com>
2025-08-22 14:37:42 +08:00
Jonathan Brouwer
21d3189779
Move validate_attr to rustc_attr_parsing 2025-08-22 08:37:19 +02:00
Deadbeef
4970127c33 address review comments 2025-08-22 13:16:44 +08:00
Deadbeef
30bb7045d6 don't print invalid labels with r# 2025-08-22 12:58:37 +08:00
Deadbeef
1e5b5ba1e7 print raw lifetime idents with r# 2025-08-22 12:58:37 +08:00
bors
d127901d94 Auto merge of #145410 - cuviper:expand-stack, r=lqd
rustc_expand: ensure stack in `InvocationCollector::visit_expr`

In Fedora, when we built rustc with PGO on ppc64le, we started failing
the test `issue-74564-if-expr-stack-overflow.rs`. This could also be
reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so
it's probably just unlucky that ppc64le PGO created a large stack frame
somewhere in this recursion path. Adding an `ensure_sufficient_stack`
solves the stack overflow.

Historically, that test and its fix were added in rust-lang/rust#74708,
which was also an `ensure_sufficient_stack` in this area of code at the
time. However, the refactor in rust-lang/rust#92573 basically left that
to the general `MutVisitor`, and then rust-lang/rust#142240 removed even
that ensure call. It may be luck that our tier-1 tested targets did not
regress the original issue across those refactors.
2025-08-22 04:05:26 +00:00
binarycat
6c22ef501e typecheck window.NOTABLE_TRAITS 2025-08-21 22:42:37 -05:00
binarycat
4b73a7ec78 typecheck window.rr_ 2025-08-21 22:19:46 -05:00
binarycat
5d28ce45ca typecheck window.searchIndex 2025-08-21 22:08:11 -05:00
Camille Gillot
689171d38e Uplift rustc_mir_transform::coverage::counters::union_find to rustc_data_structures. 2025-08-22 02:22:51 +00:00
binarycat
401f40f1c1 tests/rustdoc-js-std/parser-errors.js: remove syntax that is now valid 2025-08-21 20:50:33 -05:00
Josh Triplett
42d6330509 triagebot: Update style team reviewers 2025-08-21 18:37:39 -07:00
Camille Gillot
e5bd01b533 Correct comments. 2025-08-21 23:59:20 +00:00
Luca Versari
291da71b2a Add an experimental unsafe(force_target_feature) attribute.
This uses the feature gate for
https://github.com/rust-lang/rust/issues/143352, but is described in
https://github.com/rust-lang/rfcs/pull/3820 which is strongly tied to
the experiment.
2025-08-22 01:26:26 +02:00
bors
8e3710ef31 Auto merge of #145728 - jhpratt:rollup-nwbw8de, r=jhpratt
Rollup of 16 pull requests

Successful merges:

 - rust-lang/rust#137494 (libstd: init(): dup() subsequent /dev/nulls instead of opening them again)
 - rust-lang/rust#144541 (c-variadic: multiple ABIs in the same program for arm)
 - rust-lang/rust#144613 (aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON).)
 - rust-lang/rust#144780 (Add a method to dump MIR in the middle of MIR building)
 - rust-lang/rust#145137 (Consolidate panicking functions in `slice/index.rs`)
 - rust-lang/rust#145507 (Refactor attribute parsing to improve ergonomics and some diagnostics)
 - rust-lang/rust#145604 (Gate static closures behind a parser feature)
 - rust-lang/rust#145648 (Add two tidy dependency checks)
 - rust-lang/rust#145661 (update some s390x codegen tests)
 - rust-lang/rust#145672 (Instantiate higher-ranked binder with erased when checking `IntoIterator` predicate for query instability)
 - rust-lang/rust#145689 (Migrate `panic_unwind` to use `cfg_select!`)
 - rust-lang/rust#145700 (Handle `ReEarlyParam` in `type_name`.)
 - rust-lang/rust#145703 (Remove MIPS targets from CI LLVM platforms)
 - rust-lang/rust#145704 (ci: don't cleanup windows disk)
 - rust-lang/rust#145705 (remove an `as` cast in prefetch codegen)
 - rust-lang/rust#145712 (Update outdated link in bound region comments)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-21 22:57:46 +00:00
binarycat
3501e4f3f2 rustdoc: add tests for raw pointers in type-based search 2025-08-21 17:50:12 -05:00
binarycat
eeaad503df unbox raw pointers in type-based search 2025-08-21 17:50:12 -05:00
binarycat
ae9845fbc9 add special formatting for displaying raw pointers in signatures 2025-08-21 17:50:08 -05:00
binarycat
4b730a2010 rustdoc search: accept *mut T syntax for raw pointers 2025-08-21 17:49:54 -05:00
Timo
9759df6924
renamed_function_params: clean-up a bit (#15524)
changelog: none
2025-08-21 22:39:14 +00:00
Ada Alakbarova
27b2c5dd65
renamed_function_params: clean-up a bit
use `iter::zip`

use `Option::filter`

use `Option::is_some_and`

match in two steps
2025-08-22 00:22:33 +02:00