about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-06-02Add title and toc to Async chapterStan Manilov-9/+13
This is standard for other chapters.
2025-06-02Merge pull request #2440 from rust-lang/tshepang-patch-1nora-2/+2
distracting indirection
2025-06-02distracting indirectionTshepang Mbambo-2/+2
2025-06-02Merge pull request #2439 from rust-lang/tshepang-offline-loveTshepang Mbambo-1/+1
use a relative path, so that this also works offline
2025-06-02use a relative path, so that this also works offlineTshepang Mbambo-1/+1
2025-06-02Merge pull request #2386 from Lysxia/fix-linkTshepang Mbambo-1/+1
Fix link to GatherBorrows
2025-06-02Merge pull request #2435 from smanilov/patch-19Tshepang Mbambo-0/+3
Add opaque type attributes
2025-06-02Merge pull request #2437 from rust-lang/rustc-pullTshepang Mbambo-22230/+36636
Rustc pull update
2025-06-02Merge pull request #2438 from smanilov/patch-20Tshepang Mbambo-1/+1
Trivial: fix typo (change `foo` to `bar`)
2025-06-02Trivial: fix typo (change `foo` to `bar`)Stan Manilov-1/+1
There is no `foo` symbol in the preceding example. I assume the method `bar` is meant.
2025-06-02Merge from rustcThe rustc-dev-guide Cronjob Bot-22229/+36635
2025-06-02Preparing for merge from rustcThe rustc-dev-guide Cronjob Bot-1/+1
2025-06-01Auto merge of #141869 - GuillaumeGomez:rollup-vicg807, r=GuillaumeGomezbors-273/+771
Rollup of 9 pull requests Successful merges: - rust-lang/rust#140370 (Improve diagnostics for usage of qualified paths within tuple struct exprs/pats) - rust-lang/rust#141224 (terminology: allocated object → allocation) - rust-lang/rust#141622 (implement `va_arg` for `powerpc`) - rust-lang/rust#141666 (source_span_for_markdown_range: fix utf8 violation) - rust-lang/rust#141789 (Exclude `CARGO_HOME` from `generate-copyright` in-tree determination) - rust-lang/rust#141823 (Drive-by refactor: use `OnceCell` for the reverse region SCC graph) - rust-lang/rust#141834 (Add unimplemented `current_dll_path()` for WASI) - rust-lang/rust#141846 (Fix TLS model on bootstrap for cygwin) - rust-lang/rust#141852 (resolve if-let-chain FIXME on bootstrap) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-01Rollup merge of #141852 - onur-ozkan:resolve-if-let-fixme, r=jieyouxuGuillaume Gomez-3/+3
resolve if-let-chain FIXME on bootstrap self-explanatory
2025-06-01Rollup merge of #141846 - Berrysoft:cygwin-bootstrap-tls, r=mati865Guillaume Gomez-1/+6
Fix TLS model on bootstrap for cygwin There aren't other targets that both use emutls and enable `has_thread_local`, so cygwin triggers this bug first. r? mati865 See: https://github.com/rust-lang/rust/pull/141719#issuecomment-2925445263 ``@jeremyd2019`` Could you check if this PR fixes the issue? I just found my pre-built stage-0 rustc was too old to build the current rustc :(
2025-06-01Rollup merge of #141834 - Timmmm:user/timh/wasi, r=NoratriebGuillaume Gomez-0/+5
Add unimplemented `current_dll_path()` for WASI This is the only change needed to Rust to allow compiling rustfmt for WASI (rustfmt uses some internal rustc crates).
2025-06-01Rollup merge of #141823 - amandasystems:reverse_scc_graph_once_cell, r=jieyouxuGuillaume Gomez-18/+11
Drive-by refactor: use `OnceCell` for the reverse region SCC graph During region inference, the reverse SCC region graph is sometimes computed lazily. This changes the implementation for that from using an `Option` to a `OnceCell` which clearly communicates the intention and simplifies the code somewhat. There shouldn't be any performance impact, except that this pulls the computation of the reverse SCC graph slightly later than before, and so may avoid computing it in some instances. Note that this changes a mutable reference into an immutable (interior mutable) one.
2025-06-01Rollup merge of #141789 - ↵Guillaume Gomez-6/+19
ferrocene:hoverbear/exclude-cargo-home-from-in-tree-consideration, r=clubby789 Exclude `CARGO_HOME` from `generate-copyright` in-tree determination On Ferrocene, we noticed that in our releases the out-of-tree notices were not being included. When `x.py run generate-copyright` was ran on local development machines, it worked fine. After some investigations ``@tshepang`` and I determined that the problem was that the cargo registry (located in `CARGO_HOME`) started with the source directory on CI jobs, and was being excluded by this line: https://github.com/rust-lang/rust/blob/15825b7161f8bd6a3482211fbf6727a52aa1166b/src/tools/generate-copyright/src/cargo_metadata.rs#L85-L88 In Ferrocene's `run.sh` we set `CARGO_HOME` to be `build/cargo-home`: https://github.com/ferrocene/ferrocene/blob/96a45dd9a18c6e54d3cd81750a78fe459fa48af0/ferrocene/ci/run.sh#L34-L46 which caused this issue. This PR passes the `CARGO_HOME` variable to the `generate-copyright` tool and expands the consideration of in-tree-ness to be aware of `CARGO_HOME`. It is an upstreaming of https://github.com/ferrocene/ferrocene/pull/1491. ## Testing Run `CARGO_HOME=build/cargo-home ./x.py run generate-copyright` on `master`, then check `build/host/doc/COPYRIGHT` and look for out of tree dependencies (at the bottom). Then, try running the same command in this branch.
2025-06-01Rollup merge of #141666 - ↵Guillaume Gomez-2/+72
lolbinarycat:rustdoc-source_span_for_markdown_range-bug-141665, r=GuillaumeGomez source_span_for_markdown_range: fix utf8 violation it is non-trivial to reproduce this bug through rustdoc, which uses this function less than clippy, so the regression test was added as a unit test instead of an integration test. fixes https://github.com/rust-lang/rust/issues/141665 r? ``@GuillaumeGomez``
2025-06-01Rollup merge of #141622 - folkertdev:powerpc-va_arg, r=workingjubileeGuillaume Gomez-3/+182
implement `va_arg` for `powerpc` tracking issue: https://github.com/rust-lang/rust/issues/44930 The llvm `va_arg` implementation is well-known to have serious limitations. Some planned changes to rust's `VaList` make it much more likely that LLVM miscompiles `va_arg`, so this PR adds support for the various powerpc targets. Now at least the targets that `core` has explicit support for will continue to work. For `powerpc` (the 32-bit variant) this implementation also fixes a bug where only up to 20 variadic arguments were supported. Locally (with qemu), these targets now pass the tests in https://github.com/rust-lang/rust/blob/master/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs. That test does not actually run for the powerpc targets in CI though. The implementation is based on clang: - handling of big endian architectures https://github.com/llvm/llvm-project/blob/3c8089d1ea53232d5a7cdc33f0cb43ef7d6f723b/clang/lib/CodeGen/ABIInfoImpl.cpp#L191-L193 - 64-bit https://github.com/llvm/llvm-project/blob/3c8089d1ea53232d5a7cdc33f0cb43ef7d6f723b/clang/lib/CodeGen/Targets/PPC.cpp#L969 - 32-bit https://github.com/llvm/llvm-project/blob/3c8089d1ea53232d5a7cdc33f0cb43ef7d6f723b/clang/lib/CodeGen/Targets/PPC.cpp#L430 cc `@daltenty` (target maintainer) r? `@workingjubilee` `@rustbot` label: +F-c_variadic
2025-06-01Rollup merge of #141224 - RalfJung:no-objects, r=traviscrossGuillaume Gomez-143/+146
terminology: allocated object → allocation Rust does not have "objects" in memory so "allocated object" is a somewhat odd name. I am not sure where the term comes from. "object" has been used to refer to allocations already [in 1.0 docs](https://doc.rust-lang.org/1.0.0/std/primitive.pointer.html#method.offset); this was apparently later changed to "allocated object". "Allocation" is already the terminology used in Miri and in the [UCG](https://rust-lang.github.io/unsafe-code-guidelines/glossary.html#allocation). We should properly move to that terminology, and avoid any confusion about whether Rust has an object memory model. (It does not. Memory contains untyped bytes.) Cc ``@rust-lang/opsem`` ``@rust-lang/lang``
2025-06-01Rollup merge of #140370 - WaffleLapkin:unqualified, r=jdonszelmannGuillaume Gomez-97/+327
Improve diagnostics for usage of qualified paths within tuple struct exprs/pats For patterns the old diagnostic was just incorrect, but I also added machine applicable suggestions. For context, this special cases errors for `<T as Trait>::Assoc(..)` patterns and expressions (latter is just a call). Tuple struct patterns and expressions both live in the value namespace, so they are not forwarded through associated *types*. r? ``@jdonszelmann`` cc ``@petrochenkov`` in https://github.com/rust-lang/rust/pull/80080#issuecomment-800630582 you were wondering why it doesn't work for types, that's why — tuple patterns are resolved in the value namespace.
2025-06-01Auto merge of #141860 - RalfJung:miri-sync, r=RalfJungbors-246/+1300
Miri subtree update r? `@ghost` Includes https://github.com/rust-lang/miri/pull/4370 to unbreak PR CI. (So we're committing to having bda28aa38 in the Miri history by landing this, whether or not that Miri PR lands.) Cc `@Noratrieb` `@tiif`
2025-06-01tweak comment and use a weaker fenceRalf Jung-1/+4
2025-06-01Make sure to sync on file-io.rs tokio testNoratrieb-0/+1
Tokio `AsyncWriteExt::write` doesn't actually ensure that the contents have written, it just *starts* the write operation. To ensure that the file has actually been written, we need to `sync_all` first.
2025-06-01resolve if-let-chain FIXME on bootstraponur-ozkan-3/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-06-01Auto merge of #141731 - compiler-errors:tweak-fast-path-trait, r=lcnrbors-34/+54
Tweak fast path trait handling (1.) Make it more sound by considering polarity (lol) (2.) Make it more general, by considering higher-ranked size/copy/clone (2.) Make it less observable, by only doing copy/clone fast path if there are no regions involved r? lcnr
2025-06-01Merge pull request #4368 from Noratrieb/write-not-little-but-a-lot-insteadRalf Jung-3/+3
Fix tokio/file-io.rs test relying on `read`/`write` not being short
2025-06-01Fix tokio/file-io.rs test relying on `read`/`write` not being shortNoratrieb-3/+3
The test did `write` and `read` and hoped that it would read/write everything, which doesn't always happen and caused CI failures. Switch to `write_all` and `read_to_end` to make it more reliable.
2025-06-01Add unimplemented `current_dll_path()` for WASITim Hutt-0/+5
This is the only change needed to Rust to allow compiling rustfmt for WASI (rustfmt uses some internal rustc crates).
2025-06-01Auto merge of #141730 - osiewicz:collect-crate-deps-postorder-use-indexset, ↵bors-10/+13
r=nnethercote cstore: Use IndexSet as backing store for postorder dependencies `<rustc_metadata::creader::CStore>::push_dependencies_in_postorder` showed up in new benchmarks from https://github.com/rust-lang/rustc-perf/pull/2143, hence I gave it a shot to remove an obvious O(n) there. r? nnethercote
2025-06-01Add opaque type attributesStan Manilov-0/+3
This allows for the code to compile on `nightly`.
2025-06-01Fix TLS model on bootstrap for cygwin王宇逸-1/+6
2025-06-01Merge pull request #4364 from rust-lang/rustup-2025-06-01Ben Kimock-513/+1339
Automatic Rustup
2025-06-01Merge from rustcThe Miri Cronjob Bot-512/+1338
2025-06-01Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-06-01Auto merge of #141725 - nnethercote:avoid-UsePath-overcounting, r=BoxyUwUbors-163/+173
Avoid over-counting of `UsePath` in the HIR stats. Currently we over-count. Details in the individual commits. r? `@BoxyUwU`
2025-06-01Auto merge of #141842 - jhpratt:rollup-r7ldrl2, r=jhprattbors-148/+551
Rollup of 6 pull requests Successful merges: - rust-lang/rust#141072 (Stabilize feature `result_flattening`) - rust-lang/rust#141215 (std: clarify Clone trait documentation about duplication semantics) - rust-lang/rust#141277 (Miri CI: test aarch64-apple-darwin in PRs instead of the x86_64 target) - rust-lang/rust#141521 (Add `const` support for float rounding methods) - rust-lang/rust#141812 (Fix "consider borrowing" for else-if) - rust-lang/rust#141832 (library: explain TOCTOU races in `fs::remove_dir_all`) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-01implement `va_arg` for `powerpc`Folkert de Vries-11/+145
This actually fixes a bug where before only 20 arguments could be passed. As far as I can tell, an arbitrary number of arguments is now supported
2025-06-01Rollup merge of #141832 - workingjubilee:explain-what-toctou-races-are, ↵Jacob Pratt-8/+19
r=thomcc,ChrisDenton library: explain TOCTOU races in `fs::remove_dir_all` In the previous description it said there was a TOCTOU race but did not explain exactly what the problem was. I sat down with the CVE, reviewed its text, and created this explanation. This context should hopefully help people understand the actual risk as-such. Incidentally, it also fixes the capitalization on the name of Redox OS. Original CVE and advisory: - CVE: https://www.cve.org/CVERecord?id=CVE-2022-21658 - security advisory: https://groups.google.com/g/rustlang-security-announcements/c/R1fZFDhnJVQ?pli=1 - github cross-post: https://github.com/rust-lang/rust/security/advisories/GHSA-r9cc-f5pr-p3j2
2025-06-01Rollup merge of #141812 - JonathanBrouwer:fix-else-if-help, r=jdonszelmannJacob Pratt-0/+143
Fix "consider borrowing" for else-if Fixes rust-lang/rust#141810 When trying to suggest a borrow on a `if` or `block` expression, instead we now recurse into the `if` or `block`. The comments in the code should explain the goal of the new code. r? ``@jdonszelmann``
2025-06-01Rollup merge of #141521 - ruancomelli:const-float-rounding, r=RalfJungJacob Pratt-117/+333
Add `const` support for float rounding methods # Add `const` support for float rounding methods This PR makes the following float rounding methods `const`: - `f64::{floor, ceil, trunc, round, round_ties_even}` - and the corresponding methods for `f16`, `f32` and `f128` Tracking issue: https://github.com/rust-lang/rust/issues/141555 ## Procedure I followed https://github.com/rust-lang/rust/commit/c09ed3e767a73d83673790f74c357432fa44d320 as closely as I could in making float methods `const`, and also received great guidance from https://internals.rust-lang.org/t/const-rounding-methods-in-float-types/22957/3?u=ruancomelli. ## Note This is my first code contribution to the Rust project, so please let me know if I missed anything - I'd be more than happy to revise and learn more. Thank you for taking the time to review it!
2025-06-01Rollup merge of #141277 - RalfJung:miri-ci, r=oli-obkJacob Pratt-4/+6
Miri CI: test aarch64-apple-darwin in PRs instead of the x86_64 target The aarch64 target is more important, and also this ensures we cover all main architectures (x86_64, i686, aarch64) in PR CI.
2025-06-01Rollup merge of #141215 - xizheyin:issue-141138, r=workingjubileeJacob Pratt-2/+37
std: clarify Clone trait documentation about duplication semantics Closes rust-lang/rust#141138 The change explicitly explains that cloning behavior varies by type and clarifies that smart pointers (`Arc`, `Rc`) share the same underlying data. I've also added an example of cloning to Arc.
2025-06-01Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=jhprattJacob Pratt-17/+13
Stabilize feature `result_flattening` Stabilizes the `Result::flatten` method ## Implementations - [x] Implementation `Result::flatten`: https://github.com/rust-lang/rust/pull/70140 - [x] Implementation `const` `Result::flatten`: https://github.com/rust-lang/rust/pull/130692 - [x] Update stabilization attribute macros (this PR) ## Stabilization process - [x] Created this PR [suggested](https://github.com/rust-lang/rust/issues/70142#issuecomment-2885044548) by ``@RalfJung`` - [x] FCP (haven't found any, is it applicable here?) - [ ] Close issue rust-lang/rust#70142
2025-05-31Auto merge of #139118 - scottmcm:slice-get-unchecked-intrinsic, r=workingjubileebors-86/+385
`slice.get(i)` should use a slice projection in MIR, like `slice[i]` does `slice[i]` is built-in magic, so ends up being quite different from `slice.get(i)` in MIR, even though they're both doing nearly identical operations -- checking the length of the slice then getting a ref/ptr to the element if it's in-bounds. This PR adds a `slice_get_unchecked` intrinsic for `impl SliceIndex for usize` to use to fix that, so it no longer needs to do a bunch of lines of pointer math and instead just gets the obvious single statement. (This is *not* used for the range versions, since `slice[i..]` and `slice[..k]` can't use the mir Slice projection as they're using fenceposts, not indices.) I originally tried to do this with some kind of GVN pattern, but realized that I'm pretty sure it's not legal to optimize `BinOp::Offset` to `PlaceElem::Index` without an extremely complicated condition. Basically, the problem is that the `Index` projection on a dereferenced slice pointer *cares about the metadata*, since it's UB to `PlaceElem::Index` outside the range described by the metadata. But then you cast the fat pointer to a thin pointer then offset it, that *ignores* the slice length metadata, so it's possible to write things that are legal with `Offset` but would be UB if translated in the obvious way to `Index`. Checking (or even determining) the necessary conditions for that would be complicated and error-prone, whereas this intrinsic-based approach is quite straight-forward. Zero backend changes, because it just lowers to MIR, so it's already supported naturally by CTFE/Miri/cg_llvm/cg_clif.
2025-05-31Merge pull request #2434 from rust-lang/tshepang-mailmapnora-0/+1
update surname (was lekhonkhobe previously) and email
2025-05-31update surname (was lekhonkhobe previously) and emailTshepang Mbambo-0/+1
2025-05-31library: explain TOCTOU races in `fs::remove_dir_all`Jubilee Young-8/+19
In the previous description it said there was a TOCTOU race but did not explain exactly what the problem was. I sat down with the CVE, reviewed its text, and created this explanation. This context should hopefully help people understand the actual risk as-such. Incidentally, it also fixes the capitalization on the name of Redox OS.
2025-05-31Merge pull request #2432 from rust-lang/tshepang-patch-1nora-5/+2
suggest build/rust-analyzer instead of build-rust-analyzer