Commit Graph

4285 Commits

Author SHA1 Message Date
bors 1d0f6bdc02 Auto merge of #141002 - GuillaumeGomez:subtree-update_cg_gcc_2025-05-14, r=GuillaumeGomez
Subtree update GCC backend 2025 05 14

cc `@antoyo`
2025-05-17 02:50:33 +00:00
bors dfca6ee73f Auto merge of #140978 - davidtwco:deep-reject-in-match-norm-trait-ref, r=lcnr
trait_sel: deep reject `match_normalize_trait_ref`

Spotted during an in-person review of #137944 at RustWeek: `match_normalize_trait_ref` could be using `DeepRejectCtxt` to exit early as an optimisation for projection candidates, like is done with param candidates.

r? `@lcnr`
cc `@oli-obk`
2025-05-16 23:39:39 +00:00
bors c525905941 Auto merge of #140911 - rust-lang:cargo_update, r=clubby789
Weekly `cargo update`

Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:

```txt

compiler & tools dependencies:
     Locking 40 packages to latest compatible versions
    Updating clap v4.5.37 -> v4.5.38
    Updating clap_builder v4.5.37 -> v4.5.38
    Updating ctrlc v3.4.6 -> v3.4.7
    Updating derive_setters v0.1.6 -> v0.1.7
    Updating getrandom v0.3.2 -> v0.3.3
    Updating icu_collections v1.5.0 -> v2.0.0
      Adding icu_locale_core v2.0.0
    Updating icu_normalizer v1.5.0 -> v2.0.0
    Updating icu_normalizer_data v1.5.1 -> v2.0.0
    Updating icu_properties v1.5.1 -> v2.0.0
    Updating icu_properties_data v1.5.1 -> v2.0.0
      Adding icu_provider v2.0.0
    Updating idna_adapter v1.2.0 -> v1.2.1
    Updating jiff v0.2.12 -> v0.2.13
    Updating jiff-static v0.2.12 -> v0.2.13
    Updating libffi v4.0.0 -> v4.1.0
    Updating libffi-sys v3.2.0 -> v3.3.1
    Updating libloading v0.8.6 -> v0.8.7
    Updating libm v0.2.13 -> v0.2.15
      Adding litemap v0.8.0
    Updating nix v0.29.0 -> v0.30.1
      Adding potential_utf v0.1.2
    Updating rustc-build-sysroot v0.5.4 -> v0.5.5
      Adding tinystr v0.8.1
    Updating tokio v1.44.2 -> v1.45.0
    Updating unic-langid v0.9.5 -> v0.9.6
    Updating unic-langid-impl v0.9.5 -> v0.9.6
    Updating unic-langid-macros v0.9.5 -> v0.9.6
    Updating unic-langid-macros-impl v0.9.5 -> v0.9.6
    Removing utf16_iter v1.0.5
      Adding wasm-encoder v0.230.0
      Adding wasmparser v0.230.0
    Updating wast v229.0.0 -> v230.0.0
    Updating wat v1.229.0 -> v1.230.0
    Updating winnow v0.7.9 -> v0.7.10
    Removing write16 v1.0.0
      Adding writeable v0.6.1
      Adding yoke v0.8.0
      Adding yoke-derive v0.8.0
      Adding zerotrie v0.2.2
      Adding zerovec v0.11.2
      Adding zerovec-derive v0.11.1
note: pass `--verbose` to see 36 unchanged dependencies behind latest

library dependencies:
     Locking 0 packages to latest compatible versions
note: pass `--verbose` to see 3 unchanged dependencies behind latest

rustbook dependencies:
     Locking 26 packages to latest compatible versions
    Updating cc v1.2.21 -> v1.2.22
    Updating clap v4.5.37 -> v4.5.38
    Updating clap_builder v4.5.37 -> v4.5.38
    Updating clap_complete v4.5.48 -> v4.5.50
    Updating getrandom v0.3.2 -> v0.3.3
    Updating icu_collections v1.5.0 -> v2.0.0
      Adding icu_locale_core v2.0.0
    Removing icu_locid v1.5.0
    Removing icu_locid_transform v1.5.0
    Removing icu_locid_transform_data v1.5.1
    Updating icu_normalizer v1.5.0 -> v2.0.0
    Updating icu_normalizer_data v1.5.1 -> v2.0.0
    Updating icu_properties v1.5.1 -> v2.0.0
    Updating icu_properties_data v1.5.1 -> v2.0.0
    Updating icu_provider v1.5.0 -> v2.0.0
    Removing icu_provider_macros v1.5.0
    Updating idna_adapter v1.2.0 -> v1.2.1
    Updating jiff v0.2.12 -> v0.2.13
    Updating jiff-static v0.2.12 -> v0.2.13
    Updating litemap v0.7.5 -> v0.8.0
      Adding potential_utf v0.1.2
    Updating tinystr v0.7.6 -> v0.8.1
    Removing utf16_iter v1.0.5
    Updating web_atoms v0.1.1 -> v0.1.2
    Updating winnow v0.7.9 -> v0.7.10
    Removing write16 v1.0.0
    Updating writeable v0.5.5 -> v0.6.1
    Updating yoke v0.7.5 -> v0.8.0
    Updating yoke-derive v0.7.5 -> v0.8.0
      Adding zerotrie v0.2.2
    Updating zerovec v0.10.4 -> v0.11.2
    Updating zerovec-derive v0.10.3 -> v0.11.1
```
2025-05-16 19:34:19 +00:00
bors db01fc64c8 Auto merge of #141093 - weihanglo:update-cargo, r=weihanglo
Update cargo

5 commits in 056f5f4f3c100cb36b5e9aed2d20b9ea70aae295..47c911e9e6f6461f90ce19142031fe16876a3b95
2025-05-09 14:54:18 +0000 to 2025-05-14 17:53:17 +0000
- Stabilize doctest-xcompile (rust-lang/cargo#15462)
- feat: skip `publish=false` pkg when publishing entire workspace (rust-lang/cargo#15525)
- chore: bump to 0.90.0; update changelog (rust-lang/cargo#15520)
- chore(triagebot): add `[no-mentions]` and `[note]` (rust-lang/cargo#15517)
- add glob pattern support for known_hosts (rust-lang/cargo#15508)

r? ghost
2025-05-16 16:20:00 +00:00
bors 4c06681c50 Auto merge of #140959 - oli-obk:no-unsafe-children, r=davidtwco
Invoke a query only when it doesn't return immediately anyway

This should cause less query key caching and less dep graph data, hopefully resulting in some perf improvements
2025-05-16 12:54:18 +00:00
bors c738b07626 Auto merge of #141044 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Cargo.lock update due to Clippy version bump.
2025-05-16 08:54:55 +00:00
bors c0b9ad1165 Auto merge of #141066 - matthiaskrgr:rollup-e7tyrj5, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #140791 (std: explain prefer `TryInto` over `TryFrom` when specifying traits bounds on generic function)
 - #140834 (move (or remove) some impl Trait tests)
 - #140910 (Remove `stable` attribute from wasi fs (read_exact|write_all)_at)
 - #140984 (fix doc for UnixStream)
 - #140997 (Add negative test coverage for `-Clink-self-contained` and `-Zlinker-features`)
 - #141003 (Improve ternary operator recovery)
 - #141009 (Migrate to modern datetime API)
 - #141013 (Implement methods to set STARTUPINFO flags for Command API on Windows)
 - #141026 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-16 05:45:37 +00:00
Matthias Krüger 48e203443d
Rollup merge of #141026 - tshepang:rust-push, r=jieyouxu
rustc-dev-guide subtree update

r? ``@ghost``
2025-05-16 07:19:43 +02:00
Matthias Krüger 88c9c89490
Rollup merge of #141013 - federico-terzi:feat/command_startupinfo_windows, r=joboet
Implement methods to set STARTUPINFO flags for Command API on Windows

Implements https://github.com/rust-lang/rust/issues/141010
2025-05-16 07:19:42 +02:00
Matthias Krüger 6973a5bb18
Rollup merge of #141009 - emmanuel-ferdman:master, r=marcoieni
Migrate to modern datetime API

# PR Summary
This small PR resolves the `datetime` library warnings:
```python
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC). or datetime.datetime.utcnow()
```
Note that `.replace(tzinfo=None)` allows to keep the original behavior where the time appears as a naive UTC timestamp (i.e., without any timezone offset). Comparision:
```python
# With .utcnow() or .now(datetime.timezone.utc).replace(tzinfo=None)
Time,Idle
2025-05-14T15:40:25.013414,98.73417721518987

# With .now(datetime.timezone.utc)
Time,Idle
2025-05-14T15:40:25.013414+00:00,98.73417721518987
```
2025-05-16 07:19:42 +02:00
Matthias Krüger 094936e61c
Rollup merge of #141003 - clubby789:ternary-improve, r=compiler-errors
Improve ternary operator recovery

This
- Improves the span of the error to not point at the next token
- Where possible, we use the span of the condition to further improve the span of the error to include the cond, and suggest a maybe-incorrect fix

Currently this works on free expressions, not let statements; some more refactoring would be needed to pass the span down, which I'm not sure is worth doing.

### Old
![image](https://github.com/user-attachments/assets/5688cefc-e4ef-4135-a5ba-340ce05ae6f3)

### New
![image](https://github.com/user-attachments/assets/154f5380-e0c8-42c7-9bf8-0adb3d0433fa)
2025-05-16 07:19:41 +02:00
Matthias Krüger 2623542a16
Rollup merge of #140997 - jieyouxu:link-flags-negative-tests, r=lqd
Add negative test coverage for `-Clink-self-contained` and `-Zlinker-features`

Noticed while reviewing stabilization #140525 that we don't have any negative test coverage for these flags. Feel free to cherry-pick these tests into the stabilization PR, or we can land these before separately.

r? `@lqd`
2025-05-16 07:19:40 +02:00
Matthias Krüger 90edc23d78
Rollup merge of #140984 - mlowicki:patch-2, r=ibraheemdev
fix doc for UnixStream

Doc example was using `UdpSocket` instead of `UnixStream`.
2025-05-16 07:19:40 +02:00
Matthias Krüger af6e3102be
Rollup merge of #140910 - paolobarbolini:wasi-fs-incorrect-stabilization, r=joboet
Remove `stable` attribute from wasi fs (read_exact|write_all)_at

The docs for [`std::os::wasi::fs::FileExt::read_exact_at`](https://doc.rust-lang.org/1.86.0/std/os/wasi/fs/trait.FileExt.html#method.read_exact_at) and [`std::os::wasi::fs::FileExt::write_all_at`](https://doc.rust-lang.org/1.86.0/std/os/wasi/fs/trait.FileExt.html#method.write_all_at) show the methods to be stable since v1.33, which is not correct and was a mistake made when the methods were added in (https://github.com/rust-lang/rust/pull/74076#pullrequestreview-443124667). The reviewer seemed to think this was an insta-stabilization, but the entire file is marked as unstable so that was not right. The stabilization version would also have been wrong either way.
2025-05-16 07:19:39 +02:00
Matthias Krüger 11e73ab7d5
Rollup merge of #140834 - lcnr:apit-folder, r=compiler-errors
move (or remove) some impl Trait tests

Probably not actually worth the effort, so I am stopping here 😅
2025-05-16 07:19:38 +02:00
Matthias Krüger 6eac0bf7b0
Rollup merge of #140791 - xizheyin:issue-140761, r=ibraheemdev
std: explain prefer `TryInto` over `TryFrom` when specifying traits bounds on generic function

Fixes #140761

This PR keeps the explanations of `Into` and `From` consistent and adds explanations for `TryInto` and `TryFrom`.

r? libs
2025-05-16 07:19:38 +02:00
bors 7ae5d3436a Auto merge of #140557 - compiler-errors:remove-wf-hack, r=lcnr
Remove manual WF hack

We do not need this hack anymore since we fixed the candidate selection problems with `Sized` bounds. We prefer built-in sized bounds now since #138176, which fixes the only regression this hack was intended to fix.

While this theoretically is broken for some code, for example, when there a param-env bound that shadows an impl or built-in trait, we don't see it in practice and IMO it's not worth the burden of having to maintain this wart in `compare_method_predicate_entailment`.

The code that regresses is, for example:

```rust
trait Bar<'a> {}

trait Foo<'a, T> {
    fn method(&self)
    where
        Self: Bar<'a>;
}

struct W<'a, T>(&'a T)
where
    Self: Bar<'a>;

impl<'a, 'b, T> Bar<'a> for W<'b, T> {}

impl<'a, 'b, T> Foo<'a, T> for W<'b, T> {
    fn method(&self) {}
}
```

Specifically, I don't believe this is really going to be encountered in practice. For this to fail, there must be a where clause in the *trait method* that would shadow an impl or built-in (non-`Sized`) candidate in the trait, and this shadowing would need to be encountered when solving a nested WF goal from the impl self type.

See #108544 for the original regression. Crater run is clean!

r? lcnr
2025-05-16 02:34:32 +00:00
bors c131abc9b9 Auto merge of #136264 - GuillaumeGomez:optimize-integers-to-string, r=Amanieu
Optimize `ToString` implementation for integers

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

Follow-up of https://github.com/rust-lang/rust/pull/133247 and https://github.com/rust-lang/rust/pull/128204.

The benchmark results are:

| name| 1.87.0-nightly (3ea711f17 2025-03-09) | With this PR | diff |
|-|-|-|-|
| bench_i16 | 32.06 ns/iter (+/- 0.12) | 17.62 ns/iter (+/- 0.03) | -45% |
| bench_i32 | 31.61 ns/iter (+/- 0.04) | 15.10 ns/iter (+/- 0.06) | -52% |
| bench_i64 | 31.71 ns/iter (+/- 0.07) | 15.02 ns/iter (+/- 0.20) | -52% |
| bench_i8 | 13.21 ns/iter (+/- 0.14) | 14.93 ns/iter (+/- 0.16) | +13% |
| bench_u16 | 31.20 ns/iter (+/- 0.06) | 16.14 ns/iter (+/- 0.11) | -48% |
| bench_u32 | 33.27 ns/iter (+/- 0.05) | 16.18 ns/iter (+/- 0.10) | -51% |
| bench_u64 | 31.44 ns/iter (+/- 0.06) | 16.62 ns/iter (+/- 0.21) | -47% |
| bench_u8 | 10.57 ns/iter (+/- 0.30) | 13.00 ns/iter (+/- 0.43) | +22% |

More information about it in [the original comment](https://github.com/rust-lang/rust/pull/136264#discussion_r1987542954).

r? `@workingjubilee`
2025-05-15 20:20:30 +00:00
bors eb5e386b41 Auto merge of #136988 - compiler-errors:impossible_predicates, r=lcnr
Use the new solver in the `impossible_predicates`

The old solver is unsound for many reasons. One of which was weaponized by `@lcnr` in #140212, where the old solver was incompletely considering a dyn vtable method to be impossible and replacing its vtable entry with a null value. This null function could be called post-mono.

The new solver is expected to be less incomplete due to its correct handling of higher-ranked aliases in relate. This PR switches the `impossible_predicates` query to use the new solver, which patches this UB.

r? lcnr
2025-05-15 15:31:24 +00:00
bors 0f2e3e6196 Auto merge of #141011 - matthiaskrgr:rollup-4uwllo2, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #140827 (Do not ICE when reassigning in GatherLocalsVisitor on the bad path)
 - #140904 (Add an issue template for future-incompatible lints)
 - #140953 (Fix a compiletest blessing message)
 - #140973 (Update rustix to 1.0.7 for bootstrap)
 - #140976 (Add `Ipv4Addr` and `Ipv6Addr` diagnostic items)
 - #140988 (MaybeUninit::write: fix doc)
 - #140989 (Suggest replace f with f: Box<f> when expr field is short hand)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-15 12:06:06 +00:00
Tshepang Mbambo 70e08b3d42
Merge pull request #2388 from rust-lang/rustc-pull
Rustc pull update
2025-05-15 11:47:11 +02:00
The rustc-dev-guide Cronjob Bot 142b48a021 Merge from rustc 2025-05-15 09:46:22 +00:00
The rustc-dev-guide Cronjob Bot 5012fc3016 Preparing for merge from rustc 2025-05-15 09:46:15 +00:00
Tshepang Mbambo 1ddf2df9c2
Merge pull request #2387 from rust-lang/tshepang-avoid-conflict
avoid upstream pull conflict
2025-05-15 11:41:17 +02:00
Tshepang Mbambo ea21da3dac avoid upstream pull conflict
We changed this line and have not pushed it upstream yet,
and upstream changed it in the meanwhile.
2025-05-15 11:39:59 +02:00
Tshepang Mbambo f1127a948e
Merge pull request #2373 from rust-lang/tshepang-patch-2
avoid duplicating commands
2025-05-15 00:34:38 +02:00
Tshepang Mbambo 8bc57dec32
Merge pull request #2379 from rust-lang/tshepang-which-chapter
clean TypeFold* chapter
2025-05-15 00:33:47 +02:00
Tshepang Mbambo 71b0a3e42f
Merge pull request #2380 from rust-lang/tshepang-crate-cleaning
clean our crates
2025-05-15 00:33:19 +02:00
Tshepang Mbambo 469ebdd4fe
Merge pull request #2383 from rust-lang/tshepang-unused
remove dangling references
2025-05-15 00:32:57 +02:00
Matthias Krüger 43e8b50e9c
Rollup merge of #140989 - xizheyin:issue-139631, r=compiler-errors
Suggest replace f with f: Box<f> when expr field is short hand

Fixes #139631

r? compiler
2025-05-14 18:43:40 +02:00
Matthias Krüger 50946237cc
Rollup merge of #140988 - mathisbot:docfix_maybeuninit_write, r=tgross35
MaybeUninit::write: fix doc

# Fix doc for `MaybeUninit::write`

The documentation refers to the way `MaybeUninit` stores data internally. The property of not dropping content on context exit is the responsibility of `ManuallyDrop`.
2025-05-14 18:43:40 +02:00
Matthias Krüger 0ae5d00ab6
Rollup merge of #140976 - samueltardieu:diag-ipaddr-v4v6, r=Urgau
Add `Ipv4Addr` and `Ipv6Addr` diagnostic items

They will be used in Clippy to detect runtime parsing of known-valid IP addresses.
2025-05-14 18:43:39 +02:00
Matthias Krüger cb888ed71a
Rollup merge of #140973 - Berrysoft:update-bootstrap-lock, r=jieyouxu
Update rustix to 1.0.7 for bootstrap

Another bump for bootstrap. Finally it compiles on Cygwin:) Hooray!

r? ``@jieyouxu``
2025-05-14 18:43:39 +02:00
Matthias Krüger a00f0dd85d
Rollup merge of #140953 - jieyouxu:compiletest-bless-msg, r=compiler-errors
Fix a compiletest blessing message

It was showing compare mode instead of test name.

Fixes #140945.
Noticed in https://github.com/rust-lang/rust/pull/140622#issuecomment-2868705612.
2025-05-14 18:43:38 +02:00
Matthias Krüger 278937a7a8
Rollup merge of #140904 - ehuss:future-incompat-template, r=Mark-Simulacrum
Add an issue template for future-incompatible lints

This adds a GitHub issue template for future-incompatible lints. Most of the existing tracking issues have been using different formats with different information, and I think it would be helpful to make them a little more consistent and to ensure that sufficient information is provided.

Some comments on my choices:
* Added a dedicated section to describe *why* the change is being made. Many existing issues already have this, so let's standardize on it.
* Have a section with a very clear example. Almost all of the existing issues have this in one form or another.
* Added a "Recommendations" section, since this is something I see missing in several of the existing issues, and this is really important information IMHO.
* I reworded the "When" section. The existing template mentioned that these get reviewed every 6 weeks which my understanding is not true. That's also not very helpful information to the user, since it doesn't really answer the question. I'm not sure this section will actually be useful since I suspect most of the time we don't know when it will change (there have been a few exceptions).
* Clearly show the expected progression steps. Several issues already have this.
* Added implementation history, which is useful for linking PRs. (IDK, this could get merged with "Steps".)
2025-05-14 18:43:38 +02:00
Matthias Krüger 4716db0ab2
Rollup merge of #140827 - compiler-errors:gather-locals-twice, r=oli-obk
Do not ICE when reassigning in GatherLocalsVisitor on the bad path

Fixes https://github.com/rust-lang/rust/issues/140785
Fixes https://github.com/rust-lang/rust/issues/140730

See comment in code.

r? oli-obk
2025-05-14 18:43:37 +02:00
Li-yao Xia d47c2b4423 Fix link to GatherBorrows 2025-05-14 11:36:00 +02:00
bors f521fd2627 Auto merge of #140921 - Berrysoft:update-rustc-lock, r=jieyouxu
Update `ctrlc`, `libloading` and `nix` for rustc

The main purpose is to update `nix` to 0.30.1. It adds support for cygwin.
2025-05-13 13:06:57 +00:00
bors 9561999183 Auto merge of #140887 - pietroalbini:pa-bootstrap-update, r=compiler-errors
Stage0 bootstrap update

This PR [follows the release process](https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday) to update the stage0 compiler.

The only thing of note is 58651d1b31, which was flagged by clippy as a correctness fix. I think allowing that lint in our case makes sense, but it's worth to have a second pair of eyes on it.

r? `@Mark-Simulacrum`
2025-05-13 09:54:28 +00:00
bors 44646899f1 Auto merge of #140951 - compiler-errors:super-fmt, r=ytmimi
Do not remove `super` keyword from `super let`

This is affecting a macro in the standard library:

bc7512ee63/library/core/src/pin.rs (L1945)

I added an exception in 6f6a9a585891d0a2d1114a7a621f35f28f39c0d9, but I'd like to remove it eventually, so opening this in-tree to not block this on the next rustfmt sync.

r? `@calebcartwright` or `@ytmimi`
2025-05-13 06:43:56 +00:00
bors d8dec87e1a Auto merge of #140935 - omahs:patch-5, r=jieyouxu
Fix typos

Fix typos
2025-05-13 03:33:22 +00:00
bors bf57a659f7 Auto merge of #140927 - mejrs:test5, r=jieyouxu
chore: move more ui tests

r? `@jieyouxu`
2025-05-13 00:03:33 +00:00
Tshepang Mbambo 45107c759a remove dangling references 2025-05-12 23:59:55 +02:00
bors 9fa6e479a7 Auto merge of #140914 - Zalathar:asm-bindings, r=compiler-errors
cg_llvm: Clean up some inline assembly bindings

This PR combines a few loosely-related cleanups to LLVM bindings related to inline assembly. These include:
- Replacing `LLVMRustInlineAsm` with LLVM-C's `LLVMGetInlineAsm`
- Adjusting FFI declarations to avoid the need for explicit `as_c_char_ptr` conversions
- Flattening control flow in `inline_asm_call`

There should be no functional changes.
2025-05-12 17:39:21 +00:00
omahs 5a04183ad2 Fix typos 2025-05-12 17:20:49 +00:00
许杰友 Jieyou Xu (Joe) 946f27e9d3
Merge pull request #2378 from smanilov/patch-7 2025-05-12 21:32:54 +08:00
Stan Manilov e96bd9bfc0 Remove n.b. about parser refactoring
Discussed in PR 2378; the note was outdated.
2025-05-12 14:27:26 +03:00
Yuki Okushi d4bf7d4b73
Merge pull request #2382 from Zalathar/no-tuple-unsize 2025-05-12 19:47:40 +09:00
Zalathar 8ebe4672cb Remove obsolete reference to `unsized_tuple_coercion` 2025-05-12 18:14:43 +10:00
bors 33ca0c9341 Auto merge of #140925 - the8472:test-140207, r=compiler-errors
add regression test for 140207

Assembly test for #140207
2025-05-12 04:32:50 +00:00