-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 9 pull requests #70174
Rollup of 9 pull requests #70174
Conversation
…d a long lost assertion This reverts part of commit 9712fa4.
Co-Authored-By: Ralf Jung <[email protected]>
This commit modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. Signed-off-by: David Wood <[email protected]>
Fixes rust-lang#55099 The minimized reproducer in issue rust-lang#55099 now compiles successfully. This commit adds a regression test for it.
patch is required to avoid compiler errors by building src/libpanic_unwind/hermit.rs
As discussed on reddit, this commit addresses two issues with the documentation of `mem::forget()`: * The documentation of `mem::forget()` can confuse the reader because of the discrepancy between usage examples that show correct usage and the accompanying text which speaks of the possibility of double-free. The text that says "if the panic occurs before `mem::forget` was called" refers to a variant of the second example that was never shown, modified to use `mem::forget` instead of `ManuallyDrop`. Ideally the documentation should show both variants, so it's clear what it's talking about. Also, the double free could be fixed just by placing `mem::forget(v)` before the construction of `s`. Since the lifetimes of `s` and `v` wouldn't overlap, there would be no point where panic could cause a double free. This could be mentioned, and contrasted against the more robust fix of using `ManuallyDrop`. * This sentence seems unjustified: "For some types, operations such as passing ownership (to a funcion like `mem::forget`) requires them to actually be fully owned right now [...]". Unlike C++, Rust has no move constructors, its moves are (possibly elided) bitwise copies. Even if you pass an invalid object to `mem::forget`, no harm should come to pass because `mem::forget` consumes the object and exists solely to prevent drop, so there no one left to observe the invalid state state.
…m::forget. As pointed out by Ralf Jung, dangling references and boxes are undefined behavior as per https://doc.rust-lang.org/reference/behavior-considered-undefined.html and the Miri checker.
Co-Authored-By: Ralf Jung <[email protected]>
Co-Authored-By: lzutao <[email protected]>
Clarify the relationship between `forget()` and `ManuallyDrop`. As discussed on reddit, this commit addresses two issues with the documentation of `mem::forget()`: * The documentation of `mem::forget()` can confuse the reader because of the discrepancy between usage examples that show correct usage and the accompanying text which speaks of the possibility of double-free. The text that says "if the panic occurs before `mem::forget` was called" refers to a variant of the second example that was never shown, modified to use `mem::forget` instead of `ManuallyDrop`. Ideally the documentation should show both variants, so it's clear what it's talking about. Also, the double free could be fixed just by placing `mem::forget(v)` before the construction of `s`. Since the lifetimes of `s` and `v` wouldn't overlap, there would be no point where panic could cause a double free. This could be mentioned, and contrasted against the more robust fix of using `ManuallyDrop`. * This sentence seems unjustified: "For some types, operations such as passing ownership (to a funcion like `mem::forget`) requires them to actually be fully owned right now [...]". Unlike C++, Rust has no move constructors, its moves are (possibly elided) bitwise copies. Even if you pass an invalid object to `mem::forget`, no harm should come to pass because `mem::forget` consumes the object and exists solely to prevent drop, so there no one left to observe the invalid state state.
…lfJung Compute the correct layout for variants of uninhabited enums r? @eddyb cc @RalfJung fixes rust-lang#69191 cc rust-lang#69763
codegen/mir: support polymorphic `InstanceDef`s cc rust-lang#69925 This PR modifies the use of `subst_and_normalize_erasing_regions` on parts of the MIR bodies returned from `instance_mir`, so that `InstanceDef::CloneShim` and `InstanceDef::DropGlue` (where there is a type) do not perform substitutions. This avoids double substitutions and enables polymorphic `InstanceDef`s. r? @eddyb cc @nikomatsakis
…an-DPC Clean up E0437 explanation r? @Dylan-DPC
…ikomatsakis Add regression test for TAIT lifetime inference (issue rust-lang#55099) Fixes rust-lang#55099 The minimized reproducer in issue rust-lang#55099 now compiles successfully. This commit adds a regression test for it.
…atsakis remove unused imports patch is required to avoid compiler errors by building src/libpanic_unwind/hermit.rs
doc: Add quote to .init_array The current formatting is not good without quotes: ![without-quote](https://i.imgur.com/RkIm4cr.png)
…an-DPC Clean up e0438 explanation r? @Dylan-DPC
…rk-Simulacrum triagebot.toml: accept cleanup-crew r? @Mark-Simulacrum
@bors r+ p=9 rollup=never |
📌 Commit 43c7a50 has been approved by |
⌛ Testing commit 43c7a50 with merge 547a95a3cd8d194643781a20ea37b96a36819445... |
Hm, failed in @bors retry
|
⌛ Testing commit 43c7a50 with merge fa81648701f90b92034bf9e5ecbcf48aaf5c2e5c... |
💥 Test timed out |
@bors retry |
⌛ Testing commit 43c7a50 with merge fbafce24329e954b672e5c8a5ffb5dbd39e007c9... |
Well, the above failure occurs again. |
💔 Test failed - checks-azure |
@bors retry |
☀️ Test successful - checks-azure |
Successful merges:
forget()
andManuallyDrop
. #69618 (Clarify the relationship betweenforget()
andManuallyDrop
.)InstanceDef
s #69935 (codegen/mir: support polymorphicInstanceDef
s)Failed merges:
r? @ghost