| Age | Commit message (Collapse) | Author | Lines |
|
|
|
fix: Address minor FIXME
|
|
|
|
Add expression fill mode variant for filling with underscore expressions
|
|
|
|
|
|
internal: Sync from downstream
|
|
|
|
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #138395 (Download GCC from CI on test builders)
- #138737 (uefi: Update r-efi)
- #138939 (Add `Arc::is_unique`)
- #139224 (fix(test): Expose '--no-capture' in favor of `--nocapture`)
- #139546 (std(docs): clarify how std::fs::set_permisions works with symlinks)
- #140345 (Avoid re-interning in `LateContext::get_def_path`)
- #140351 (docs: fix incorrect stability markers on `std::{todo, matches}`)
- #140359 (specify explicit safety guidance for from_utf8_unchecked)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
specify explicit safety guidance for from_utf8_unchecked
The PR addresses missing safety guidelines in two APIs by adding explicit text to the cross-linked reference.
|
|
docs: fix incorrect stability markers on `std::{todo, matches}`
This regression appeared in 916cfbcd3ed95a737b5a62103bbc4118ffe1eb2b. The change is behaving as expected (a non-glob re-export uses the stability marker on the `use` item, not the original one), but this part of the standard library didn't follow it.
Fixes https://github.com/rust-lang/rust/issues/140344
|
|
Avoid re-interning in `LateContext::get_def_path`
The def path printer in `get_def_path` essentially calls `Symbol::intern(&symbol.to_string())` for simple symbols in a path. This accounts for ~30% of the runtime of get_def_path.
We can avoid this by simply appending the symbol directly when available.
|
|
std(docs): clarify how std::fs::set_permisions works with symlinks
fixes https://github.com/rust-lang/rust/issues/75942
fixes https://github.com/rust-lang/rust/issues/124201
|
|
fix(test): Expose '--no-capture' in favor of `--nocapture`
This improves consistency with commonly expected CLI conventions,
avoiding a common stutter people make when running tests (trying what
they expect and then having to check the docs to then user whats
accepted).
An alternative could have been to take a value, like `--capture <value>` (e.g. `pytest` does this).
Overall, we're shifting focus for features to custom test harnesses (see #134283).
Most of `pytest`s modes will likely be irrelevant in that situation.
As for the rest, its too early to tell which, if any, may be relevant,
so we're sticking with this small, quality of life improvement.
I expect we'll warn about `--nocapture` being deprecated in the future after a sufficient transition period has been allowed.
By deprecating `--nocapture`, we intend that custom test harnesses do
not need to support it for reasons outside of their own compatibility
requirements, much like the deprecation in #134283
I'm punting for now on the naming of `RUST_TEST_NOCAPTURE`.
I feel like T-testing-devex should do a wider look at environment
variables role in lib`test` before evaluating whether to
- Deprecate it in favor of the user passing CLI flags or the test runner
providing its own config
- Deprecate in favor of `RUST_TEST_NO_CAPTURE`
- Deprecate in favor of `RUST_TEST_CAPTURE`
Other CLI flags were evaluated for casing consistency:
- `--logfile` has the same problem but was deprecated in #134283
Regarding the implementation, I moved `--nocapture` out of `optgroups()`, into `parse_opts()`, out of an abundance of caution in passing the options without a deprecated value to the usage generation. However, the usage does not actually show optional flags, so this could potentially be dropped, simplifying the PR.
Note: `compiletest` added `--no-capture` instead of `--nocapture` in #134809
T-testing-devex FCP: https://github.com/rust-lang/rust/issues/133073#issuecomment-2486921104
Fixes #133073
|
|
Add `Arc::is_unique`
Adds
```rs
impl<T> Arc<T> {
pub fn is_unique(this: &Self) -> bool;
}
```
Tracking issue: #138938
ACP: https://github.com/rust-lang/libs-team/issues/560
|
|
uefi: Update r-efi
- Bump up the version to 5.2.0
try-job: x86_64-gnu-distcheck
try-job: x86_64-gnu
try-job: test-various
|
|
Download GCC from CI on test builders
This should reduce the duration of the `x86_64-gnu-llvm-18` job, which runs on PR CI, which is currently the only one that builds GCC (outside of the x64 dist builder).
Since we handle the GCC download in the GCC step, and not eagerly in config, we can set this flag globally across all test builders, as it won't do anything unless they actually try to build GCC.
Opening as a draft to test if it works on CI, because I still need to implement logic to avoid the download if there are any local modifications to GCC (essentially the "if-unchanged" mode, although I want to try something a bit different).
r? ```@ghost```
|
|
Update cargo
10 commits in d811228b14ae2707323f37346aee3f4147e247e6..7918c7eb59614c39f1c4e27e99d557720976bdd7
2025-04-15 15:18:42 +0000 to 2025-04-27 09:44:23 +0000
- overriding-dependencies.md: better readability (rust-lang/cargo#15459)
- source-replacement.md: fix typo (rust-lang/cargo#15458)
- Stabilize automatic garbage collection. (rust-lang/cargo#14287)
- Update doctest xcompile flags (rust-lang/cargo#15455)
- fix: Suggest similar looking feature names when feature is missing (rust-lang/cargo#15454)
- fix(unit-graph): switch to Package ID Spec (rust-lang/cargo#15447)
- chore(deps): update cargo-semver-checks to v0.41.0 (rust-lang/cargo#15446)
- Implement RFC3695: Allow boolean literals as cfg predicates (rust-lang/cargo#14649)
- chore: remove duplicate word in comment (rust-lang/cargo#15437)
- Fix formatting of CliUnstable parsing (rust-lang/cargo#15434)
r? ghost
|
|
Rollup of 4 pull requests
Successful merges:
- #140246 (Fix never pattern printing)
- #140280 (Improve if/else pretty printing)
- #140348 (Update lint-docs to default to Rust 2024)
- #140358 (Use `search_for_cycle_permutation` to look for `variances_of`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Use `search_for_cycle_permutation` to look for `variances_of`
This uses `search_for_cycle_permutation` to look for `variances_of` in case `variances_of` is not the first query in the cycle.
This may fix https://github.com/rust-lang/rust/issues/124423 and https://github.com/rust-lang/rust/issues/127971.
r? `@oli-obk`
|
|
Update lint-docs to default to Rust 2024
This updates the lint-docs tool to default to the 2024 edition. The lint docs are supposed to illustrate the code with the latest edition, and I just forgot to update this in https://github.com/rust-lang/rust/pull/133349.
Some docs needed to add the `edition` attribute since they were assuming a particular edition, but were missing the explicit annotation.
This also includes a commit to simplify the edition handling in lint-docs.
|
|
Improve if/else pretty printing
AST/HIR pretty printing of if/else is currently pretty bad. This PR improves it a lot.
r? `@Nadrieril`
|
|
Fix never pattern printing
It's currently broken, but there's an easy fix.
r? `@Nadrieril`
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #137439 (Stabilise `std::ffi::c_str`)
- #137714 (Update safety documentation for `CString::from_ptr` and `str::from_boxed_utf8_unchecked`)
- #139031 (Use char::is_whitespace directly in str::trim*)
- #139090 (fix docs for `Peekable::next_if{_eq}`)
- #140297 (Update example to use CStr::to_string_lossy)
- #140330 (Clarified bootstrap optimization "true" argument)
- #140339 (session: Cleanup `CanonicalizedPath::new`)
- #140346 (rustc_span: Some hygiene cleanups)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
rustc_span: Some hygiene cleanups
Mostly enabled by #139241 and #139281.
|
|
session: Cleanup `CanonicalizedPath::new`
It wants an owned path, so pass an owned path.
|
|
Clarified bootstrap optimization "true" argument
fixes #140328
|
|
Update example to use CStr::to_string_lossy
|
|
fix docs for `Peekable::next_if{_eq}`
These seem like copy-paste errors
(except `saves the value of` 👉 `retains` which just sounds better to me)
|
|
Use char::is_whitespace directly in str::trim*
Use the method directly instead of wrapping it in a closure.
|
|
Update safety documentation for `CString::from_ptr` and `str::from_boxed_utf8_unchecked`
## PR Description
This PR addresses missing safety documentation for two APIs:
**1. alloc::ffi::CStr::from_raw**
- `Alias`: The pointer must not be aliased (accessed via other pointers) during the reconstructed CString's lifetime.
- `Owning`: Calling this function twice on the same pointer and creating two objects with overlapping lifetimes, introduces two alive owners of the same memory. This may result in a double-free.
- `Dangling`: The prior documentation required the pointer to originate from CString::into_raw, but this constraint is incomplete. A validly sourced pointer can also cause undefined behavior (UB) if it becomes dangling. A simple Poc for this situation:
```
use std::ffi::CString;
use std::os::raw::c_char;
fn create_dangling() -> *mut c_char {
let local_ptr: *mut c_char = {
let valid_data = CString::new("valid").unwrap();
valid_data.into_raw()
};
unsafe {
let _x = CString::from_raw(local_ptr);
}
local_ptr
}
fn main() {
let dangling = create_dangling();
unsafe {let _y = CString::from_raw(dangling);} // Cause UB!
}
```
**2. alloc::str::from_boxed_utf8_unchecked**
- `ValidStr`: Bytes must contain a valid UTF-8 sequence.
|
|
Stabilise `std::ffi::c_str`
This finished FCP in #112134 but never actually got a stabilisation PR. Since the FCP in #120048 recently passed to add the `os_str` module, it would be nice to also merge this too, to ensure that both get added in the next version.
Note: The added stability attributes which *somehow* were able to be omitted before (rustc bug?) were added based on the fact that they were added in 302551388b1942bb4216bb5a15d9d55cee3643a8, which ended up in 1.85.0.
Closes: https://github.com/rust-lang/rust/issues/112134
r? libs-api
|
|
|
|
- Update r-efi to 5.2.0
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
|
|
Correctly display stdout and stderr in case a doctest is failing
Fixes https://github.com/rust-lang/rust/issues/140289.
Since the doctest is actually running itself, we need to handle the output directly inside it.
cc `@fmease`
r? `@notriddle`
|
|
|
|
|
|
check types of const param defaults
fixes #139643 by checking that the type of a const parameter default matches the type of the parameter as long as both types are fully concrete
r? `@BoxyUwU`
|
|
compiletest: Re-land using the new non-libtest executor by default
This PR re-lands #139998, which had the misfortune of triggering download-rustc in its CI jobs, so we didn't get proper test metrics for comparison with the old implementation. So that was PR was reverted in #140233, with the intention of re-landing it alongside a dummy compiler change to inhibit download-rustc.
---
Original PR description for #139998:
>The new executor was implemented in #139660, but required a manual opt-in. This PR activates the new executor by default, but leaves the old libtest-based executor in place (temporarily) to make reverting easier if something unexpectedly goes horribly wrong.
>
>Currently the new executor can be explicitly disabled by passing the `-N` flag to compiletest (e.g. `./x test ui -- -N`), but eventually that flag will be removed, alongside the removal of the libtest dependency. The flag is mostly there to make manual comparative testing easier if something does go wrong.
>
>As before, there *should* be no user-visible difference between the old executor and the new executor.
---
r? jieyouxu
|
|
This regression appeared in 916cfbcd3ed95a737b5a62103bbc4118ffe1eb2b.
The change is behaving as expected (a non-glob re-export uses the
stability marker on the `use` item, not the original one), but
this part of the standard library didn't follow it.
|
|
This updates the lint-docs tool to default to the 2024 edition. The lint
docs are supposed to illustrate the code with the latest edition, and I
just forgot to update this in
https://github.com/rust-lang/rust/pull/133349.
Some docs needed to add the `edition` attribute since they were assuming
a particular edition, but were missing the explicit annotation.
|
|
This removes the hard-coded list of edition support in the lint-docs
tool, and instead just assumes the edition attribute is something valid.
There isn't a real reason to have this, as rustc will error if given a
wrong number. This should be easier to maintain going forward.
|
|
|
|
The def path printer in `get_def_path` essentially calls
`Symbol::intern(&symbol.to_string())` for simple symbols in a path.
This accounts for ~30% of the runtime of get_def_path.
We can avoid this by simply appending the symbol directly when available.
|
|
Inline some functions used once.
Use `impl Trait` more.
Tweak some comments.
|