Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f97c411

Browse files
committedJun 5, 2016
Auto merge of #33622 - arielb1:elaborate-drops, r=nikomatsakis
[MIR] non-zeroing drop This enables non-zeroing drop through stack flags for MIR. Fixes #30380. Fixes #5016.
2 parents ccfaaa7 + 063f882 commit f97c411

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2101
-318
lines changed
 

‎src/librustc/infer/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,24 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
624624
value.trans_normalize(&infcx)
625625
})
626626
}
627+
628+
pub fn normalize_associated_type_in_env<T>(
629+
self, value: &T, env: &'a ty::ParameterEnvironment<'tcx>
630+
) -> T
631+
where T: TransNormalize<'tcx>
632+
{
633+
debug!("normalize_associated_type_in_env(t={:?})", value);
634+
635+
let value = self.erase_regions(value);
636+
637+
if !value.has_projection_types() {
638+
return value;
639+
}
640+
641+
self.infer_ctxt(None, Some(env.clone()), ProjectionMode::Any).enter(|infcx| {
642+
value.trans_normalize(&infcx)
643+
})
644+
}
627645
}
628646

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

‎src/librustc/middle/cstore.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ pub trait CrateStore<'tcx> {
163163
-> ty::TypeScheme<'tcx>;
164164
fn visible_parent_map<'a>(&'a self) -> ::std::cell::RefMut<'a, DefIdMap<DefId>>;
165165
fn item_name(&self, def: DefId) -> ast::Name;
166+
fn opt_item_name(&self, def: DefId) -> Option<ast::Name>;
166167
fn item_predicates<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId)
167168
-> ty::GenericPredicates<'tcx>;
168169
fn item_super_predicates<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId)
@@ -345,6 +346,7 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore {
345346
bug!("visible_parent_map")
346347
}
347348
fn item_name(&self, def: DefId) -> ast::Name { bug!("item_name") }
349+
fn opt_item_name(&self, def: DefId) -> Option<ast::Name> { bug!("opt_item_name") }
348350
fn item_predicates<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId)
349351
-> ty::GenericPredicates<'tcx> { bug!("item_predicates") }
350352
fn item_super_predicates<'a>(&self, tcx: TyCtxt<'a, 'tcx, 'tcx>, def: DefId)

0 commit comments

Comments
 (0)
Please sign in to comment.