Skip to content

Commit 69f5f0d

Browse files
committed
added trans_ prefix and pluralised types. Solved failing test on the incremental test-suite.
1 parent 96a006c commit 69f5f0d

File tree

9 files changed

+15
-14
lines changed

9 files changed

+15
-14
lines changed

src/librustc/infer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,16 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
480480
{
481481
assert!(!value.needs_subst());
482482
let value = self.erase_late_bound_regions(value);
483-
self.normalize_associated_type_in(&value)
483+
self.trans_normalize_associated_types_in(&value)
484484
}
485485

486486
/// Fully normalizes any associated types in `value`, using an
487487
/// empty environment and `Reveal::All` mode (therefore, suitable
488488
/// only for monomorphized code during trans, basically).
489-
pub fn normalize_associated_type_in<T>(self, value: &T) -> T
489+
pub fn trans_normalize_associated_types_in<T>(self, value: &T) -> T
490490
where T: TransNormalize<'tcx>
491491
{
492-
debug!("normalize_associated_type_in(t={:?})", value);
492+
debug!("trans_normalize_associated_types_in(t={:?})", value);
493493

494494
let param_env = ty::ParamEnv::empty(Reveal::All);
495495
let value = self.erase_regions(value);

src/librustc/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2323,6 +2323,6 @@ pub fn provide(providers: &mut ty::maps::Providers) {
23232323
tcx.sess.features.borrow().clone_closures
23242324
};
23252325
providers.normalize_ty = |tcx, ty| {
2326-
tcx.normalize_associated_type_in(&ty)
2326+
tcx.trans_normalize_associated_types_in(&ty)
23272327
};
23282328
}

src/librustc/ty/maps/plumbing.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>,
697697
DepKind::FulfillObligation |
698698
DepKind::VtableMethods |
699699
DepKind::EraseRegionsTy |
700+
DepKind::NormalizeTy |
700701

701702
// These are just odd
702703
DepKind::Null |

src/librustc_lint/types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
431431
// fields are actually safe.
432432
let mut all_phantom = true;
433433
for field in &def.struct_variant().fields {
434-
let field_ty = cx.normalize_associated_type_in(&field.ty(cx, substs));
434+
let field_ty = cx.trans_normalize_associated_types_in(&field.ty(cx, substs));
435435
let r = self.check_type_for_ffi(cache, field_ty);
436436
match r {
437437
FfiSafe => {
@@ -463,7 +463,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
463463

464464
let mut all_phantom = true;
465465
for field in &def.struct_variant().fields {
466-
let field_ty = cx.normalize_associated_type_in(&field.ty(cx, substs));
466+
let field_ty = cx.trans_normalize_associated_types_in(&field.ty(cx, substs));
467467
let r = self.check_type_for_ffi(cache, field_ty);
468468
match r {
469469
FfiSafe => {
@@ -516,7 +516,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
516516
// Check the contained variants.
517517
for variant in &def.variants {
518518
for field in &variant.fields {
519-
let arg = cx.normalize_associated_type_in(&field.ty(cx, substs));
519+
let arg = cx.trans_normalize_associated_types_in(&field.ty(cx, substs));
520520
let r = self.check_type_for_ffi(cache, arg);
521521
match r {
522522
FfiSafe => {}
@@ -629,7 +629,7 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> {
629629
fn check_type_for_ffi_and_report_errors(&mut self, sp: Span, ty: Ty<'tcx>) {
630630
// it is only OK to use this function because extern fns cannot have
631631
// any generic types right now:
632-
let ty = self.cx.tcx.normalize_associated_type_in(&ty);
632+
let ty = self.cx.tcx.trans_normalize_associated_types_in(&ty);
633633

634634
match self.check_type_for_ffi(&mut FxHashSet(), ty) {
635635
FfiResult::FfiSafe => {}

src/librustc_trans/adt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub fn compute_fields<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>,
8080
ty::TyGenerator(def_id, substs, _) => {
8181
if variant_index > 0 { bug!("{} is a generator, which only has one variant", t);}
8282
substs.field_tys(def_id, cx.tcx()).map(|t| {
83-
cx.tcx().normalize_associated_type_in(&t)
83+
cx.tcx().trans_normalize_associated_types_in(&t)
8484
}).collect()
8585
},
8686
_ => bug!("{} is not a type that can have fields.", t)

src/librustc_trans/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ impl<'a, 'tcx> LayoutTyper<'tcx> for &'a SharedCrateContext<'a, 'tcx> {
642642
}
643643

644644
fn normalize_projections(self, ty: Ty<'tcx>) -> Ty<'tcx> {
645-
self.tcx().normalize_associated_type_in(&ty)
645+
self.tcx().trans_normalize_associated_types_in(&ty)
646646
}
647647
}
648648

src/librustc_trans/debuginfo/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ pub fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
582582
}
583583
ty::TyGenerator(def_id, substs, _) => {
584584
let upvar_tys : Vec<_> = substs.field_tys(def_id, cx.tcx()).map(|t| {
585-
cx.tcx().normalize_associated_type_in(&t)
585+
cx.tcx().trans_normalize_associated_types_in(&t)
586586
}).collect();
587587
prepare_tuple_metadata(cx,
588588
t,

src/librustc_trans/debuginfo/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
376376
name_to_append_suffix_to.push_str(",");
377377
}
378378

379-
let actual_type = cx.tcx().normalize_associated_type_in(&actual_type);
379+
let actual_type = cx.tcx().trans_normalize_associated_types_in(&actual_type);
380380
// Add actual type name to <...> clause of function name
381381
let actual_type_name = compute_debuginfo_type_name(cx,
382382
actual_type,
@@ -389,7 +389,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
389389
let template_params: Vec<_> = if cx.sess().opts.debuginfo == FullDebugInfo {
390390
let names = get_type_parameter_names(cx, generics);
391391
substs.types().zip(names).map(|(ty, name)| {
392-
let actual_type = cx.tcx().normalize_associated_type_in(&ty);
392+
let actual_type = cx.tcx().trans_normalize_associated_types_in(&ty);
393393
let actual_type_metadata = type_metadata(cx, actual_type, syntax_pos::DUMMY_SP);
394394
let name = CString::new(name.as_str().as_bytes()).unwrap();
395395
unsafe {

src/librustc_trans_utils/monomorphize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ pub fn field_ty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
131131
f: &'tcx ty::FieldDef)
132132
-> Ty<'tcx>
133133
{
134-
tcx.normalize_associated_type_in(&f.ty(tcx, param_substs))
134+
tcx.trans_normalize_associated_types_in(&f.ty(tcx, param_substs))
135135
}
136136

0 commit comments

Comments
 (0)