Commit Graph

291081 Commits

Author SHA1 Message Date
Chris Denton
c299e297ee Implement normalize lexically 2025-05-25 08:11:41 +00:00
bors
aa57e46e24 Auto merge of #141529 - jhpratt:rollup-8dle839, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#139831 (rustdoc: on mobile, make the sidebar full width and linewrap)
 - rust-lang/rust#140950 (More option optimization tests)
 - rust-lang/rust#141108 (Docs(lib): Fix `extract_if` docs)
 - rust-lang/rust#141361 (use `cfg_select!` to select the right `VaListImpl` definition)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-25 07:37:05 +00:00
Ralf Jung
4e8b8dad7f fix help message
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-05-25 09:35:36 +02:00
Samuel Tardieu
c12bc22167 Update askama to 0.14.0 version (#14888)
No breaking changes for clippy in this update (which only impacts the
lint page).

The askama release information is
[here](https://github.com/askama-rs/askama/releases/tag/v0.14.0).

r? @samueltardieu

changelog: update askama version to `0.14.0`
2025-05-25 07:26:12 +00:00
Ralf Jung
396c5cafe7 clean up old rintf leftovers 2025-05-25 09:24:28 +02:00
yanglsh
7ffc886472 fix: manual_find suggests wrongly when return type needs adjustment 2025-05-25 15:05:05 +08:00
Ralf Jung
0e5a162b08 Merge pull request #4349 from rust-lang/rustup-2025-05-25
Automatic Rustup
2025-05-25 06:31:23 +00:00
The Miri Cronjob Bot
f25ec486d7 fmt 2025-05-25 05:02:30 +00:00
The Miri Cronjob Bot
da39cbec73 Merge from rustc 2025-05-25 05:01:19 +00:00
The Miri Cronjob Bot
5c65c35d26 Preparing for merge from rustc 2025-05-25 04:53:55 +00:00
Jacob Pratt
c27b7c2214 Rollup merge of #141361 - folkertdev:varargs-cfg, r=workingjubilee
use `cfg_select!` to select the right `VaListImpl` definition

tracking issue: https://github.com/rust-lang/rust/issues/44930

Just a bit of cleanup really.

We could use `PhantomInvariantLifetime<'f>` (https://github.com/rust-lang/rust/issues/135806) to make it more precise what that `PhantomData<&'f mut &'f c_void>` marker is doing. I'm not sure how ready that feature is though, `@jhpratt` are these types good to use internally?

---

Some research into the lifetimes of `VaList` and `VaListImpl`:

It's easy to see why the lifetime of these types should not be extended, a `VaList` or `VaListImpl` escaping its function is a bad idea. I don't currently see why coercing the lifetime to a shorter lifetime is problematic though, but probably I just don't understand variance well enough to see it. The history does not provide much explanation:

- 08140878fe original implementation
- b9ea653aee adds `VaListImpl<'f>`, but it is only covariant in `'f`
- https://github.com/rust-lang/rust/pull/62639 makes `VaListImpl<'f>` invariant over `'f` (because `VaList<'a, 'f>` is already invariant over `'f`, but I think that is just an implementation detail?)

Beyond that I don't see how the lifetime situation can be simplified significantly, e.g. this function really needs `'copy` to be unconstrained.

```rust
/// Copies the `va_list` at the current location.
pub unsafe fn with_copy<F, R>(&self, f: F) -> R
where
    F: for<'copy> FnOnce(VaList<'copy, 'f>) -> R,
{
    let mut ap = self.clone();
    let ret = f(ap.as_va_list());
    // SAFETY: the caller must uphold the safety contract for `va_end`.
    unsafe {
        va_end(&mut ap);
    }
    ret
}
```

`@rustbot` label +F-c_variadic
r? `@workingjubilee`
2025-05-25 04:00:57 +02:00
Jacob Pratt
3338ff7dcf Rollup merge of #141108 - PaulDance:fix-extract_if-docs, r=Mark-Simulacrum
Docs(lib): Fix `extract_if` docs

Various fixes to the documentation comments of the several `extract_if` collection methods available. It originally started with a small typo fix in `Vec`'s spotted when reading the 1.87 release notes, but then by looking at the others' for comparison in order to try determining what was the intended sentence, some inconsistencies were spotted. Therefore, some other changes are also proposed here to reduce these avoidable differences, going more and more nit-picky along the way. See the individual commits for more details about each change.

`@rustbot` label T-libs A-collections A-docs
2025-05-25 04:00:56 +02:00
Jacob Pratt
3f91bbcd5f Rollup merge of #140950 - clubby789:nonzero-ord-test, r=Mark-Simulacrum
More option optimization tests

I noticed that although adding a manual implementation for PartialOrd on Option in #122024, I didn't add a test so that we can easily check if this behavior has improved.

This also adds a couple of `should-fail` tests - this will allow us to remove these hacky implementations if upstream LLVM improves.
2025-05-25 04:00:55 +02:00
Jacob Pratt
045ac21c6f Rollup merge of #139831 - lolbinarycat:rustdoc-mobile-sidebar, r=GuillaumeGomez
rustdoc: on mobile, make the sidebar full width and linewrap

this is because the mobile sidebar cannot be resized, unlike on desktop.
2025-05-25 04:00:55 +02:00
xtex
4350fd170e bootstrap: clippy: set TESTNAME based on given paths
This addresses issue 104200 by setting the TESTNAME environment
variable automatically based on the paths from run configs,
marking a selected set of UI tests to be run.

Note that this does not filter out other unit tests using #[test].
2025-05-25 09:55:50 +08:00
Ada Alakbarova
6291b91cad docs(trait_checking): import the right function
`is_trait_method` is not even used in this codeblock, whereas `implements_trait` is used but not imported
2025-05-25 02:41:29 +02:00
jyn
4de3f8975a document existing setup 2025-05-24 19:49:21 -04:00
est31
f3245e48f9 Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING 2025-05-24 23:54:17 +02:00
Fluid
6d47489e56 improve the std::fs::create_dir_all docs related to atomicity 2025-05-25 00:34:56 +03:00
Noratrieb
01503d0c1e Avoid extra path trimming in method not found error
Method errors have an extra check that force trim paths whenever the
normal string is longer than 10 characters, which can be quite unhelpful
when multiple items have the same name (for example an `Error`).

A user reported this force trimming as being quite unhelpful when they
had a method error where the precise path of the `Error` mattered.

The code uses `tcx.short_string` already to get the normal path, which
tries to be clever around trimming paths if necessary, so there is no
reason for this extra force trimming.
2025-05-24 23:31:07 +02:00
bors
3d86494a0d Auto merge of #141518 - GuillaumeGomez:rollup-ivjep2j, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#140066 (Stabilize `<[T; N]>::as_mut_slice` as `const`)
 - rust-lang/rust#141105 (additional edge cases tests for `path.rs` 🧪 )
 - rust-lang/rust#141487 (Update askama to `0.14.0`)
 - rust-lang/rust#141498 (Use C-string literals to reduce boilerplate)
 - rust-lang/rust#141505 (rename internal panicking::try to catch_unwind)
 - rust-lang/rust#141511 (Cleanup CodegenFnAttrFlags)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-24 21:00:10 +00:00
Tshepang Mbambo
248f4b2ad2 reduce clutter... too many imports 2025-05-24 22:17:55 +02:00
Tshepang Mbambo
a3bd12b88a Path::with_extension: improve examples 2025-05-24 22:12:15 +02:00
Guillaume Gomez
7cd749deff Rollup merge of #141511 - Noratrieb:codegen-fn-attrs, r=compiler-errors
Cleanup CodegenFnAttrFlags

- Rename `USED` to `USED_COMPILER` to better reflect its behavior.
- Reorder some items to group the used and allocator flags together
- Renumber them without gaps
2025-05-24 21:23:50 +02:00
Guillaume Gomez
76ca0e2d62 Rollup merge of #141505 - RalfJung:catch_unwind, r=Noratrieb
rename internal panicking::try to catch_unwind

The public function is called `catch_unwind`, the intrinsic at some point got renamed to `catch_unwind` -- there's no reason to have the internal implementation of this still be called `try`, so let's rename it to match the rest.
2025-05-24 21:23:49 +02:00
Guillaume Gomez
c4a313ad06 Rollup merge of #141498 - tamird:cstr-example-noise, r=jhpratt
Use C-string literals to reduce boilerplate

Reduce boilerplate in doctests by replacing fallible function calls with
literals.
2025-05-24 21:23:49 +02:00
Guillaume Gomez
0846035d2d Rollup merge of #141487 - GuillaumeGomez:update-askama, r=notriddle
Update askama to `0.14.0`

[Askama 0.14.0 release notes](https://github.com/askama-rs/askama/releases/tag/v0.14.0)

Just one change needed for a filter in rustdoc.

r? ```@notriddle```
2025-05-24 21:23:48 +02:00
Guillaume Gomez
284aaee0c1 Rollup merge of #141105 - GrantBirki:grantbirki/path-tests, r=jhpratt
additional edge cases tests for `path.rs` 🧪

This pull request adds a few new edge case tests to the `std::path` module. The new tests cover scenarios such as paths with only separators, non-ASCII and Unicode characters, embedded new lines, etc. Each new test is documented with some helpful in-line comments as well.
2025-05-24 21:23:48 +02:00
Guillaume Gomez
07157b78b1 Rollup merge of #140066 - thaliaarchi:const-array-as-mut-slice, r=jhpratt
Stabilize `<[T; N]>::as_mut_slice` as `const`

This is trivial and has no design questions.

Tracked in https://github.com/rust-lang/rust/issues/133333.

r? libs-api
2025-05-24 21:23:47 +02:00
Guillaume Gomez
f674c809c8 Update askama to 0.14.0 version 2025-05-24 21:18:16 +02:00
binarycat
4ef35bcaef rustdoc: use descriptive tooltip if doctest is conditionally ignored
fixes https://github.com/rust-lang/rust/issues/141092
2025-05-24 14:15:20 -05:00
llogiq
b6b97a741c Fix assign_op_pattern FP on unstable const trait (#14886)
Closes rust-lang/rust-clippy#14871

----

changelog: [`assign_op_pattern`]: fix false positive on unstable const
trait
2025-05-24 19:08:46 +00:00
Ralf Jung
8a7911019f Merge pull request #4348 from RalfJung/urlfix
fix zulip topic URL
2025-05-24 18:50:05 +00:00
Noratrieb
fa2bb599bc Cleanup CodegenFnAttrFlags
- Rename `USED` to `USED_COMPILER` to better reflect its behavior.
- Reorder some items to group the used and allocator flags together
- Renumber them without gaps
2025-05-24 20:31:37 +02:00
Ralf Jung
4bbcb47239 fix zulip topic URL 2025-05-24 20:19:30 +02:00
Alex Macleod
843a45f384 Consider consts in patterns as refutable 2025-05-24 18:11:35 +00:00
yanglsh
03af37302c fix: assign_op_pattern FP on unstable const trait 2025-05-25 02:02:11 +08:00
bors
5e16c66206 Auto merge of #141372 - khuey:ir_call_dbg_loc, r=jieyouxu
Use the fn_span when emitting function calls for better debug info.

This especially improves the developer experience for long chains of function calls that span multiple lines, which is common with builder patterns, chains of iterator/future combinators, etc.

try-job: armhf-gnu
try-job: test-various
try-job: x86_64-msvc-1
try-job: arm-android

r? `@jieyouxu`
2025-05-24 17:48:21 +00:00
许杰友 Jieyou Xu (Joe)
a34ef820a4 Merge pull request #2357 from mejrs/diag
Update `rustc_on_unimplemented` docs
2025-05-25 01:18:36 +08:00
mejrs
d0582aacc1 Update rustc_on_unimplemented docs 2025-05-24 19:16:01 +02:00
dswij
24a2a6629d Support different lintcheck CARGO_TARGET_DIR env variables (#14859)
Make lintcheck support different `CARGO_TARGET_DIR`, do not hardcode
`target` (useful for perf)

changelog:none
2025-05-24 16:57:47 +00:00
llogiq
836c6579d7 Remove compiletest headers test (#14884)
`ui_test` detects old style headers so it's redundant

changelog: none
2025-05-24 16:20:01 +00:00
Alex Macleod
e3adf1428b Remove compiletest headers test 2025-05-24 15:27:31 +00:00
Ralf Jung
1827bc0f39 rename internal panicking::try to catch_unwind 2025-05-24 16:32:00 +02:00
bors
038d599eda Auto merge of #141506 - matthiaskrgr:rollup-80f1geg, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #137323 (Guarantee behavior of transmuting `Option::<T>::None` subject to NPO)
 - #139254 (std: sys: net: uefi: Implement TCP4 connect)
 - #141432 (refactor `CanonicalVarKind`)
 - #141480 (document some -Z flags as living in the rustc-dev-guide)
 - #141486 (rustdoc book: add argument explanation for `html_playground_url`)
 - #141496 (Enable `[issue-links]` and `[no-mentions]` in triagebot)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-24 14:20:44 +00:00
Ralf Jung
ff3341434d ScalarInt: support conversion with signed int types and cmp::Ordering 2025-05-24 16:13:10 +02:00
Matthias Krüger
f84ffe29e1 Rollup merge of #141496 - Urgau:triagebot_issue_link_no-mentions, r=Kobzol
Enable `[issue-links]` and `[no-mentions]` in triagebot

This PR enables the [`[issue-links]`](https://forge.rust-lang.org/triagebot/issue-links.html) and [`[no-mentions]`](https://forge.rust-lang.org/triagebot/no-mentions.html) handlers of triagebot.

Most of our subtrees have already adopted them:
 - https://github.com/rust-lang/rust-analyzer/pull/19555
 - https://github.com/rust-lang/rust-clippy/pull/14563 & https://github.com/rust-lang/rust-clippy/pull/14576
 - https://github.com/rust-lang/rustc-dev-guide/pull/2335
 - https://github.com/rust-lang/miri/pull/4259
 - https://github.com/rust-lang/reference/pull/1788

r? `@Kobzol`
2025-05-24 16:08:48 +02:00
Matthias Krüger
b0924297e1 Rollup merge of #141486 - xizheyin:issue-141414, r=GuillaumeGomez
rustdoc book: add argument explanation for `html_playground_url`

Fixes #141414

r? `@GuillaumeGomez`
2025-05-24 16:08:48 +02:00
Matthias Krüger
3e16a3ee9c Rollup merge of #141480 - jyn514:treat-err-as-bug, r=jieyouxu
document some -Z flags as living in the rustc-dev-guide

i was looking for these but didn't find them at first; add a breadcrumb so people know where to look
2025-05-24 16:08:47 +02:00
Matthias Krüger
4b8dcb5cf8 Rollup merge of #141432 - lcnr:canonicalize-regions, r=compiler-errors
refactor `CanonicalVarKind`

it's unnecessary. I don't believe we'll ever need to store additional info shared by all `CanonicalVarKind`s.

r? `@compiler-errors`
2025-05-24 16:08:46 +02:00