Skip to content

Commit a091cfd

Browse files
committed
implement drop elaboration
Fixes rust-lang#30380
1 parent de7cb0f commit a091cfd

File tree

10 files changed

+1431
-2
lines changed

10 files changed

+1431
-2
lines changed

src/librustc/infer/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,24 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
613613
value.trans_normalize(&infcx)
614614
})
615615
}
616+
617+
pub fn normalize_associated_type_in_env<T>(
618+
self, value: &T, env: &'a ty::ParameterEnvironment<'tcx>
619+
) -> T
620+
where T: TransNormalize<'tcx>
621+
{
622+
debug!("normalize_associated_type_in_env(t={:?})", value);
623+
624+
let value = self.erase_regions(value);
625+
626+
if !value.has_projection_types() {
627+
return value;
628+
}
629+
630+
self.infer_ctxt(None, Some(env.clone()), ProjectionMode::Any).enter(|infcx| {
631+
value.trans_normalize(&infcx)
632+
})
633+
}
616634
}
617635

618636
impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {

src/librustc_borrowck/borrowck/mir/dataflow/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ impl<'a, 'tcx: 'a, O> DataflowAnalysis<'a, 'tcx, O>
200200

201201
pub struct DataflowResults<O>(DataflowState<O>) where O: BitDenotation;
202202

203+
impl<O: BitDenotation> DataflowResults<O> {
204+
pub fn sets(&self) -> &AllSets {
205+
&self.0.sets
206+
}
207+
}
208+
203209
// FIXME: This type shouldn't be public, but the graphviz::MirWithFlowState trait
204210
// references it in a method signature. Look into using `pub(crate)` to address this.
205211
pub struct DataflowState<O: BitDenotation>

0 commit comments

Comments
 (0)