Skip to content

Commit 1880bc7

Browse files
committed
implement drop elaboration
Fixes rust-lang#30380
1 parent 5a04226 commit 1880bc7

File tree

10 files changed

+1431
-2
lines changed

10 files changed

+1431
-2
lines changed

src/librustc/infer/mod.rs

+18
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,24 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
605605
value.trans_normalize(&infcx)
606606
})
607607
}
608+
609+
pub fn normalize_associated_type_in_env<T>(
610+
self, value: &T, env: &'a ty::ParameterEnvironment<'tcx>
611+
) -> T
612+
where T: TransNormalize<'tcx>
613+
{
614+
debug!("normalize_associated_type_in_env(t={:?})", value);
615+
616+
let value = self.erase_regions(value);
617+
618+
if !value.has_projection_types() {
619+
return value;
620+
}
621+
622+
self.infer_ctxt(None, Some(env.clone()), ProjectionMode::Any).enter(|infcx| {
623+
value.trans_normalize(&infcx)
624+
})
625+
}
608626
}
609627

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

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

+6
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)