dropck_outlives check generator witness needs_drop
This commit is contained in:
parent
f0df3d2dfb
commit
57253552de
8 changed files with 69 additions and 58 deletions
|
@ -34,6 +34,7 @@ pub(crate) fn adt_dtorck_constraint(
|
|||
) -> Result<&DropckConstraint<'_>, NoSolution> {
|
||||
let def = tcx.adt_def(def_id);
|
||||
let span = tcx.def_span(def_id);
|
||||
let param_env = tcx.param_env(def_id);
|
||||
debug!("dtorck_constraint: {:?}", def);
|
||||
|
||||
if def.is_manually_drop() {
|
||||
|
@ -55,7 +56,7 @@ pub(crate) fn adt_dtorck_constraint(
|
|||
let mut result = DropckConstraint::empty();
|
||||
for field in def.all_fields() {
|
||||
let fty = tcx.type_of(field.did).instantiate_identity();
|
||||
dtorck_constraint_for_ty_inner(tcx, span, fty, 0, fty, &mut result)?;
|
||||
dtorck_constraint_for_ty_inner(tcx, param_env, span, 0, fty, &mut result)?;
|
||||
}
|
||||
result.outlives.extend(tcx.destructor_constraints(def));
|
||||
dedup_dtorck_constraint(&mut result);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue