Commit Graph

303456 Commits

Author SHA1 Message Date
Guillaume Gomez 094b893f77 Rollup merge of #144975 - joshtriplett:file-times-dir, r=jhpratt
`File::set_times`: Update documentation and example to support setting timestamps on directories

Inspired by https://github.com/rust-lang/rust/issues/123883 .
2025-08-06 21:29:32 +02:00
Guillaume Gomez 09de71b61c Rollup merge of #144972 - the8472:file-prefix-docs, r=joshtriplett
add code example showing that file_prefix treats dotfiles as the name of a file, not an extension

This came up in a libs-api meeting while we were reviewing rust-lang/rust#144870
2025-08-06 21:29:31 +02:00
Guillaume Gomez de6c639228 Rollup merge of #144970 - lolbinarycat:rustdoc-macro-wrong-link-144965, r=GuillaumeGomez
rustdoc: fix caching of intra-doc links on reexports

previously two reexports of the same item would share a set of intra-doc links, which would cause problems if they had two different links with the same text.  this was fixed by using the reexport defid as the key, if it is available.

fixes https://github.com/rust-lang/rust/issues/144965
2025-08-06 21:29:31 +02:00
Guillaume Gomez 48d57564cf Rollup merge of #144956 - fmease:gate-const-trait-syntax, r=BoxyUwU
Gate const trait syntax

Missed this during my review of rust-lang/rust#143879, huge apologies!
Fixes [after beta backport] https://github.com/rust-lang/rust/issues/144958.

cc ``@fee1-dead``
r? ``@BoxyUwU`` or anyone
2025-08-06 21:29:30 +02:00
Guillaume Gomez f7520353ab Rollup merge of #144948 - lcnr:change-candidate-handling, r=compiler-errors
we only merge candidates for trait and normalizes-to goals

so change `fn try_merge_responses` to `fn try_merge_candidates` and just use candidates everywhere.

Potentially slightly faster than the alternative :3

r? ``@compiler-errors`` ``@BoxyUwU``
2025-08-06 21:29:29 +02:00
Guillaume Gomez 65479f7353 Rollup merge of #144917 - compiler-errors:tail-call-linked-lifetimes, r=lcnr
Enforce tail call type is related to body return type in borrowck

Like all call terminators, tail call terminators instantiate the binder of the callee signature with region variables and equate the arg operand types with that signature's args to ensure that the call is valid.

However, unlike normal call terminators, we were forgetting to also relate the return type of the call terminator to anything. In the case of tail call terminators, the correct thing is to relate it to the return type of the caller function (or in other words, the return local `_0`).

This meant that if the caller's return type had some lifetime constraint, then that constraint wouldn't flow through the signature and affect the args.

This is what's happening in the example test I committed:

```rust
fn link(x: &str) -> &'static str {
    become passthrough(x);
}

fn passthrough<T>(t: T) -> T { t }

fn main() {
    let x = String::from("hello, world");
    let s = link(&x);
    drop(x);
    println!("{s}");
}
```

Specifically, the type `x` is `'?0 str`, where `'?0` is some *universal* arg. The type of `passthrough` is `fn(&'?1 str) -> &'?1 str`. Equating the args sets `'?0 = '?1`. However, we need to also equate the return type `&'?1 str` to `&'static str` so that we eventually require that `'?0 = 'static`, which is a borrowck error!

-----

Look at the first commit for the functional change, and the second commit is just a refactor because we don't need to pass `Option<BasicBlock>` to `check_call_dest`, but just whether or not the terminator is expected to be diverging (i.e. if the return type is `!`).

Fixes rust-lang/rust#144916
2025-08-06 21:29:29 +02:00
Guillaume Gomez 5209bc6661 Rollup merge of #144861 - Kivooeo:payload-as-str-stabilization, r=ChrisDenton
Stabilize `panic_payload_as_str` feature

Closes [tracking issue](https://github.com/rust-lang/rust/issues/125175).

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

FCP ended more than year ago in tracking issue, I'm not sure if we should rerun it.
2025-08-06 21:29:28 +02:00
Guillaume Gomez 940a003985 Rollup merge of #144835 - compiler-errors:tail-call-sig-binder, r=WaffleLapkin
Anonymize binders in tail call sig

See the comment for explanation

Fixes rust-lang/rust#144826

r? WaffleLapkin
2025-08-06 21:29:27 +02:00
Guillaume Gomez 96a41c5aba Rollup merge of #144794 - scrabsha:push-noqrrttovmwy, r=jdonszelmann
Port `#[coroutine]` to the new attribute system

Related to https://github.com/rust-lang/rust/issues/131229#issue-2565886367.

r? `````@jdonszelmann`````
2025-08-06 21:29:27 +02:00
Guillaume Gomez d180873be8 Rollup merge of #144195 - Kivooeo:bad-attr, r=fmease,compiler-errors
Parser: Recover from attributes applied to types and generic args

r? compiler

Add clearer error messages for invalid attribute usage in types or generic types

fixes rust-lang/rust#135017
fixes rust-lang/rust#144132
2025-08-06 21:29:26 +02:00
bors 7d82b83ed5 Auto merge of #144509 - cuviper:relnotes-1.89.0, r=BoxyUwU
Add release notes for 1.89.0

r? `@BoxyUwU`
cc `@rust-lang/release`
`@rustbot` ping relnotes-interest-group
2025-08-06 19:28:30 +00:00
dianne b7de539805 lower bindings in the order they're written 2025-08-06 12:13:40 -07:00
dianne ea1eca5e3b base drop order on the first sub-branch 2025-08-06 12:13:12 -07:00
Paul Murphy 0bba9bd55c Explicitly disable vector feature on s390x baseline of bad-reg test
If the baseline s390x cpu is changed to a newer variant, such as z13,
the vector feature may be enabled by default. When rust is packaged
on fedora 38 and newer, it is set to z13.

Explicitly disable vector support on the baseline test for consistent
results across s390x cpus.
2025-08-06 14:12:38 -05:00
AlexanderPortland 56d5aab31d make rustc_public types derive Hash 2025-08-06 12:07:02 -07:00
dianne 856e3816c3 don't schedule unnecessary drops when lowering or-patterns
This avoids scheduling drops and immediately unscheduling them. Drops
for guard bindings/temporaries are still scheduled and unscheduled as
before.
2025-08-06 11:42:15 -07:00
Josh Triplett e597071cbf Reword documentation for set_times to clarify directory handling 2025-08-06 11:41:16 -07:00
Florian Diebold 4ff22ddc9d Move some TypeVisitable/TypeFoldable impls to rustc_type_ir 2025-08-06 18:35:56 +00:00
bjorn3 7d88f657e9 Fix ICE 2025-08-06 18:31:58 +00:00
lolbinarycat ef3708bf63 Link from "Overview of the compiler § Queries" to the Queries chapter
There's already a link in the other direction, so this seems fairly logical.
2025-08-06 13:31:52 -05:00
bjorn3 e02cc40ec9 Revert "Preserve the .debug_gdb_scripts section"
This reverts commit 868bdde25b.
2025-08-06 18:01:07 +00:00
bjorn3 270c1a4d24 Revert "Embed GDB pretty printers in rlibs and dylibs"
This reverts commit b4d923cea0.
2025-08-06 18:00:58 +00:00
Alejandra González 4cb43f4c41 Optimize needless_bool lint (#15423)
Two optimizations have been done when checking for the context in which
to apply the lint:

- Checking for the mere presence of comments does not require building a
`String` with the comment to then check if it is empty and discard it.
- Checking for the presence of comment can be done after we have checked
that we do have a `if` construct that we intend to lint instead of for
every expression.

changelog: none

r? blyxyas
2025-08-06 17:59:23 +00:00
Samuel Tardieu 8602faa6ff Optimize needless_bool lint
Two optimizations have been done when checking for the context in which
to apply the lint:

- Checking for the mere presence of comments does not require building a
  `String` with the comment to then check if it is empty and discard it.
- Checking for the presence of comment can be done after we have checked
  that we do have a `if` construct that we intend to lint instead of for
  every expression.
2025-08-06 19:49:22 +02:00
Sasha Pourcelot 1e271d6ed1 Allow function argument mismatch suggestion to be multiline 2025-08-06 19:17:36 +02:00
Alejandra González a4d43215b8 Optimize incompatible_msrv lint (#15422)
This limits repeated lookups in pre-checks (to determine if a MSRV
should be checked), especially when those require locking up an
interner:

- The `core` crate is looked up once when creating the lint, instead of
comparing the crate name with `sym::core` at every check.
- `span.ctxt().outer_expn_data()` is lookup up only once.

changelog: none
r? blyxyas
2025-08-06 16:25:34 +00: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
Philipp Krones 925710d73e Remove CSS bootstrap dependency (#15251)
Follow-up of https://github.com/rust-lang/rust-clippy/pull/15208.

This PR removes the CSS `bootstrap` dependency which contains 1504 CSS
rules and weights 16.1 kB minified. Considering we used less than 50 of
these rules, it's quite a waste.

So this time, there are minor UI changes:
* The "expand/collapse all" buttons icon changed. It now uses the one
from font-awesome. It's quite close but not exactly the same.
* The layout is slightly different (you need to switch between two tabs
to actually see the difference).

Before this PR:

<img width="719" height="515" alt="image"
src="https://github.com/user-attachments/assets/1f067046-4ee9-49ee-bf38-50a8bf9888f2"
/>

With this PR:

<img width="719" height="515" alt="image"
src="https://github.com/user-attachments/assets/80331c98-1a1e-418f-b481-5b3f5c276926"
/>

With this, we will be able to go even further on reducing the page size
next. =D

This time, the DOM size itself reduced a bit but the difference is too
small to be noteworthy.

r? @samueltardieu

changelog: Remove CSS bootstrap dependency
2025-08-06 16:02:08 +00:00
Boxy 7bc34622f0 tidy 2025-08-06 16:55:50 +01:00
Guillaume Gomez a2b1714fb2 Add regression test for rustdoc scrape-examples feature crash (#144752) 2025-08-06 17:26:08 +02:00
LorrensP-2158466 71add2f5f7 Change stdlib float tests to account for miri nondet floats. 2025-08-06 17:21:04 +02:00
Guillaume Gomez 768f97748f Fix rustdoc scrape-examples feature crash 2025-08-06 17:14:49 +02:00
Jakub Beránek b1f49d8728 Fix build/doc/test of error index generator
It is essentially a RustcPrivate tool, so it should be treated as such using the new `RustcPrivateCompilers` infra.
2025-08-06 17:10:13 +02:00
Amanda Stjerna 648e3fc393 Track names of existentials 2025-08-06 16:58:42 +02:00
ginnyTheCat a7e8fe7311 Clarify EOF handling for BufRead::skip_until 2025-08-06 16:52:43 +02:00
Amanda Stjerna 61e8869ed9 Proposed format 2025-08-06 16:35:20 +02:00
Samuel Tardieu 26911aa32c Optimize incompatible_msrv lint
This limits repeated lookups in pre-checks (to determine if a MSRV
should be checked), especially when those require locking up
an interner:

- The `core` crate is looked up once when creating the lint, instead of
  comparing the crate name with `sym::core` at every check.
- `span.ctxt().outer_expn_data()` is lookup up only once.
2025-08-06 16:30:31 +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 66f0f27290 Rollup merge of #144978 - ehuss:intrinsic-doc-links, r=scottmcm
Fix some doc links for intrinsics

This fixes a few intrinsic docs that had a link directly to itself instead of to the correct function in the `mem` module.
2025-08-06 15:55:49 +02:00
Jakub Beránek 84dc97c2b6 Rollup merge of #144971 - okaneco:rename_isolate_ones, r=joshtriplett
num: Rename `isolate_most_least_significant_one` functions

Tracking issue - https://github.com/rust-lang/rust/issues/136909

libs-api has agreed to rename these unstable functions to `isolate_highest_one`/`isolate_lowest_one`
https://github.com/rust-lang/rust/issues/136909#issuecomment-3156005820

`isolate_most_significant_one` -> `isolate_highest_one`
`isolate_least_significant_one` -> `isolate_lowest_one`
2025-08-06 15:55:48 +02:00
Jakub Beránek a88e29b0d7 Rollup merge of #144954 - Zalathar:run-make-bless, r=jieyouxu
run-make: Allow blessing snapshot files that don't exist yet

This makes it possible to bless the snapshot files used by `diff()` in newly-created run-make tests, without having to create the files manually beforehand.

r? jieyouxu
2025-08-06 15:55:48 +02:00
Jakub Beránek 07e86341a5 Rollup merge of #144945 - WaffleLapkin:autolabeletc, r=WaffleLapkin
Autolabel PRs that change explicit tail call tests as `F-explicit_tail_calls`

mrrrow~
2025-08-06 15:55:47 +02: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
Jakub Beránek 6afd162762 Rollup merge of #144926 - JonathanBrouwer:fix-mustuse, r=cuviper
Correct the use of `must_use` on btree::IterMut

I'm working on stricter target checking for attributes and found this one
2025-08-06 15:55:46 +02:00
Jakub Beránek 5ac085681b Rollup merge of #144924 - lolbinarycat:compiletest-pass-directives-hint, r=clubby789
compiletest: add hint for when a ui test produces no errors
2025-08-06 15:55:46 +02:00
Jakub Beránek 4b6971e254 Rollup merge of #144913 - GuillaumeGomez:fix-wrong-i-icon, r=fmease
[rustdoc] Fix wrong `i` tooltip icon

Current wrong display:

<img width="334" height="37" alt="Screenshot From 2025-08-04 17-42-38" src="https://github.com/user-attachments/assets/57046475-6162-487f-998f-ebb2434c111d" />

With the fix:

<img width="334" height="37" alt="image" src="https://github.com/user-attachments/assets/e761a103-dc39-4e30-8c8e-cfc7fab52fde" />

r? ``@fmease``
2025-08-06 15:55:45 +02:00