| Age | Commit message (Collapse) | Author | Lines |
|
Specify that split_ascii_whitespace uses the same definition as is_ascii_whitespace
|
|
Clarify WTF-8 safety docs
This PR is a follow-up to PR #140159, which clarifies ~~two things~~:
- the WTF-8 safety comment [was confusing](https://github.com/rust-lang/rust/pull/140159#discussion_r2082766965), either surrogate condition is actually sufficient for safety, both are not required
- ~~the private `os_str::Slice` type name is easily confused with `std::slice`~~
~~Happy to bikeshed the `OsSlice` name, other alternatives are `OsStrSlice` and `StrSlice`. Now it's got a distinct name from `std::slice`, it's easy to search and replace.~~
cc ``@thaliaarchi`` ``@workingjubilee``
|
|
[rustdoc] Unify type aliases rendering with other ADT
Fixes #140739.
Better reviewed one commit at a time.
Just one thing I'm wondering: should we also render non-`repr` attributes? If so, I wonder if we shouldn't simply change `clean::TypeAlias` to contain the other ADT directly (`Struct`, `Enum` and `Union`) and remove the `TypeAlias::generics` field.
Can be done in a follow-up too.
cc ``@camelid``
r? ``@notriddle``
|
|
Simplify `attribute_groups`
It's more complicated than it needs to be.
r? ``@jdonszelmann``
|
|
Implement `normalize_lexically`
Implements #134694
This is, I think, the most straightforward implementation I could do, which will hopefully more easily allow experimentation if we decide to change the design here.
|
|
Subtree sync for rustc_codegen_cranelift
The main highlights this time are a Cranelift update and (thanks for beetrees) f16/f128 support.
r? `@ghost`
`@rustbot` label +A-codegen +A-cranelift +T-compiler
|
|
|
|
sync_cg_clif-2025-05-25
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- rust-lang/rust#141413 (Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING)
- rust-lang/rust#141443 (make teach_help message for cast-before-pass-to-variadic more precise)
- rust-lang/rust#141508 (bootstrap: clippy: set TESTNAME based on given paths)
- rust-lang/rust#141512 (Avoid extra path trimming in method not found error)
- rust-lang/rust#141530 (Added unstable feature doc comments to unstable book)
- rust-lang/rust#141541 (Random nits)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
Random nits
Two completely random commits that I didn't know where to integrate into another PR.
* Don't use the full type relation machinery to equate two regions (it's overkill).
* Add a comment that `select_in_new_trait_solver` shouldn't be used directly.
r? lcnr or reassign
|
|
Added unstable feature doc comments to unstable book
This PR adds doc comments for unstables features in [compiler/rustc_feature/src/unstable.rs](https://github.com/rust-lang/rust/blob/d3a2440384b54664dddd56e0081ca094c444e869/compiler/rustc_feature/src/unstable.rs#L190-L191) to the unstable book feature pages.
Fixes rust-lang/rust#141528
Example features rendered


r? `@jyn514`
|
|
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.
|
|
bootstrap: clippy: set TESTNAME based on given paths
This addresses #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].
|
|
make teach_help message for cast-before-pass-to-variadic more precise
r? `@workingjubilee`
based on your comment [here](https://github.com/rust-lang/rust/issues/44930#issuecomment-2199663198)
|
|
Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING
The `#[cfg(version(...))]` feature is currently under-tested. Part of it is the difficulty that it is hard to write a test that never changes, while the version of the Rust compiler indeed *does* change.
PR #81468 added the first and so far only test of `#[cfg(version(...))]`'s functionality (there is one other test for the *syntax*, that also acts as feature gate). But that test uses a proc macro that parses the version: the text of the test doesn't contain the actual `#[cfg(version(...))]`.
This PR makes `#[cfg(version(...))]` respect `RUSTC_OVERRIDE_VERSION_STRING`, added by PR #124339, allowing us to virtually pin the rustc version and write tests from all directions against some specific version.
The PR also adds a functional test of `#[cfg(version(...))]` that leverages `RUSTC_OVERRIDE_VERSION_STRING`.
Pulled out of #141137.
Tracking issue: #64796
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implement `advance_by` via `try_fold` for `Sized` iterators
When `try_fold` is overriden, it is usually easier for compilers to optimize.
Example difference: https://iter.godbolt.org/z/z8cEfnKro
|
|
|
|
|
|
|
|
|
|
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
|
|
Co-authored-by: Jubilee <workingjubilee@gmail.com>
|
|
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:
- https://github.com/immunant/rust/commit/08140878fefaa4b16939b904bf825b7107069b42 original implementation
- https://github.com/immunant/rust/commit/b9ea653aee231114acbe6d4b3c7b1d692772d060 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`
|
|
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
|
|
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.
|
|
rustdoc: on mobile, make the sidebar full width and linewrap
this is because the mobile sidebar cannot be resized, unlike on desktop.
|
|
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].
|
|
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
Use C-string literals to reduce boilerplate
Reduce boilerplate in doctests by replacing fallible function calls with
literals.
|
|
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```
|
|
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.
|
|
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
|
|
- 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
|
|
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`
|
|
|
|
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
|