Commit graph

308340 commits

Author SHA1 Message Date
Philipp Krones
8c4be66084
Update Cargo.lock 2025-10-06 18:10:44 +02:00
Philipp Krones
843f4d8488 Merge commit '2dc84cb744' into clippy-subtree-update 2025-10-06 18:10:37 +02:00
Philipp Krones
827fc6e1ac
Merge commit '2dc84cb744' into clippy-subtree-update 2025-10-06 18:10:37 +02:00
bors
3d8c1c1fc0 Auto merge of #144477 - cjgillot:gvn-index, r=dianqk
GVN: Use a VnIndex in Address projection.

The current implementation of address projections is inconsistent. Indexing semantically relies on the index' value, but the implementation uses the index' place. This PR fixes that by using `ProjectionElem<VnIndex, Ty<'tcx>>` instead of the raw `PlaceElem<'tcx>`.

This is a more principled fix than the workaround in https://github.com/rust-lang/rust/pull/145030.
2025-10-06 15:33:17 +00:00
Philipp Krones
2dc84cb744
Rustup (#15823)
r? @ghost

Late sync. Was at Oktoberfest on Thursday and then forgot to do it over
the long weekend in Germany.

changelog: none
2025-10-06 15:32:13 +00:00
Philipp Krones
085ddaaa97
Bump nightly version -> 2025-10-06 2025-10-06 17:26:17 +02:00
Philipp Krones
15727e0522
Merge remote-tracking branch 'upstream/master' into rustup 2025-10-06 17:26:03 +02:00
Deadbeef
696b6ac14d use declarative macro for #[derive(TryFromU32)] 2025-10-06 14:54:38 +00:00
Alejandra González
23b1aceb9a
Fixed some lint deprecated versions in the documentation (#15822)
Some lints had a wrong deprecated version on the documentation (I didn't
check all of them, just recent ones).

Fixes rust-lang/rust-clippy#15811

changelog: [`match_on_vec_items`]: Fixed the deprecation version to
"1.88.0"
changelog: [`option_map_or_err_ok `]: Fixed the deprecation version to
"1.87.0"
changelog: [`string_to_string `]: Fixed the deprecation version to
"1.91.0"
2025-10-06 13:32:35 +00:00
Zihan
0ba022a858
legacy_numeric_constants: add ctxt check for internal macro
changelog: none

Signed-off-by: Zihan <zihanli0822@gmail.com>
2025-10-06 09:28:27 -04:00
Nathaniel McCallum
04c2724866 constify basic Clone impls 2025-10-06 08:39:41 -04:00
Teodoro Freund
f4b4fb9b7f Fixed some lint deprecated versions 2025-10-06 09:35:46 -03:00
bors
8111a2d6da Auto merge of #147397 - Zalathar:rollup-mioe9m4, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#146027 (support link modifier `as-needed` for raw-dylib-elf)
 - rust-lang/rust#146874 (compiler: Hint at multiple crate versions if trait impl is for wrong ADT )
 - rust-lang/rust#147237 ([rustdoc] Cleanup "highlight::end_expansion")

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-06 12:20:14 +00:00
Timo
c609d29de1
new_ret_no_self: extract to a separate module (#15798)
changelog: none
2025-10-06 12:16:55 +00:00
Guillaume Gomez
831cdf3144 Fail if no fluent messages were found 2025-10-06 13:48:22 +02:00
Guillaume Gomez
d24ee20876 use fluent_syntax to parse fluent files 2025-10-06 13:48:22 +02:00
Alejandra González
aa0b914728
Cleanup should_implement_trait lint code (#15804)
This might positively affect performances of the
`should_implement_trait` lint.

r? blyxyas

changelog: none
2025-10-06 11:31:11 +00:00
Lukas Wirth
4d840b89d0
Merge pull request #20806 from Veykril/veykril/push-syzoqmtxuqyt
feat: Log flycheck stdout and stderr to files
2025-10-06 11:05:13 +00:00
Lukas Wirth
a392656b17 feat: Log flycheck stdout and stderr to files 2025-10-06 12:55:13 +02:00
Stuart Cook
c8113a70df
Rollup merge of #147237 - yotamofek:pr/rustdoc/highlight/optimize-end_expansion, r=GuillaumeGomez
[rustdoc] Cleanup "highlight::end_expansion"

~Looks like a ~5% improvement on the highlight benchmark.
Obviously, highlighting is only a small part of rustdoc's runtime, so improvement won't be as large on rustc-perf (if there's even an improvement), but holding fingers for a nice gain.~

Perf seems neutral, but IMHO this is a nice small cleanup regardless.

r? `@GuillaumeGomez` (& perf run please!)
2025-10-06 21:20:09 +11:00
Stuart Cook
c3b51b3182
Rollup merge of #146874 - Enselic:multiple-adt-versions, r=jieyouxu
compiler: Hint at multiple crate versions if trait impl is for wrong ADT

If a user does e.g.

    impl From<Bar> for foo::Foo

and get a compilation error about that `From<Bar>` is not implemented for `Foo`, check if multiple versions of the crate with `Foo` is present in the dependency graph. If so, give a hint about it.

Note that a test is added as a separate commit so it is easy to see what effect the fix has on the emitted error message.

This can be seen as a continuation of rust-lang/rust#124944.

I think this closes RUST-71693 but I haven't checked since it lacks a minimal reproducer. If this gets merged I'll ask that reporter if this fix works for them.

## Real world example

I encountered this case in the wild and didn't realize I had multiple versions of a crate in my dependency graph. So I was a bit confused at first. For reference, here is what that looked like.

<details>
<summary>Click to expand</summary>

### Before fix

```
error[E0277]: the trait bound `lambda_http::lambda_runtime::Diagnostic: From<Error>` is not satisfied
   --> src/main.rs:73:5
    |
73  |     lambda_http::run(service_fn(handle_event)).await
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<Error>` is not implemented for `lambda_http::lambda_runtime::Diagnostic`
    |
    = help: the following other types implement trait `From<T>`:
              `lambda_http::lambda_runtime::Diagnostic` implements `From<&str>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError + Send + Sync>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Infallible>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<lambda_runtime::deserializer::DeserializeError>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::io::Error>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::string::String>`
    = note: required for `Error` to implement `Into<lambda_http::lambda_runtime::Diagnostic>`
note: required by a bound in `lambda_http::run`
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_http-0.17.0/src/lib.rs:199:26
    |
194 | pub async fn run<'a, R, S, E>(handler: S) -> Result<(), Error>
    |              --- required by a bound in this function
...
199 |     E: std::fmt::Debug + Into<Diagnostic>,
    |                          ^^^^^^^^^^^^^^^^ required by this bound in `run`

error[E0277]: the trait bound `lambda_http::lambda_runtime::Diagnostic: From<Error>` is not satisfied
   --> src/main.rs:73:48
    |
73  |     lambda_http::run(service_fn(handle_event)).await
    |                                                ^^^^^ the trait `From<Error>` is not implemented for `lambda_http::lambda_runtime::Diagnostic`
    |
    = help: the following other types implement trait `From<T>`:
              `lambda_http::lambda_runtime::Diagnostic` implements `From<&str>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError + Send + Sync>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Infallible>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<lambda_runtime::deserializer::DeserializeError>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::io::Error>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::string::String>`
    = note: required for `Error` to implement `Into<lambda_http::lambda_runtime::Diagnostic>`
note: required by a bound in `lambda_http::run`
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_http-0.17.0/src/lib.rs:199:26
    |
194 | pub async fn run<'a, R, S, E>(handler: S) -> Result<(), Error>
    |              --- required by a bound in this function
...
199 |     E: std::fmt::Debug + Into<Diagnostic>,
    |                          ^^^^^^^^^^^^^^^^ required by this bound in `run`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `auto-merge-dependabot-pull-requests-webhook` (bin "auto-merge-dependabot-pull-requests-webhook") due to 2 previous errors
```

### After fix

```
   Compiling auto-merge-dependabot-pull-requests-webhook v0.1.0 (/home/martin/src/auto-merge-dependabot-prs/rust-webhook)
error[E0277]: the trait bound `lambda_http::lambda_runtime::Diagnostic: From<Error>` is not satisfied
   --> src/main.rs:73:5
    |
 73 |     lambda_http::run(service_fn(handle_event)).await
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<Error>` is not implemented for `lambda_http::lambda_runtime::Diagnostic`
    |
help: item with same name found
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_runtime-0.13.0/src/diagnostic.rs:43:1
    |
 43 | pub struct Diagnostic {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `lambda_runtime` are being used?
    = help: the following other types implement trait `From<T>`:
              `lambda_http::lambda_runtime::Diagnostic` implements `From<&str>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError + Send + Sync>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Infallible>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<lambda_runtime::deserializer::DeserializeError>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::io::Error>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::string::String>`
    = note: required for `Error` to implement `Into<lambda_http::lambda_runtime::Diagnostic>`
note: required by a bound in `lambda_http::run`
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_http-0.17.0/src/lib.rs:199:26
    |
194 | pub async fn run<'a, R, S, E>(handler: S) -> Result<(), Error>
    |              --- required by a bound in this function
...
199 |     E: std::fmt::Debug + Into<Diagnostic>,
    |                          ^^^^^^^^^^^^^^^^ required by this bound in `run`

error[E0277]: the trait bound `lambda_http::lambda_runtime::Diagnostic: From<Error>` is not satisfied
   --> src/main.rs:73:48
    |
 73 |     lambda_http::run(service_fn(handle_event)).await
    |                                                ^^^^^ the trait `From<Error>` is not implemented for `lambda_http::lambda_runtime::Diagnostic`
    |
help: item with same name found
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_runtime-0.13.0/src/diagnostic.rs:43:1
    |
 43 | pub struct Diagnostic {
    | ^^^^^^^^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `lambda_runtime` are being used?
    = help: the following other types implement trait `From<T>`:
              `lambda_http::lambda_runtime::Diagnostic` implements `From<&str>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError + Send + Sync>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Box<dyn StdError>>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<Infallible>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<lambda_runtime::deserializer::DeserializeError>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::io::Error>`
              `lambda_http::lambda_runtime::Diagnostic` implements `From<std::string::String>`
    = note: required for `Error` to implement `Into<lambda_http::lambda_runtime::Diagnostic>`
note: required by a bound in `lambda_http::run`
   --> /home/martin/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lambda_http-0.17.0/src/lib.rs:199:26
    |
194 | pub async fn run<'a, R, S, E>(handler: S) -> Result<(), Error>
    |              --- required by a bound in this function
...
199 |     E: std::fmt::Debug + Into<Diagnostic>,
    |                          ^^^^^^^^^^^^^^^^ required by this bound in `run`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `auto-merge-dependabot-pull-requests-webhook` (bin "auto-merge-dependabot-pull-requests-webhook") due to 2 previous errors
```

</details>

try-job: dist-various-1
try-job: aarch64-msvc-1
2025-10-06 21:20:08 +11:00
Stuart Cook
036c8e1d1a
Rollup merge of #146027 - usamoi:raw-dylib-elf-as-needed, r=bjorn3
support link modifier `as-needed` for raw-dylib-elf

This pull request:

* emits `-Wl,--as-needed` instead of `-Wl,--no-as-needed` for `raw-dylib-elf`, keeping it consistent with `dylib`
* allows combination of link kind `raw-dylib` and link modifier `as-needed`, thus allowing free choice of behavior

r? `@bjorn3`

cc https://github.com/rust-lang/rust/issues/135694
cc https://github.com/rust-lang/rust/issues/99424
2025-10-06 21:20:08 +11:00
bors
d2acb427e4 Auto merge of #147392 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to 5270b840dd.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-10-06 09:07:21 +00:00
Jakub Beránek
b07d88fc72
Handle external LLVM config 2025-10-06 10:48:15 +02:00
Jakub Beránek
e7c9e12ce4
Update change tracker 2025-10-06 10:32:00 +02:00
Jakub Beránek
902cec2bc6
Allow manually opting in and out of Linux linker overrides 2025-10-06 10:30:46 +02:00
Jakub Beránek
8dd97f887c
Destructure TomlConfig and add missing default_linker config 2025-10-06 09:35:34 +02:00
Jakub Beránek
b6c9a6a442
Generalize setting rust-lld as the default linker on Linux 2025-10-06 09:35:34 +02:00
Tshepang Mbambo
ce3928b355
Merge pull request #2605 from rust-lang/tshepang/edition-directive
some fixes
2025-10-06 07:13:39 +02:00
Tshepang Mbambo
2d6f590af1 overlong 2025-10-06 07:13:01 +02:00
Tshepang Mbambo
98afeb8645 fix text describing edition range testing 2025-10-06 07:06:27 +02:00
Tshepang Mbambo
73c8bfa3f0
Merge pull request #2604 from rust-lang/rustc-pull
Rustc pull update
2025-10-06 06:53:24 +02:00
A4-Tacks
7b9e26ea6c
Improve parsing error for static and const
Example
---
```rust
static C<i32>: u32 = 0;
```
->
```diff
-error 8: missing type for `const` or `static`
+error 8: `static` may not have generic parameters
```

---

```rust
const C = 0;
```
->
```diff
-error 7: missing type for `const` or `static`
+error 7: missing type for `const`
```

---

```rust
static C = 0;
```
->
```diff
-error 8: missing type for `const` or `static`
+error 8: missing type for `static`
```
2025-10-06 12:48:38 +08:00
bors
1a3cdd3462 Auto merge of #147377 - karolzwolak:dont-create-empty-ident-issue-147365, r=nnethercote
don't make empty ident when printing `'` ident from `extern "'"`

Fixes rust-lang/rust#147365.
r? `@nnethercote`
2025-10-06 04:34:57 +00:00
Martin Nordholts
eeb7cb1b8a compiler: Hint at multiple crate versions if trait impl is for wrong ADT
If a user does e.g.

    impl From<Bar> for foo::Foo

and get a compilation error about that `From<Bar>` is not implemented
for `Foo`, check if multiple versions of the crate with `Foo` is present
in the dependency graph. If so, give a hint about it.

I encountered this case in the wild and didn't realize I had multiple
versions of a crate in my dependency graph. So I was a bit confused at
first. This fix will make life easier for others.
2025-10-06 06:21:45 +02:00
The rustc-josh-sync Cronjob Bot
cbee1ab175 Merge ref '4fa824bb78' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 4fa824bb78
Filtered ref: b8d3c3cc8b2048bd34d7611095d36d82259331af
Upstream diff: 9f32ccf35f...4fa824bb78

This merge was created using https://github.com/rust-lang/josh-sync.
2025-10-06 04:19:25 +00:00
The rustc-josh-sync Cronjob Bot
f54139aa31 Prepare for merging from rust-lang/rust
This updates the rust-version file to 4fa824bb78.
2025-10-06 04:13:15 +00:00
Tshepang Mbambo
c7d180cd60 add multi-arch asm! label operand test 2025-10-06 05:54:53 +02:00
Zalathar
69a975faa9 Consistently import llvm::Type and llvm::Value 2025-10-06 13:09:16 +11:00
bors
828c2a9afc Auto merge of #147360 - chenyukang:yukang-fix-assoc-eq-missing-term, r=nnethercote
Remove extra space for missing associated type term suggestion

r? `@nnethercote`
2025-10-06 01:24:16 +00:00
usamoi
21dd997aec support link modifier as-needed for raw-dylib-elf 2025-10-06 08:56:40 +08:00
itsjunetime
4808fd4c98
Build rust-analyzer with specific target for install/pgo xtask 2025-10-05 18:24:19 -05:00
bors
4fa824bb78 Auto merge of #147375 - folkertdev:power-align-union, r=RalfJung
ignore power alignment rule on unions

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

The power alignment rule only applies to the non-first field of a struct, and so should not apply to unions at all.

The current code also does not consider enums (whose fields might be, morally, structs). Given that C does not actually have ADTs like this it's probably fine from a compatibility perspective, but I'll leave that to the powerpc folks.

cc `@daltenty` `@gilamn5tr`
r? compiler
2025-10-05 22:14:55 +00:00
cyrgani
0a6462be90 remove unneeded imports 2025-10-05 23:25:08 +02:00
Kirill Bulatov
c4073c5ae3 Replace --show-output with --nocapture
The former does not show any output before the test is finished, which prevents long-running/stuck tests from showing any useful information.
2025-10-05 22:28:00 +03:00
Chayim Refael Friedman
15cb465ad6
Merge pull request #20802 from ChayimFriedman2/regression20662
minor: Add regression test for need-mut diagnostic
2025-10-05 19:06:18 +00:00
The 8472
ff91dbd1fd only call polymorphic array iter drop machinery when the type requires it 2025-10-05 21:03:30 +02:00
bors
839222065a Auto merge of #147384 - workingjubilee:rollup-2qqqfn4, r=workingjubilee
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#147327 (cg_llvm: Remove inherent methods from several LLVM FFI types)
 - rust-lang/rust#147332 (Set opt-level flag for installing tool only on CI)
 - rust-lang/rust#147374 (bootstrap: don't build book redirect pages during dry-run/test)
 - rust-lang/rust#147376 (bootstrap: relax `compiler-rt` root assertion)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-05 19:03:28 +00:00
Jubilee
0d3e4d1c2c
Rollup merge of #147376 - jieyouxu:bootstrap-compiler-rt-self-test, r=Kobzol
bootstrap: relax `compiler-rt` root assertion

Not needed during tests. This would otherwise require `src/llvm-project` submodule to be initialized and `compiler-rt/` subdirectory to be present.

I need this and rust-lang/rust#147374 to get bootstrap self-tests to pass with no git submodules checked out locally.

r? `@Kobzol` (or bootstrap)
2025-10-05 11:59:24 -07:00
Jubilee
aa37ad40d5
Rollup merge of #147374 - jieyouxu:bootstrap-redirect-pages, r=Kobzol
bootstrap: don't build book redirect pages during dry-run/test

Currently, `./x test bootstrap` does not automatically transitively checkout submodules needed to pass all involved test steps. Apparently one place where bootstrap's self-test can choke on locally is trying to build book redirect pages without the book submodules checked out.

This change is orthogonal to making bootstrap checking out required submodules for self-tests, and IMO is beneficial regardless since IMO we should not be building these redirect pages during test/dry-run _anyway_.

This was blocking me trying to rebless bootstrap self-tests for rust-lang/rust#147372. cf. [#t-infra/bootstrap > Bootstrap self-tests @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Bootstrap.20self-tests/near/543157194).

r? `@Kobzol` (or bootstrap)
2025-10-05 11:59:24 -07:00