Commit Graph

49486 Commits

Author SHA1 Message Date
Sasha Pourcelot
1e271d6ed1 Allow function argument mismatch suggestion to be multiline 2025-08-06 19:17:36 +02:00
bors
29cdc6a109 Auto merge of #145003 - Kobzol:rollup-kgb216b, r=Kobzol
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#144552 (Rehome 33 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
 - rust-lang/rust#144676 (Add documentation for unstable_feature_bound)
 - rust-lang/rust#144836 (Change visibility of Args new function)
 - rust-lang/rust#144910 (Add regression tests for seemingly fixed issues)
 - rust-lang/rust#144913 ([rustdoc] Fix wrong `i` tooltip icon)
 - rust-lang/rust#144924 (compiletest: add hint for when a ui test produces no errors)
 - rust-lang/rust#144926 (Correct the use of `must_use` on btree::IterMut)
 - rust-lang/rust#144928 (Drop `rust-version` from `rustc_thread_pool`)
 - rust-lang/rust#144945 (Autolabel PRs that change explicit tail call tests as `F-explicit_tail_calls`)
 - rust-lang/rust#144954 (run-make: Allow blessing snapshot files that don't exist yet)
 - rust-lang/rust#144971 (num: Rename `isolate_most_least_significant_one` functions)
 - rust-lang/rust#144978 (Fix some doc links for intrinsics)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-06 16:17:02 +00:00
Scott McMurray
c396521fd3 [codegen] assume the tag, not the relative discriminant 2025-08-06 09:11:35 -07:00
bjorn3
e2acc6c5f4 Avoid using unadjusted ABI for the thread-local shim
This restricts the uses of the unadjusted ABI to LLVM intrinsics. The
Rust ABI works fine for the thread-local shim as it always returns
pointers directly like the backend expects.
2025-08-06 16:05:30 +00:00
bjorn3
b0619327ef Change adjust_for_rust_scalar into arg_attrs_for_rust_scalar
Directly creating the ArgAttributes rather than adjusting one is a bit
clearer.
2025-08-06 16:05:30 +00:00
Amanda Stjerna
648e3fc393 Track names of existentials 2025-08-06 16:58:42 +02:00
Amanda Stjerna
61e8869ed9 Proposed format 2025-08-06 16:35:20 +02:00
bjorn3
ee38bc06ce Remove unused field from ModuleConfig 2025-08-06 14:13:49 +00:00
bjorn3
2472d19625 Include allocator module in LLVM_passes timer 2025-08-06 14:13:48 +00:00
Jakub Beránek
d54fb8364d Rollup merge of #144928 - cuviper:rustc_thread_pool-msrv, r=lqd
Drop `rust-version` from `rustc_thread_pool`

The current `rust-version = "1.63"` was inherited from rayon, but it
doesn't make sense to limit this in the compiler workspace. Having any
setting at all has effects on tools like `cargo info` that try to infer
the MSRV when the workspace itself doesn't specify it. Since we are the
compiler, our only MSRV is whatever bootstrapping requires.
2025-08-06 15:55:47 +02:00
xizheyin
6e7b9d5149 Introduce ModernIdent type to unify macro 2.0 hygiene handling
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-08-06 21:19:09 +08:00
bors
8fb40f798a Auto merge of #143679 - sebastianpoeplau:preserve-debug-gdb-scripts-section, r=bjorn3
Preserve the .debug_gdb_scripts section

Make sure that compiler and linker don't optimize the section's contents
away by adding the global holding the data to `llvm.used`. This
eliminates the need for a volatile load in the main shim; since the LLVM
codegen backend is the only implementer of the corresponding trait
function, remove it entirely.

Pretty printers in dylib dependencies are now emitted by the main crate
instead of the dylib; apart from matching how rlibs are handled, this
approach has the advantage that `omit_gdb_pretty_printer_section` keeps
working with dylib dependencies.

r? `@bjorn3`
2025-08-06 13:02:36 +00:00
dianqk
d55cc9a9bd mir: Do not modify NonUse in super_projection_elem 2025-08-06 20:41:39 +08:00
Zalathar
81ed042c8c coverage: Remove all unstable support for MC/DC instrumentation 2025-08-06 22:38:52 +10:00
dianqk
2909de557c simplifycfg: Mark as changed when start is modified in collapse goto chain 2025-08-06 20:26:10 +08:00
Boxy
9ccc9f177e replace version placeholder 2025-08-06 13:22:38 +01:00
Sebastian Poeplau
b4d923cea0 Embed GDB pretty printers in rlibs and dylibs
Instead of collecting pretty printers transitively when building
executables/staticlibs/cdylibs, let the debugger find each crate's
pretty printers via its .debug_gdb_scripts section. This covers the case
where libraries defining custom pretty printers are loaded dynamically.
2025-08-06 13:24:43 +02:00
Amanda Stjerna
bcefc2ee97 Add annotations to the graphviz region graph on region origins
This adds
- (ex) for regions whose origin is existential,
- (p) for regoins whose origin is a placeholder, and
- (p for <name>) if the originating placeholder is named.

This has helped _my_ debugging and it doesn't create too bad clutter, I feel.

The change is ridiculously small, but I turned it into a separate PR so we can bikeshed the format.
2025-08-06 11:12:51 +02:00
Nicholas Nethercote
42a1042f9b Rename some PrettyPrinter methods.
More consistency.
2025-08-06 12:58:23 +10:00
Nicholas Nethercote
b8adda6194 Rename some Printer methods.
I find these name clearer, and starting them all with `print_` makes
things more consistent.
2025-08-06 12:58:20 +10:00
Nicholas Nethercote
69bcd79ab7 Move should_truncate from trait Printer to sub-trait PrettyPrinter.
It's not used in `Printer`.
2025-08-06 10:08:43 +10:00
Nicholas Nethercote
dfd38f0d36 Add comments to Printer.
These details took me some time to work out.
2025-08-06 10:08:41 +10:00
León Orell Valerian Liehr
02ea38cfff Fortify generic param default checks 2025-08-06 01:26:26 +02:00
Jens Reidel
070425e54d Add aarch64_be-unknown-none-softfloat target
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-08-05 21:18:18 +02:00
bors
ec7c026125 Auto merge of #144863 - cjgillot:live-or-dead, r=Urgau
Simplify dead code lint

This PR scratches a few itches I had when looking at that code.

The perf improvement comes from keeping the `scanned` set through several marking phases. This pretty much divides by 2 the number of HIR traversals.
2025-08-05 18:10:21 +00:00
lcnr
ea2c0802b5 we only merge candidates for trait and normalizes-to goals 2025-08-05 14:57:37 +02:00
León Orell Valerian Liehr
092c6f3a18 Gate const trait syntax 2025-08-05 14:52:02 +02:00
Vadim Petrochenkov
33cb4190a2 Mark all deprecation lints in name resolution as deny-by-default and report-in-deps 2025-08-05 15:28:49 +03:00
Nicholas Nethercote
d76eef481e Simplify multiple things.
- `same_path` can just be a `bool`.
- `expected` and `found` are only needed inside the block.
- Neaten a comment.
2025-08-05 19:11:37 +10:00
Nicholas Nethercote
b0c36dd4c7 Rename most of the printers.
Three of them are named `AbsolutePathPrinter`, which is confusing, so
give those names that better indicate how they are used. And then there
is `SymbolPrinter` and `SymbolMangler`, which are renamed as
`LegacySymbolMangler` and `V0SymbolMangler`, better indicating their
similarity.
2025-08-05 19:11:37 +10:00
Nicholas Nethercote
566cdab16d Clarify value_path_str_with_args.
The use of `print_value_path` means the value namespace is always used
and the `guess_def_namespace` call is unnecessary. This commit removes
the `guess_def_namespace` call and hard-codes `ValueNS`. It also changes
the `print_value_path` to `print_def_path` for consistency with
`def_path_str_with_args`.
2025-08-05 19:11:37 +10:00
Sebastian Poeplau
868bdde25b Preserve the .debug_gdb_scripts section
Make sure that compiler and linker don't optimize the section's contents
away by adding the global holding the data to "llvm.used". The volatile
load in the main shim is retained because "llvm.used", which translates
to SHF_GNU_RETAIN on ELF targets, requires a reasonably recent linker;
emitting the volatile load ensures compatibility with older linkers, at
least when libstd is used.

Pretty printers in dylib dependencies are now emitted by the main crate
instead of the dylib; apart from matching how rlibs are handled, this
approach has the advantage that `omit_gdb_pretty_printer_section` keeps
working with dylib dependencies.
2025-08-05 10:55:07 +02:00
Scott McMurray
4e81ecaf3a Let RemoveUnneededDrops also remove drop_in_place 2025-08-04 23:54:39 -07:00
Kivooeo
d09cf616f7 Added checks for attribute in type case 2025-08-05 07:10:31 +05:00
Samuel Tardieu
5c11681820 Rollup merge of #144920 - compiler-errors:span-arg, r=lqd
Dont print arg span in MIR dump for tail call

r? WaffleLapkin

This makes the MIR dump for tail call terminators consistent w/ regular calls.
2025-08-05 03:51:42 +02:00
Samuel Tardieu
58a7b873cf Rollup merge of #144890 - WaffleLapkin:project_fields, r=lcnr
Add `InterpCx::project_fields`

I was hoping for a much bigger improvement and this is lukewarm at best ^^'

Still, I think this makes sense.
2025-08-05 03:51:40 +02:00
Samuel Tardieu
7ad5281f3b Rollup merge of #144877 - Zalathar:coverage-various, r=lcnr
coverage: Various small cleanups

This PR is a collection of small coverage-related changes that I accumulated while working towards other coverage improvements.

Each change should hopefully be fairly straightforward.
2025-08-05 03:51:39 +02:00
Samuel Tardieu
149ee59876 Rollup merge of #144866 - JonathanBrouwer:should_emit_fix, r=jdonszelmann
Remove `SHOULD_EMIT_LINTS` in favor of `should_emit`

r? ``@jdonszelmann``
2025-08-05 03:51:37 +02:00
Samuel Tardieu
eee8d775fe Rollup merge of #144817 - WaffleLapkin:reject-referety, r=Urgau
Properly reject tail calls to `&FnPtr` or `&FnDef`

Fixes rust-lang/rust#144795
2025-08-05 03:51:36 +02:00
Samuel Tardieu
a1e41a0227 Rollup merge of #144776 - nnethercote:Printer-cleanups, r=cjgillot
`Printer` cleanups

The trait `Printer` is implemented by six types, and the sub-trait `PrettyPrinter` is implemented by three of those types. The traits and the impls are complex and a bit of a mess. This PR starts to clean them up.

r? ``@davidtwco``
2025-08-05 03:51:34 +02:00
Samuel Tardieu
4cb0ebd24f Rollup merge of #144741 - ShoyuVanilla:tilde-const-in-block, r=fee1-dead
fix: Error on illegal `[const]`s inside blocks within legal positions

Fixes rust-lang/rust#132067

I initially considered moving `[const]` validations to `rustc_ast_lowering`, but that approach would require adding constness information to `AssocCtxt`, which introduces significant changes - especially within `rustc_expand` - just to support a single use case here:

3fb1b53a9d/compiler/rustc_ast_passes/src/ast_validation.rs (L1596-L1610)

Instead, I believe it's sufficient to simply "reset" `[const]` allowness whenever we enter a new block.
2025-08-05 03:51:34 +02:00
Camille GILLOT
d5f2260bd3 Add doc-comment. 2025-08-04 23:07:15 +00:00
Camille GILLOT
d0da6ca110 Update doc-comment. 2025-08-04 23:02:27 +00:00
Camille GILLOT
e0a89c4b14 Simplify maybe_record_as_seed. 2025-08-04 23:00:45 +00:00
Josh Stone
81edf2beba Drop rust-version from rustc_thread_pool
The current `rust-version = "1.63"` was inherited from rayon, but it
doesn't make sense to limit this in the compiler workspace. Having any
setting at all has effects on tools like `cargo info` that try to infer
the MSRV when the workspace itself doesn't specify it. Since we are the
compiler, our only MSRV is whatever bootstrapping requires.
2025-08-04 15:03:49 -07:00
Michael Goulet
878acaa795 Dont print arg span in MIR dump for tail call 2025-08-04 18:35:43 +00:00
Esteban Küber
2db126d651 Include whitespace in "remove |" suggestion and make it hidden 2025-08-04 18:06:18 +00:00
Michael Goulet
a573fd958e Don't actually pass BB to check_call_dest 2025-08-04 17:26:18 +00:00
Esteban Küber
91e606b715 Tweak auto trait errors
Make suggestions to remove params and super traits tool-only, and make
the suggestion span more accurate.

```
error[E0567]: auto traits cannot have generic parameters
  --> $DIR/auto-trait-validation.rs:6:19
   |
LL | auto trait Generic<T> {}
   |            -------^^^
   |            |
   |            auto trait cannot have generic parameters

error[E0568]: auto traits cannot have super traits or lifetime bounds
  --> $DIR/auto-trait-validation.rs:8:20
   |
LL | auto trait Bound : Copy {}
   |            -----   ^^^^
   |            |
   |            auto traits cannot have super traits or lifetime bounds
```

```
error[E0380]: auto traits cannot have associated items
  --> $DIR/issue-23080.rs:5:8
   |
LL | unsafe auto trait Trait {
   |                   ----- auto traits cannot have associated items
LL |     fn method(&self) {
   |        ^^^^^^
```
2025-08-04 17:20:07 +00:00
Sasha Pourcelot
904e2af3a9 Port #[coroutine] to the new attribute system
Related to https://github.com/rust-lang/rust/issues/131229#issue-2565886367.
2025-08-04 18:37:40 +02:00