Skip to content

Commit ce1073b

Browse files
committed
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`
2 parents 67e273b + 64fbdc3 commit ce1073b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_traits/src/dropck_outlives.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ pub(crate) fn adt_dtorck_constraint(
292292
let span = tcx.def_span(def_id);
293293
debug!("dtorck_constraint: {:?}", def);
294294

295-
if def.is_phantom_data() {
295+
if def.is_manually_drop() {
296+
bug!("`ManuallyDrop` should have been handled by `trivial_dropck_outlives`");
297+
} else if def.is_phantom_data() {
296298
// The first generic parameter here is guaranteed to be a type because it's
297299
// `PhantomData`.
298300
let substs = InternalSubsts::identity_for_item(tcx, def_id);

0 commit comments

Comments
 (0)