Skip to content

Commit

Permalink
implement drop elaboration
Browse files Browse the repository at this point in the history
  • Loading branch information
arielb1 committed Jun 3, 2016
1 parent de7cb0f commit a091cfd
Show file tree
Hide file tree
Showing 10 changed files with 1,431 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/librustc/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,24 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
value.trans_normalize(&infcx)
})
}

pub fn normalize_associated_type_in_env<T>(
self, value: &T, env: &'a ty::ParameterEnvironment<'tcx>
) -> T
where T: TransNormalize<'tcx>
{
debug!("normalize_associated_type_in_env(t={:?})", value);

let value = self.erase_regions(value);

if !value.has_projection_types() {
return value;
}

self.infer_ctxt(None, Some(env.clone()), ProjectionMode::Any).enter(|infcx| {
value.trans_normalize(&infcx)
})
}
}

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
Expand Down
6 changes: 6 additions & 0 deletions src/librustc_borrowck/borrowck/mir/dataflow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ impl<'a, 'tcx: 'a, O> DataflowAnalysis<'a, 'tcx, O>

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

impl<O: BitDenotation> DataflowResults<O> {
pub fn sets(&self) -> &AllSets {
&self.0.sets
}
}

// FIXME: This type shouldn't be public, but the graphviz::MirWithFlowState trait
// references it in a method signature. Look into using `pub(crate)` to address this.
pub struct DataflowState<O: BitDenotation>
Expand Down
Loading

0 comments on commit a091cfd

Please sign in to comment.