Commit Graph

48659 Commits

Author SHA1 Message Date
Jana Dönszelmann
2e7e52e07c detect when variants have the same name as an associated function 2025-06-12 12:26:27 +02:00
Stypox
781baafbe4 Add documentation for init_logger_with_additional_layer 2025-06-12 12:11:15 +02:00
Oli Scherer
de4e7adc96 Don't hardcode the intrinsic return types twice in the compiler 2025-06-12 09:57:06 +00:00
Deadbeef
5f0dd44b3b avoid &mut P<T> in visit_expr etc methods 2025-06-12 17:36:03 +08:00
Jana Dönszelmann
e2afe04e2e remove 'static in some places 2025-06-12 09:57:38 +02:00
Trevor Gross
841f7ce69a Make missing_fragment_specifier an unconditional error
This was attempted in [1] then reverted in [2] because of fallout.
Recently, this was made an edition-dependent error in [3].

Make missing fragment specifiers an unconditional error again.

[1]: https://github.com/rust-lang/rust/pull/75516
[2]: https://github.com/rust-lang/rust/pull/80210
[3]: https://github.com/rust-lang/rust/pull/128006
2025-06-12 07:57:12 +00:00
Jana Dönszelmann
e6a5f281ec add error message for unused duplicate 2025-06-12 09:56:47 +02:00
Jana Dönszelmann
6072207a11 introduce new lint infra
lint on duplicates during attribute parsing
To do this we stuff them in the diagnostic context to be emitted after
hir is constructed
2025-06-12 09:56:47 +02:00
Jonathan Dönszelmann
4e1b6d13a2 Start using new diagnostic logic on all existing single parsers 2025-06-12 09:42:45 +02:00
Jana Dönszelmann
28bf61b9b3 introduce duplicate attribute diagnostic logic 2025-06-12 09:42:45 +02:00
Urgau
fafc0f249f Report the unpredictable_function_pointer_comparisons lint in macro 2025-06-12 07:33:56 +02:00
Nicholas Nethercote
bdfe1b9fb0 Overhaul the thousands module.
It currently only inserts separators into `usize`s, because that's all
that has been needed so far. `-Zmacro-stats` will need `isize` and `f64`
handling, so this commit adds that.
2025-06-12 15:26:06 +10:00
Nicholas Nethercote
fb73893e51 Add some useful Path/PathSegment equality operations.
They will be used in a subsequent commit.
2025-06-12 15:26:06 +10:00
Matthias Krüger
240776176b Rollup merge of #142352 - workingjubilee:c-int-width-is-an-integer, r=wesleywiser
compiler: Make `c_int_width` an integer

Because it is.

That's all I got.
2025-06-12 03:14:54 +02:00
Matthias Krüger
78d83952e4 Rollup merge of #142318 - Urgau:cleanup-rust-src-remap, r=jieyouxu
Cleanup `rust-src` remapping and real dir

When remapping, `bootstrap` sets `CFG_VIRTUAL_RUST_SOURCE_BASE_DIR` to indicate what the base build dir (`/` of this repo) was remapped to, ie. `/rustc/...`.

It is therefore impossible when stripping `/rustc/...` from a remapped path to be inside the our `library/` directory, nevertheless we have code that assumed it was possible and helpfully tried to correct it. I don't why this was done, but it's not necessary.

~~The normalization in compiletest of `$SRC_DIR_REAL` was also slightly wrong, it ate the `library` part for no reason.~~ EDIT: there is a reason, it affects too much tests otherwise

r? `@jieyouxu`
2025-06-12 03:14:53 +02:00
Matthias Krüger
75c186bf43 Rollup merge of #142261 - folkertdev:unstable-attr-correct-edition, r=compiler-errors
use correct edition when warning for unsafe attributes

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

If an attribute is re-emitted by a macro, the incorrect edition was used to emit warnings for unsafe attributes.

This logic was introduced in https://github.com/rust-lang/rust/pull/139718

cc `@compiler-errors` `@ehuss`
2025-06-12 03:14:52 +02:00
Matthias Krüger
2d9513b98c Rollup merge of #142157 - Enselic:trivial-anon-const-use-cases, r=compiler-errors
rustc_resolve: Improve `resolve_const_param_in_non_trivial_anon_const` wording

In some contexts, const expressions are OK. Add a `here` to the error message to clarify this.

Closes rust-lang/rust#79429 which has 15 x 👍
2025-06-12 03:14:51 +02:00
Matthias Krüger
bdf7b74517 Rollup merge of #142040 - jswrenn:transmute-ty-region-generic, r=compiler-errors
transmutability: shift abstraction boundary

Previously, `rustc_transmute`'s layout representations were genericized over `R`, a reference. Now, it's instead genericized over representations of type and region. This allows us to move reference transmutability logic from `rustc_trait_selection` to `rustc_transmutability` (and thus unit test it independently of the compiler), and — in a follow-up PR — will make it possible to support analyzing function pointer transmutability with minimal surgery.

r? `@compiler-errors`
2025-06-12 03:14:49 +02:00
Matthias Krüger
9f6e81c202 Rollup merge of #141307 - b-naber:closure-body, r=celinval
Add method to retrieve body of closure in stable-mir

fixes https://github.com/rust-lang/project-stable-mir/issues/85

r? `@celinval`
2025-06-12 03:14:49 +02:00
Celina G. Val
f52c6eee02 Another round of tidy / warning fixes 2025-06-11 16:56:01 -07:00
beetrees
eb472e77cd Apply ABI attributes on return types in rustc_codegen_cranelift 2025-06-12 00:47:01 +01:00
Camille GILLOT
a5ff3cc3f5 Do not clone Arc when hashing span. 2025-06-11 23:44:22 +00:00
Matthias Krüger
f417620160 Rollup merge of #142369 - jdonszelmann:attr-docs, r=fmease
Improve some attribute docs and rename groups

r? `@nnethercote`

Some naming here got changed at some point, and this feels more consistent. The docs changes were a direct response to `@mejrs` trying to implement a new parsers and running into this.
2025-06-11 22:58:29 +02:00
Matthias Krüger
e78b619cad Rollup merge of #142362 - Veykril:push-rzmrsswqourz, r=oli-obk
Add expectation for `{` when parsing lone coroutine qualifiers

Fixes https://github.com/rust-lang/rust/issues/80931
2025-06-11 22:58:28 +02:00
Matthias Krüger
e2846d6b75 Rollup merge of #142356 - Stypox:fix-enter_trace_span, r=RalfJung
Fix enter_trace_span!() using wrong $crate paths

This is a followup to rust-lang/rust#140972, where I made a silly mistake and forgot to update `$crate::interpret::tracing_utils::...` to `$crate::interpret::util::...` inside the macro after moving the referenced code from `tracing_utils.rs` to `util.rs`. Sorry about this.

r? `@RalfJung`
2025-06-11 22:58:28 +02:00
Matthias Krüger
b29c9a3588 Rollup merge of #142305 - GuillaumeGomez:remove-visit_id-EarlyContextAndPass, r=oli-obk
Remove unneeded `check_id` calls as they are already called in `visit_id` in `EarlyContextAndPass` type

Follow-up from [this message](https://github.com/rust-lang/rust/pull/142240/files#r2137474724).

Since `check_id` is already called in `visit_id` which is supposed to be called for each item with an ID, we don't need to manually call `check_id`.

r? `@oli-obk`
2025-06-11 22:58:26 +02:00
Celina G. Val
4aa62ea9e9 Use rustc_thread_pool instead of rustc-rayon-core 2025-06-11 12:26:42 -07:00
sayantn
d56fcd968d Simplify implementation of Rust intrinsics by using type parameters in the cache 2025-06-12 00:32:42 +05:30
Celina G. Val
0b9b1df006 Fix format and tidy for code moved from rayon 2025-06-11 11:12:32 -07:00
bors
e703dff8fe Auto merge of #142358 - matthiaskrgr:rollup-fxe6m7k, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#141967 (Configure bootstrap backport nominations through triagebot)
 - rust-lang/rust#142042 (Make E0621 missing lifetime suggestion verbose)
 - rust-lang/rust#142272 (tests: Change ABIs in tests to more future-resilient ones)
 - rust-lang/rust#142282 (Only run `citool` tests on the `auto` branch)
 - rust-lang/rust#142297 (Implement `//@ needs-target-std` compiletest directive)
 - rust-lang/rust#142298 (Make loongarch-none target maintainers more easily pingable)
 - rust-lang/rust#142306 (Dont unwrap and re-wrap typing envs)
 - rust-lang/rust#142324 (Remove unneeded `FunctionCx` from some codegen methods)
 - rust-lang/rust#142328 (feat: Add `bit_width` for unsigned integer types)

Failed merges:

 - rust-lang/rust#141639 (Expose discriminant values in stable_mir)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-06-11 17:51:57 +00:00
Celina G. Val
35c5144394 Move rayon-core to rustc_thread_pool files as is
This commit literally copied the directory rayon-core from
revision `5fadf44`. Link:
https://github.com/rust-lang/rustc-rayon/tree/5fadf44/rayon-core
2025-06-11 10:43:59 -07:00
Jubilee Young
86493f75a5 compiler: Avoid reporting unsupported_calling_conventions in deps 2025-06-11 09:55:41 -07:00
Jana Dönszelmann
ce0438684d consistently rename (old) attribute groups 2025-06-11 18:46:57 +02:00
Jana Dönszelmann
34241e5397 document attribute parsers better 2025-06-11 18:46:57 +02:00
Lukas Wirth
edc405d383 Add expectation for { when parsing lone coroutine qualifiers 2025-06-11 17:11:58 +02:00
Boxy
fe04ae7faf stabilize gai 2025-06-11 15:30:15 +01:00
Matthias Krüger
b1c668ca03 Rollup merge of #142324 - scottmcm:less-functioncx, r=workingjubilee
Remove unneeded `FunctionCx` from some codegen methods

No changes; just removing the `self` that wasn't needed.

r? workingjubilee
cc https://github.com/rust-lang/rust/pull/138759#issuecomment-2920860686
2025-06-11 13:48:13 +02:00
Matthias Krüger
9ef19ddfd8 Rollup merge of #142306 - compiler-errors:nit-reveal-param-env-query, r=lcnr
Dont unwrap and re-wrap typing envs

Just a tiny tweak to make the query less awkward.

r? lcnr
2025-06-11 13:48:12 +02:00
Matthias Krüger
58d80b6d05 Rollup merge of #142042 - estebank:explicit-lifetime-verbose-suggestion, r=compiler-errors
Make E0621 missing lifetime suggestion verbose

```
error[E0621]: explicit lifetime required in the type of `x`
  --> $DIR/42701_one_named_and_one_anonymous.rs:10:9
   |
LL |         &*x
   |         ^^^ lifetime `'a` required
   |
help: add explicit lifetime `'a` to the type of `x`
   |
LL | fn foo2<'a>(a: &'a Foo, x: &'a i32) -> &'a i32 {
   |                             ++
```

Part of rust-lang/rust#141973.
2025-06-11 13:48:09 +02:00
bors
bdb04d6c4f Auto merge of #141763 - lcnr:fixme-gamer, r=BoxyUwU
`FIXME(-Znext-solver)` triage

r? `@BoxyUwU`
2025-06-11 11:47:05 +00:00
Stypox
cd04717899 Fix enter_trace_span!() using wrong $crate paths 2025-06-11 12:22:20 +02:00
lcnr
a48c08546c move fast reject into inner
to also fast reject inside of the folder
2025-06-11 12:13:57 +02:00
Stypox
fc96ca8bba Use closure to allow passing custom tracing layers
The previous method, where a layer would be passed directly,
required to pass a "no-op" layer when no custom layer was needed.
This should have in theory worked, however having a no-op layer
seems to change the way the tracing lib applies filters internally,
leading to some debug!() being printed despite them being out of
the minimum level for the filters. Note however that this behavior
was very inconsistent, and e.g. some debug!() would get printed
and some others wouldn't, for no apparent reason.
2025-06-11 10:42:50 +02:00
Stypox
0d74252537 Allow initializing logger with additional tracing Layer 2025-06-11 10:41:22 +02:00
bors
0a39445252 Auto merge of #141942 - ShoyuVanilla:smir-repr, r=oli-obk
Implement representation options to smir

Resolves rust-lang/project-stable-mir#89
2025-06-11 07:45:07 +00:00
Jubilee Young
87feee9ad5 compiler: Update all targets to the new c_int_width type 2025-06-11 00:42:14 -07:00
Jubilee Young
b88c0061c4 compiler: Change c_int_width to be an integer type 2025-06-11 00:42:14 -07:00
Urgau
208f2e461c Remove useless and wrong std crates special casing when un-remap sysroot 2025-06-11 07:42:58 +02:00
bors
2b0274c71d Auto merge of #142090 - compiler-errors:perf-stable-root-var, r=lcnr
Make root vars more stable

Never resolve a ty/ct vid to a higher vid as its root. This should make the optimization in rust-lang/rust#141500 more "stable" when there are a lot of vars flying around.

r? `@ghost`
2025-06-11 03:34:30 +00:00
bors
1c047506f9 Auto merge of #141883 - oli-obk:remove-check-mod-loops, r=nnethercote
Remove check_mod_loops query and run the checks per-body instead

This analysis is older than my first rustc contribution I believe. It was never querified. Ideally we'd merge it into the analysis happening within typeck anyway (typeck just uses span_delayed_bug instead of erroring), but I didn't want to do that within this PR that also moves things around and subtly changes diagnostic ordering.
2025-06-10 23:54:45 +00:00