-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Rollup of 5 pull requests #125313
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Rollup of 5 pull requests #125313
Conversation
... since fn allocator doesn't exist yet.
(libs team decided not to add `absurd` to std)
Locking 24 packages to latest compatible versions Updating ammonia v3.3.0 -> v4.0.0 Updating anyhow v1.0.83 -> v1.0.86 Updating camino v1.1.6 -> v1.1.7 Updating darling v0.20.8 -> v0.20.9 Updating darling_core v0.20.8 -> v0.20.9 Updating darling_macro v0.20.8 -> v0.20.9 Adding dbus v0.9.7 Updating either v1.11.0 -> v1.12.0 Adding html5ever v0.27.0 Updating instant v0.1.12 -> v0.1.13 Adding libdbus-sys v0.2.5 Updating linux-raw-sys v0.4.13 -> v0.4.14 (latest: v0.6.4) Adding markup5ever v0.12.1 Updating mdbook v0.4.37 -> v0.4.40 Updating miniz_oxide v0.7.2 -> v0.7.3 Adding opener v0.7.1 Updating rustversion v1.0.16 -> v1.0.17 Updating serde v1.0.201 -> v1.0.202 Updating serde_derive v1.0.201 -> v1.0.202 Updating serde_spanned v0.6.5 -> v0.6.6 Removing strsim v0.10.0 Updating syn v2.0.62 -> v2.0.64 Updating thiserror v1.0.60 -> v1.0.61 Updating thiserror-impl v1.0.60 -> v1.0.61 Updating toml_datetime v0.6.5 -> v0.6.6 note: pass `--verbose` to see 96 unchanged dependencies behind latest
Coroutines can be prefixed with the `static` keyword to make them `!Unpin`. However, given the following function: ```rust fn check() -> impl Sized { let x = 0; #[coroutine] static || { yield; x } } ``` We currently suggest prefixing `move` before `static`, which is syntactically incorrect: ``` error[E0373]: coroutine may outlive the current function, but it borrows ... --> src/main.rs:6:5 | 6 | static || { | ^^^^^^^^^ may outlive borrowed value `x` 7 | yield; 8 | x | - `x` is borrowed here | note: coroutine is returned here --> src/main.rs:6:5 | 6 | / static || { 7 | | yield; 8 | | x 9 | | } | |_____^ help: to force the coroutine to take ownership of `x` (and any other referenced variables), use the `move` keyword | // this is syntactically incorrect, it should be `static move ||` 6 | move static || { | ++++ ``` This PR suggests adding `move` after `static` for these coroutines.
An earlier commit included the change for a suggestion here. Unfortunately, it also used unwrap instead of dying properly. Roll out the ~~rice paper~~ EarlyDiagCtxt before we do anything that might leave a mess.
…ulacrum Weekly `cargo update` Automation to keep dependencies in `Cargo.lock` current. The following is the output from `cargo update`: ```txt Locking 24 packages to latest compatible versions Updating ammonia v3.3.0 -> v4.0.0 Updating anyhow v1.0.83 -> v1.0.86 Updating camino v1.1.6 -> v1.1.7 Updating darling v0.20.8 -> v0.20.9 Updating darling_core v0.20.8 -> v0.20.9 Updating darling_macro v0.20.8 -> v0.20.9 Adding dbus v0.9.7 Updating either v1.11.0 -> v1.12.0 Adding html5ever v0.27.0 Updating instant v0.1.12 -> v0.1.13 Adding libdbus-sys v0.2.5 Updating linux-raw-sys v0.4.13 -> v0.4.14 (latest: v0.6.4) Adding markup5ever v0.12.1 Updating mdbook v0.4.37 -> v0.4.40 Updating miniz_oxide v0.7.2 -> v0.7.3 Adding opener v0.7.1 Updating rustversion v1.0.16 -> v1.0.17 Updating serde v1.0.201 -> v1.0.202 Updating serde_derive v1.0.201 -> v1.0.202 Updating serde_spanned v0.6.5 -> v0.6.6 Removing strsim v0.10.0 Updating syn v2.0.62 -> v2.0.64 Updating thiserror v1.0.60 -> v1.0.61 Updating thiserror-impl v1.0.60 -> v1.0.61 Updating toml_datetime v0.6.5 -> v0.6.6 note: pass `--verbose` to see 96 unchanged dependencies behind latest ```
…-only, r=Mark-Simulacrum Add `fn into_raw_with_allocator` to Rc/Arc/Weak. Split out from rust-lang#119761 Add `fn into_raw_with_allocator` for `Rc`/`rc::Weak`[^1]/`Arc`/`sync::Weak`. * Pairs with `from_raw_in` (which already exists on all 4 types). * Name matches `Box::into_raw_with_allocator`. * Associated fns on `Rc`/`Arc`, methods on `Weak`s. <details> <summary>Future PR/ACP</summary> As a follow-on to this PR, I plan to make a PR/ACP later to move `into_raw(_parts)` from `Container<_, A: Allocator>` to only `Container<_, Global>` (where `Container` = `Vec`/`Box`/`Rc`/`rc::Weak`/`Arc`/`sync::Weak`) so that users of non-`Global` allocators have to explicitly handle the allocator when using `into_raw`-like APIs. The current behaviors of stdlib containers are inconsistent with respect to what happens to the allocator when `into_raw` is called (which does not return the allocator) | Type | `into_raw` currently callable with | behavior of `into_raw`| | --- | --- | --- | | `Box` | any allocator | allocator is [dropped](https://doc.rust-lang.org/nightly/src/alloc/boxed.rs.html#1060) | | `Vec` | any allocator | allocator is [forgotten](https://doc.rust-lang.org/nightly/src/alloc/vec/mod.rs.html#884) | | `Arc`/`Rc`/`Weak` | any allocator | allocator is [forgotten](https://doc.rust-lang.org/src/alloc/sync.rs.html#1487)(Arc) [(sync::Weak)](https://doc.rust-lang.org/src/alloc/sync.rs.html#2726) [(Rc)](https://doc.rust-lang.org/src/alloc/rc.rs.html#1352) [(rc::Weak)](https://doc.rust-lang.org/src/alloc/rc.rs.html#2993) | In my opinion, neither implicitly dropping nor implicitly forgetting the allocator is ideal; dropping it could immediately invalidate the returned pointer, and forgetting it could unintentionally leak memory. My (to-be) proposed solution is to just forbid calling `into_raw(_parts)` on containers with non-`Global` allocators, and require calling `into_raw_with_allocator`(/`Vec::into_raw_parts_with_alloc`) </details> [^1]: Technically, `rc::Weak::into_raw_with_allocator` is not newly added, as it was modified and renamed from `rc::Weak::into_raw_and_alloc`.
…rovements, r=compiler-errors Never type unsafe lint improvements - Move linting code to a separate method - Remove mentions of `core::convert::absurd` (rust-lang#124311 was rejected) - Make the lint into FCW The last thing is a bit weird though. On one hand it should be `EditionSemanticsChange(2024)`, but on the other hand it shouldn't, because we also plan to break it on all editions some time later. _Also_, it's weird that we don't have `FutureReleaseSemanticsChangeReportInDeps`, IMO "this might cause UB in a future release" is important enough to be reported in deps... IMO we ought to have three enums instead of [`FutureIncompatibilityReason`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/enum.FutureIncompatibilityReason.html#): ```rust enum IncompatibilityWhen { FutureRelease, Edition(Edition), } enum IncompatibilyWhat { Error, SemanticChange, } enum IncompatibilityReportInDeps { No, Yes, } ``` Tracking: - rust-lang#123748
…r=compiler-errors fix suggestion in E0373 for !Unpin coroutines Coroutines can be prefixed with the `static` keyword to make them `!Unpin`. However, given the following function: ```rust fn check() -> impl Sized { let x = 0; #[coroutine] static || { yield; x } } ``` We currently suggest prefixing `move` before `static`, which is syntactically incorrect: ``` error[E0373]: coroutine may outlive the current function, but it borrows ... --> src/main.rs:6:5 | 6 | static || { | ^^^^^^^^^ may outlive borrowed value `x` 7 | yield; 8 | x | - `x` is borrowed here | note: coroutine is returned here --> src/main.rs:6:5 | 6 | / static || { 7 | | yield; 8 | | x 9 | | } | |_____^ help: to force the coroutine to take ownership of `x` (and any other referenced variables), use the `move` keyword | // this is syntactically incorrect, it should be `static move ||` 6 | move static || { | ++++ ``` This PR suggests adding `move` after `static` for these coroutines. I also added a UI test for this case.
…t, r=compiler-errors defrost `RUST_MIN_STACK=ice rustc hello.rs` I didn't think too hard about testing my previous PR rust-lang#122847 which makes our stack overflow handler assist people in discovering the `RUST_MIN_STACK` variable (which apparently is surprisingly useful for Really Big codebases). After it was merged, some useful comments left in a drive-by review led me to discover I had added an ICE. This reworks the code a bit to explain the rationale, remove the ICE that I introduced, and properly test one of the diagnostics.
@bors r+ rollup=never p=5 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: f092f73c11 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (e8ada6a): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 2.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary -0.6%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.4%, secondary -1.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 671.026s -> 670.321s (-0.11%) |
Successful merges:
cargo update
#125034 (Weeklycargo update
)fn into_raw_with_allocator
to Rc/Arc/Weak. #125093 (Addfn into_raw_with_allocator
to Rc/Arc/Weak.)RUST_MIN_STACK=ice rustc hello.rs
#125302 (defrostRUST_MIN_STACK=ice rustc hello.rs
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup