about summary refs log tree commit diff
path: root/tests/codegen/issues/issue-98678-struct-union.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-19 15:58:08 +0000
committerbors <bors@rust-lang.org>2024-12-19 15:58:08 +0000
commit11663cd3bfefef7d34e8f0892c250bf698049392 (patch)
tree3a438acdc61750d33e92eb7402e8f0dccd0f441b /tests/codegen/issues/issue-98678-struct-union.rs
parent3bf62ccc1055a94dfa6a72650b10a71dcf232429 (diff)
parent6564403641afde8bf445914ec2996fe7219289ab (diff)
downloadrust-11663cd3bfefef7d34e8f0892c250bf698049392.tar.gz
rust-11663cd3bfefef7d34e8f0892c250bf698049392.zip
Auto merge of #134486 - compiler-errors:drop-for-lint, r=nikomatsakis
Make sure we handle `backwards_incompatible_lint` drops appropriately in drop elaboration

In #131326, a new kind of scheduled drop (`drop_kind: DropKind::Value` + `backwards_incompatible_lint: true`) was added so that we could insert a new kind of no-op MIR statement (`backward incompatible drop`) for linting purposes.

These drops were intended to have *no side-effects*, but drop elaboration code forgot to handle these drops specially and they were handled otherwise as normal drops in most of the code. This ends up being **unsound** since we insert more than one drop call for some values, which means that `Drop::drop` could be called more than once.

This PR fixes this by splitting out the `DropKind::ForLint` and adjusting the code. I'm not totally certain if all of the places I've adjusted are either reachable or correct, but I'm pretty certain that it's *more* correct than it was previously.

cc `@dingxiangfei2009`
r? nikomatsakis

Fixes #134482
Diffstat (limited to 'tests/codegen/issues/issue-98678-struct-union.rs')
0 files changed, 0 insertions, 0 deletions