Fetch the destructor constness lazily
This commit is contained in:
parent
ca32447c0c
commit
6697f02761
4 changed files with 6 additions and 8 deletions
|
@ -263,7 +263,7 @@ fn evaluate_host_effect_for_destruct_goal<'tcx>(
|
|||
.all_fields()
|
||||
.map(|field| ty::TraitRef::new(tcx, destruct_def_id, [field.ty(tcx, args)]))
|
||||
.collect();
|
||||
match adt_def.destructor(tcx).map(|dtor| dtor.constness) {
|
||||
match adt_def.destructor(tcx).map(|dtor| tcx.constness(dtor.did)) {
|
||||
// `Drop` impl exists, but it's not const. Type cannot be `~const Destruct`.
|
||||
Some(hir::Constness::NotConst) => return Err(EvaluationFailure::NoSolution),
|
||||
// `Drop` impl exists, and it's const. Require `Ty: ~const Drop` to hold.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue