Skip to content

Commit ed5d1dd

Browse files
nikomatsakiscramertj
authored andcommitted
add some more debug! printouts
1 parent 248adc9 commit ed5d1dd

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/librustc/middle/free_region.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ impl<'tcx> FreeRegionMap<'tcx> {
161161
/// Record that `'sup:'sub`. Or, put another way, `'sub <= 'sup`.
162162
/// (with the exception that `'static: 'x` is not notable)
163163
pub fn relate_regions(&mut self, sub: Region<'tcx>, sup: Region<'tcx>) {
164+
debug!("relate_regions(sub={:?}, sup={:?})", sub, sup);
164165
if (is_free(sub) || *sub == ty::ReStatic) && is_free(sup) {
165166
self.relation.add(sub, sup)
166167
}
@@ -172,9 +173,12 @@ impl<'tcx> FreeRegionMap<'tcx> {
172173
r_a: Region<'tcx>,
173174
r_b: Region<'tcx>)
174175
-> bool {
176+
debug!("sub_free_regions(r_a={:?}, r_b={:?})", r_a, r_b);
175177
assert!(is_free(r_a));
176178
assert!(is_free(r_b));
177-
self.relation.contains(&r_a, &r_b)
179+
let result = r_a == r_b || self.relation.contains(&r_a, &r_b);
180+
debug!("sub_free_regions: result={}", result);
181+
result
178182
}
179183

180184
/// Compute the least-upper-bound of two free regions. In some
@@ -186,6 +190,7 @@ impl<'tcx> FreeRegionMap<'tcx> {
186190
r_a: Region<'tcx>,
187191
r_b: Region<'tcx>)
188192
-> Region<'tcx> {
193+
debug!("lub_free_regions(r_a={:?}, r_b={:?})", r_a, r_b);
189194
assert!(is_free(r_a));
190195
assert!(is_free(r_b));
191196
let result = if r_a == r_b { r_a } else {

src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ pub struct Inherited<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
228228
/// Information about the anonymous, abstract types whose values we
229229
/// are inferring in this function (these are the `impl Trait` that
230230
/// appear in the return type).
231+
#[derive(Debug)]
231232
struct AnonTypeDecl<'tcx> {
232233
/// The substitutions that we apply to the abstract that that this
233234
/// `impl Trait` desugars to. e.g., if:
@@ -1989,8 +1990,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
19891990
let ty_var = self.next_ty_var(TypeVariableOrigin::TypeInference(span));
19901991

19911992
let predicates_of = self.tcx.predicates_of(def_id);
1992-
debug!("instantiate_anon_types: predicates_of={:?}", predicates_of);
19931993
let bounds = predicates_of.instantiate(self.tcx, substs);
1994+
debug!("instantiate_anon_types: bounds={:?}", bounds);
19941995

19951996
let required_region_bounds =
19961997
self.tcx.required_region_bounds(ty, bounds.predicates.clone());

src/librustc_typeck/check/regionck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
135135
item_id: ast::NodeId,
136136
span: Span,
137137
wf_tys: &[Ty<'tcx>]) {
138-
debug!("regionck_item(item.id={:?}, wf_tys={:?}", item_id, wf_tys);
138+
debug!("regionck_item(item.id={:?}, wf_tys={:?})", item_id, wf_tys);
139139
let subject = self.tcx.hir.local_def_id(item_id);
140140
let mut rcx = RegionCtxt::new(self, RepeatingScope(item_id), item_id, Subject(subject));
141141
rcx.free_region_map.relate_free_regions_from_predicates(
@@ -468,7 +468,7 @@ impl<'a, 'gcx, 'tcx> RegionCtxt<'a, 'gcx, 'tcx> {
468468
let concrete_ty = self.resolve_type(anon_defn.concrete_ty);
469469

470470
debug!("constrain_anon_types: def_id={:?}", def_id);
471-
debug!("constrain_anon_types: substs={:?}", anon_defn.substs);
471+
debug!("constrain_anon_types: anon_defn={:#?}", anon_defn);
472472
debug!("constrain_anon_types: concrete_ty={:?}", concrete_ty);
473473

474474
let abstract_type_generics = self.tcx.generics_of(def_id);

0 commit comments

Comments
 (0)