diff options
| author | bors <bors@rust-lang.org> | 2023-04-15 10:21:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-15 10:21:55 +0000 |
| commit | ce1073ba9d894b2e351b2a85fcd39f2c99b78974 (patch) | |
| tree | eb75ff43a628a57b987fba4b349059a441655043 | |
| parent | 67e273ba0e8d0bacc98905c0e536b249f53fc011 (diff) | |
| parent | 64fbdc37799b44a85a2dd6cb491ee96e6931cb5d (diff) | |
| download | rust-ce1073ba9d894b2e351b2a85fcd39f2c99b78974.tar.gz rust-ce1073ba9d894b2e351b2a85fcd39f2c99b78974.zip | |
Auto merge of #110323 - lcnr:dropck-uwu, r=compiler-errors
explicit `adt_dtorck_constraint` for `ManuallyDrop` the only reason we didn't add outlives requirements when dropping `ManuallyDrop` was a fast-path in `trivial_dropck_outlives`. Explicitly acknowledge that fast-path in `adt_dtorck_constraint`
| -rw-r--r-- | compiler/rustc_traits/src/dropck_outlives.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_traits/src/dropck_outlives.rs b/compiler/rustc_traits/src/dropck_outlives.rs index b5924e94914..58117c46f04 100644 --- a/compiler/rustc_traits/src/dropck_outlives.rs +++ b/compiler/rustc_traits/src/dropck_outlives.rs @@ -292,7 +292,9 @@ pub(crate) fn adt_dtorck_constraint( let span = tcx.def_span(def_id); debug!("dtorck_constraint: {:?}", def); - if def.is_phantom_data() { + if def.is_manually_drop() { + bug!("`ManuallyDrop` should have been handled by `trivial_dropck_outlives`"); + } else if def.is_phantom_data() { // The first generic parameter here is guaranteed to be a type because it's // `PhantomData`. let substs = InternalSubsts::identity_for_item(tcx, def_id); |
