Commit graph

308340 commits

Author SHA1 Message Date
Jason Newcomb
5e02a4eecf
rename unchecked_duration_subtraction to unchecked_time_subtraction and check for Duration - Duration (#13800)
fixes https://github.com/rust-lang/rust-clippy/issues/13734

This PR renames `unchecked_duration_subtraction` lint to
`unchecked_time_subtraction` and extends it to include `Duration -
Duration` operations. Previously, it was only `Instant - Duration`.
`Duration - Duration` is a common operation which may panic in the same
way.

Note: This is my first clippy PR, feedback is appreciated.

changelog: [`unchecked_time_subtraction`]: renamed from
`unchecked_duration_subtraction`, extend lint to include subtraction of
a `Duration` with a `Duration`
2025-09-27 08:28:58 +00:00
Zalathar
d8a1edc718 Use PanicHookInfo::payload_as_str now that it's stable in beta 2025-09-27 18:23:18 +10:00
bors
7c4cde82c1 Auto merge of #146636 - Mark-Simulacrum:bootstrap-bump, r=jieyouxu
Bump bootstrap compiler to 1.91 beta

https://forge.rust-lang.org/release/process.html#default-branch-bootstrap-update-tuesday
2025-09-27 03:50:03 +00:00
bors
959b450747 Auto merge of #146636 - Mark-Simulacrum:bootstrap-bump, r=jieyouxu
Bump bootstrap compiler to 1.91 beta

https://forge.rust-lang.org/release/process.html#default-branch-bootstrap-update-tuesday
2025-09-27 03:50:03 +00:00
U. Lasiotus
fe3e124e8a doc: fix a typo in platform-support.md 2025-09-26 20:34:03 -07:00
bors
e131842222 Auto merge of #147074 - matthiaskrgr:rollup-sm3owsd, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145113 (resolve: Do not finalize shadowed bindings)
 - rust-lang/rust#146523 (Demote both armebv7r-none-* targets.)
 - rust-lang/rust#146704 (port `#[debugger_visualizer]` to the new attribute system)
 - rust-lang/rust#146758 (Stop linking rs{begin,end} objects on x86_64-*-windows-gnu)
 - rust-lang/rust#146778 (Use standard attribute logic for allocator shim)
 - rust-lang/rust#146849 (Reduce some uses of `LegacyBang`)
 - rust-lang/rust#147016 (fix doc comments to be more standard)
 - rust-lang/rust#147027 (Add new `tyalias` intra-doc link disambiguator)
 - rust-lang/rust#147031 (mbe: Simplify check_redundant_vis_repetition)
 - rust-lang/rust#147058 (Ignore more failing ui tests for GCC backend)

Failed merges:

 - rust-lang/rust#147046 (Rename `rust.use-lld` to `rust.bootstrap-override-lld`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-27 00:44:47 +00:00
Esteban Küber
bb48c162b6 Simplify logic slightly 2025-09-27 00:42:11 +00:00
Daniel Verkamp
97f64374a9 formatting_options: fix alternate docs 0b/0o mixup
The descriptions of the alternate forms of Octal and Binary were swapped
in the doc comment for FormattingOptions::alternate().
2025-09-26 16:32:54 -07:00
Mark Rousskov
714fdacdf8 Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
Mark Rousskov
54669d7db4 Bump stage0 2025-09-26 19:09:23 -04:00
Mark Rousskov
201f299ef6 Apply cfg(bootstrap) replacement 2025-09-26 19:09:23 -04:00
Mark Rousskov
4e9716fbc5 Update CURRENT_RUSTC_VERSION post-bump 2025-09-26 18:41:32 -04:00
beepster4096
413f095a85 this ice now requires -Zvalidate-mir
also slightly minimized the test
2025-09-26 15:37:19 -07:00
Aapo Alasuutari
e88fa086fb move Reborrow to ops, fix fmt issues 2025-09-27 01:11:01 +03:00
Camille Gillot
d13a5b0a6c Handle self-loops too. 2025-09-26 20:44:06 +00:00
Laurențiu Nicola
6cfe1ec35f
Merge pull request #20753 from rust-lang/dependabot/npm_and_yarn/editors/code/tar-fs-2.1.4
minor: Bump tar-fs from 2.1.3 to 2.1.4 in /editors/code
2025-09-26 20:21:50 +00:00
Guillaume Gomez
b7e444de16 Add regression test for merged doctests compilation time display 2025-09-26 22:04:00 +02:00
Augie Fackler
eb3fb457f1 split-dwarf: add documentation and test coverage 2025-09-26 16:02:59 -04:00
dependabot[bot]
9d5adff08c
Bump tar-fs from 2.1.3 to 2.1.4 in /editors/code
Bumps [tar-fs](https://github.com/mafintosh/tar-fs) from 2.1.3 to 2.1.4.
- [Commits](https://github.com/mafintosh/tar-fs/compare/v2.1.3...v2.1.4)

---
updated-dependencies:
- dependency-name: tar-fs
  dependency-version: 2.1.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-09-26 19:45:06 +00:00
Augie Fackler
bd860bdf26
Fix typo in LLVM_VERSION_ macro use
Co-authored-by: Nikita Popov <github@npopov.com>
2025-09-26 15:38:30 -04:00
beepster4096
36d6327fa4 castkind::subtype in clippy 2025-09-26 12:19:25 -07:00
beepster4096
b550688258 castkind::subtype in clippy 2025-09-26 12:19:25 -07:00
Jakub Beránek
852aa20c90
Rename rust.use-lld to rust.bootstrap-override-lld 2025-09-26 20:21:21 +02:00
Jules Bertholet
a4e87e9406
Support #[rustc_align_static] inside thread_local! 2025-09-26 13:51:09 -04:00
David Carlier
c0de794949
std::net: update tcp deferaccept delay type to Duration. 2025-09-26 18:39:29 +01:00
Joshua Rayton
2e904c4d07
update issue number for more_float_constants 2025-09-26 18:35:29 +01:00
Augie Fackler
77c6acc74e debuginfo: add an unstable flag to write split DWARF to an explicit directory
Bazel requires knowledge of outputs from actions at analysis time,
including file or directory name. In order to work around the lack of
predictable output name for dwo files, we group the dwo files in a
subdirectory of --out-dir as a post-processing step before returning
control to bazel. Unfortunately some debugging workflows rely on
directly opening the dwo file rather than loading the merged dwp file,
and our trick of moving the files breaks those users. We can't just
hardlink the file or copy it, because with remote build execution we
wouldn't end up with the un-moved file copied back to the developer's
workstation. As a fix, we add this unstable flag that causes dwo files
to be written to a build-system-controllable location, which then lets
bazel hoover up the dwo files, but the objects also have the correct
path for the dwo files.
2025-09-26 13:34:40 -04:00
Augie Fackler
99456cc015 tests: use max-llvm-major-version instead of ignore-llvm-version 2025-09-26 13:32:03 -04:00
Augie Fackler
4c7292aba3 PassWrapper: drop unused variable for LLVM 22+ 2025-09-26 13:27:34 -04:00
Li-yao Xia
c0e0d4b68d Make def_path_hash_to_def_id not panic when passed an invalid hash 2025-09-26 18:36:15 +02:00
Laurențiu Nicola
2a10098fa9
Merge pull request #20751 from neuschaefer/memchr
Update memchr to 2.7.6
2025-09-26 16:25:41 +00:00
Matthias Krüger
a91918f96b
Rollup merge of #147058 - GuillaumeGomez:ignore-more-ui-tests, r=Kobzol
Ignore more failing ui tests for GCC backend

Needed for https://github.com/rust-lang/rust/pull/146414.

r? ``@Kobzol``
2025-09-26 18:11:15 +02:00
Matthias Krüger
978c960ed6
Rollup merge of #147031 - joshtriplett:mbe-opt-collect, r=lcnr
mbe: Simplify check_redundant_vis_repetition

Eliminate a use of `map_or` in favor of a match.

Inline some variable definitions that don't add clarity, and that
prevent short-circuiting.
2025-09-26 18:11:14 +02:00
Matthias Krüger
67d88f93cd
Rollup merge of #147027 - GuillaumeGomez:tyalias-disambiguator, r=lolbinarycat
Add new `tyalias` intra-doc link disambiguator

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

Alternative to rust-lang/rust#146866.

This adds support for a new disambiguator: `tyalias`. I think it's common enough to have type aliases nowaday, so no reason to not be able to have a disambiguator for them.

cc ``@fmease``
r? lolbinarycat
2025-09-26 18:11:13 +02:00
Matthias Krüger
e504c108df
Rollup merge of #147016 - hkBst:whitespace-1, r=nnethercote
fix doc comments to be more standard
2025-09-26 18:11:12 +02:00
Matthias Krüger
ba93a4f674
Rollup merge of #146849 - joshtriplett:macro-reduce-legacy-bang, r=petrochenkov
Reduce some uses of `LegacyBang`

- **Switch `dummy_bang` from `LegacyBang` to `Bang`**
- **mbe: Switch dummy extension used for errors from `LegacyBang` to `Bang`**
2025-09-26 18:11:12 +02:00
Matthias Krüger
35f443d318
Rollup merge of #146778 - nikic:allocator-shim-attributes, r=jackh726
Use standard attribute logic for allocator shim

Use llfn_attrs_from_instance() to generate the attributes for the allocator shim. This ensures that we generate all the usual attributes (and don't get to find out one-by-one that a certain attribute is important for a certain target). Additionally this will enable emitting the allocator-specific attributes (not included here).

This change is quite awkward because the allocator shim uses SimpleCx, while llfn_attrs_from_instance uses CodegenCx. I've switched it to use SimpleCx plus tcx/sess arguments where necessary. If there's a simpler way to do this, I'd love to know about it...
2025-09-26 18:11:11 +02:00
Matthias Krüger
ebe90c7ae7
Rollup merge of #146758 - mati865:amd64_mingw_no_rs_objects, r=petrochenkov
Stop linking rs{begin,end} objects on x86_64-*-windows-gnu

Until now, x86_64-pc-windows-gnu linked `rsbegin.o` and `rsend.o` just like i686-pc-windows-gnu, even though they were no-ops for it. This was likely done for the simplicity back when it was introduced.
Today the things are different and these startup/end objects harm other features, like `build-std`. Given the demotion of i686-pc-windows-gnu from tier 1, there is no point in hurting x86_64-pc-windows-gnu, which remains a tier 1.

The files are still shipped in case downstream crates expect them, as in case of the unmaintained `xargo`.

Fixes https://github.com/rust-lang/rust/issues/146739
2025-09-26 18:11:10 +02:00
Matthias Krüger
d09bb02eb5
Rollup merge of #146704 - jdonszelmann:port-debug-visualizer, r=petrochenkov
port `#[debugger_visualizer]` to the new attribute system
2025-09-26 18:11:09 +02:00
Matthias Krüger
024fbad4a0
Rollup merge of #146523 - thejpster:demote-armebv7r-targets, r=jackh726
Demote both armebv7r-none-* targets.

OK, slightly more controversial than https://github.com/rust-lang/rust/pull/146520 and https://github.com/rust-lang/rust/pull/146522  - I'd like to drop the bare-metal **big-endian** Armv7-R targets down to Tier 3.

The reason is simple - we cannot test them in https://github.com/rust-embedded/cortex-ar/. This because QEMU support for Big Endian Armv7-R is broken. I tried quite hard, but all the strings I printed with semihosting came out byte swapped (or "etybawa depp") because of how QEMU kludges the access to memory in big-endian mode.

The target also has only a single maintainer. Although, if ````@chrisnc```` wants to put up a case for keeping it at Tier 2 though, I'm happy to hear it!

This PR wil be rebased once https://github.com/rust-lang/rust/pull/146419 completes the queue.
2025-09-26 18:11:09 +02:00
Matthias Krüger
8d93181862 Rollup merge of #145113 - petrochenkov:lessfinalize, r=lcnr
resolve: Do not finalize shadowed bindings

I.e. do not mark them as used, or non-speculatively loaded, or similar.
Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
2025-09-26 18:11:08 +02:00
Matthias Krüger
f104ae4252
Rollup merge of #145113 - petrochenkov:lessfinalize, r=lcnr
resolve: Do not finalize shadowed bindings

I.e. do not mark them as used, or non-speculatively loaded, or similar.
Previously they were sometimes finalized during early resolution, causing issues like https://github.com/rust-lang/rust/pull/144793#issuecomment-3168108005.
2025-09-26 18:11:08 +02:00
bors
54a8a1db60 Auto merge of #146885 - lcnr:method-selection-opaques, r=BoxyUwU
support opaque types in method selection

See my notes in https://hackmd.io/4ILASx3mQ3u_gW9r1JyqCw.

This PR builds on https://github.com/rust-lang/rust/pull/145993 and allows not-yet defined opaque types as self types in the `method_autoderef_chain`.

E.g. for `Box<impl Deref<impl Foo>>` this results in the autoderef chain `Box<impl Deref> -> ?deref_hidden_ty -> ?foo_hidden_ty`. Method selection stays ambiguous if the final autoderef step is still an infer var unless that var is an opaque.

TODO: treating opaques as rigid jank.

r? `@BoxyUwU`
2025-09-26 16:10:47 +00:00
J. Neuschäfer
07bb89f98d Update memchr to 2.7.6
memchr 2.7.6 contains a bugfix for aarch64_be
2025-09-26 17:48:20 +02:00
lcnr
c2e39c2f20 review 2025-09-26 16:37:08 +02:00
lcnr
d6fe533418 add tests 2025-09-26 16:33:15 +02:00
lcnr
eebf871fea move tests 2025-09-26 16:33:15 +02:00
lcnr
148fd9ad3c allow method calls on opaques 2025-09-26 16:33:15 +02:00
lcnr
6b379b560d use try_structurally_resolve_type for method receiver
We'll still error due to the `opt_bad_ty` of `method_autoderef_steps`.
This slightly worsens the span of `infer_var.method()` which is now the
same as for `Box::new(infer_var).method()`.

Unlike `structurally_resolve_type`, `probe_op` does not check whether
the infcx is already tainted, so this results in 2 previously not emitted
errors.
2025-09-26 16:33:15 +02:00
lcnr
70f6493f26 remove unnecessary structurally resolve
`autoderef` already resolved and `method_autoderef_steps` makes
sure we won't encounter an inference variable
2025-09-26 16:33:15 +02:00