about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-04-28refactor: De-arc lang item queriesLukas Wirth-255/+188
2025-04-28Merge pull request #19706 from Veykril/push-nkpmknlvzyomLukas Wirth-24/+19
fix: Address minor FIXME
2025-04-28fix: Address minor FIXMELukas Wirth-24/+19
2025-04-28Merge pull request #19704 from Veykril/push-wrvznvvpvtvpLukas Wirth-125/+172
Add expression fill mode variant for filling with underscore expressions
2025-04-28Add foldhash license exceptionLaurențiu Nicola-0/+1
2025-04-28Add expression fill mode variant for filling with underscore expressionsLukas Wirth-125/+172
2025-04-28Merge pull request #19702 from lnicola/sync-from-rustLaurențiu Nicola-70585/+114287
internal: Sync from downstream
2025-04-28Add bootstrap cfgLaurențiu Nicola-0/+1
2025-04-28Format codeLaurențiu Nicola-1/+3
2025-04-28Merge from rust-lang/rustLaurențiu Nicola-70584/+114283
2025-04-28Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-04-28Auto merge of #140378 - ChrisDenton:rollup-3mj0wp9, r=ChrisDentonbors-33/+118
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
2025-04-28Rollup merge of #140359 - DiuDiu777:str-fix, r=NoratriebChris Denton-2/+2
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.
2025-04-28Rollup merge of #140351 - rust-lang:notriddle/stability-use, r=thomccChris Denton-2/+8
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
2025-04-28Rollup merge of #140345 - DaniPopes:get-def-path, r=UrgauChris Denton-1/+4
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.
2025-04-28Rollup merge of #139546 - lolbinarycat:std-set_permissions-75942, r=thomccChris Denton-0/+15
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
2025-04-28Rollup merge of #139224 - epage:nocapture, r=thomccChris Denton-9/+14
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
2025-04-28Rollup merge of #138939 - SabrinaJewson:arc-is-unique, r=tgross35Chris Denton-8/+61
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
2025-04-28Rollup merge of #138737 - Ayush1325:r-efi-update, r=tgross35Chris Denton-10/+10
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
2025-04-28Rollup merge of #138395 - Kobzol:ci-download-gcc, r=Mark-SimulacrumChris Denton-1/+4
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```
2025-04-27Auto merge of #140362 - weihanglo:update-cargo, r=weihanglobors-0/+0
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
2025-04-27Auto merge of #140366 - matthiaskrgr:rollup-zd3q1oy, r=matthiaskrgrbors-108/+368
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
2025-04-27Rollup merge of #140358 - Zoxc:variance-cycle, r=oli-obkMatthias Krüger-12/+20
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`
2025-04-27Rollup merge of #140348 - ehuss:lint-docs-edition, r=compiler-errorsMatthias Krüger-18/+12
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.
2025-04-27Rollup merge of #140280 - nnethercote:improve-if-else-printing, r=UrgauMatthias Krüger-78/+302
Improve if/else pretty printing AST/HIR pretty printing of if/else is currently pretty bad. This PR improves it a lot. r? `@Nadrieril`
2025-04-27Rollup merge of #140246 - nnethercote:fix-never-pattern-printing, r=NadrierilMatthias Krüger-0/+34
Fix never pattern printing It's currently broken, but there's an easy fix. r? `@Nadrieril`
2025-04-27Add `Arc::is_unique`SabrinaJewson-8/+61
2025-04-27Update cargoWeihang Lo-0/+0
2025-04-27Auto merge of #140360 - matthiaskrgr:rollup-savbr84, r=matthiaskrgrbors-143/+89
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
2025-04-27Rollup merge of #140346 - petrochenkov:cleanhyg, r=compiler-errorsMatthias Krüger-118/+54
rustc_span: Some hygiene cleanups Mostly enabled by #139241 and #139281.
2025-04-27Rollup merge of #140339 - petrochenkov:capanew, r=lqdMatthias Krüger-9/+8
session: Cleanup `CanonicalizedPath::new` It wants an owned path, so pass an owned path.
2025-04-27Rollup merge of #140330 - Kivooeo:new-fix-five, r=clubby789Matthias Krüger-1/+1
Clarified bootstrap optimization "true" argument fixes #140328
2025-04-27Rollup merge of #140297 - shepmaster:cstr-lossy, r=joboetMatthias Krüger-2/+3
Update example to use CStr::to_string_lossy
2025-04-27Rollup merge of #139090 - yotamofek:pr/peekable-next-if-docs, r=tgross35Matthias Krüger-3/+3
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)
2025-04-27Rollup merge of #139031 - DaniPopes:str-trim-closure, r=tgross35Matthias Krüger-3/+3
Use char::is_whitespace directly in str::trim* Use the method directly instead of wrapping it in a closure.
2025-04-27Rollup merge of #137714 - DiuDiu777:doc-fix, r=tgross35Matthias Krüger-3/+12
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.
2025-04-27Rollup merge of #137439 - clarfonthey:c-str-module, r=tgross35Matthias Krüger-4/+5
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
2025-04-27specify explicit safety guidance for from_utf8_uncheckedLemonJ-2/+2
2025-04-27CI: docker: host-x86_64: test-various: uefi_qemu_test: Update r-efiAyush Singh-4/+4
- Update r-efi to 5.2.0 Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-04-27Auto merge of #140291 - GuillaumeGomez:doctest-2024-stdout, r=notriddlebors-1/+92
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`
2025-04-27Use `search_for_cycle_permutation` to look for `variances_of`John Kåre Alsaker-12/+20
2025-04-27fix missing doc in CString::from_raw and str::from_boxed_utf8_uncheckedLemonJ-3/+12
2025-04-27Auto merge of #139646 - lcnr:default-is-fully-concrete, r=BoxyUwUbors-0/+71
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`
2025-04-26Auto merge of #140288 - Zalathar:new-executor, r=jieyouxubors-8/+12
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
2025-04-26docs: fix incorrect stability markers on `std::{todo, matches}`Michael Howell-2/+8
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.
2025-04-26Update lint-docs to default to Rust 2024Eric Huss-5/+5
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.
2025-04-26lint-docs: Don't hard-code the valid editionsEric Huss-14/+8
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.
2025-04-26hygiene: Use `IndexVec` for syntax context decode cacheVadim Petrochenkov-9/+4
2025-04-26Avoid re-interning in `LateContext::get_def_path`DaniPopes-1/+4
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.
2025-04-26hygiene: Misc cleanupsVadim Petrochenkov-82/+46
Inline some functions used once. Use `impl Trait` more. Tweak some comments.