Skip to content

Commit cb29c46

Browse files
committed
Fix from niko for cfail tests
1 parent b8d35de commit cb29c46

5 files changed

+21
-12
lines changed

src/librustc_typeck/check/implicator.rs

+8
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ impl<'a, 'tcx> Implicator<'a, 'tcx> {
329329
fn accumulate_from_assoc_types_transitive(&mut self,
330330
data: &ty::PolyTraitPredicate<'tcx>)
331331
{
332+
debug!("accumulate_from_assoc_types_transitive({})",
333+
data.repr(self.tcx()));
334+
332335
for poly_trait_ref in traits::supertraits(self.tcx(), data.to_poly_trait_ref()) {
333336
match ty::no_late_bound_regions(self.tcx(), &poly_trait_ref) {
334337
Some(trait_ref) => { self.accumulate_from_assoc_types(trait_ref); }
@@ -340,13 +343,18 @@ impl<'a, 'tcx> Implicator<'a, 'tcx> {
340343
fn accumulate_from_assoc_types(&mut self,
341344
trait_ref: Rc<ty::TraitRef<'tcx>>)
342345
{
346+
debug!("accumulate_from_assoc_types({})",
347+
trait_ref.repr(self.tcx()));
348+
343349
let trait_def_id = trait_ref.def_id;
344350
let trait_def = ty::lookup_trait_def(self.tcx(), trait_def_id);
345351
let assoc_type_projections: Vec<_> =
346352
trait_def.associated_type_names
347353
.iter()
348354
.map(|&name| ty::mk_projection(self.tcx(), trait_ref.clone(), name))
349355
.collect();
356+
debug!("accumulate_from_assoc_types: assoc_type_projections={}",
357+
assoc_type_projections.repr(self.tcx()));
350358
let tys = match self.fully_normalize(&assoc_type_projections) {
351359
Ok(tys) => { tys }
352360
Err(ErrorReported) => { return; }

src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
#![allow(dead_code)]
1717

18+
use std::marker::PhantomFn;
19+
1820
///////////////////////////////////////////////////////////////////////////
1921

20-
pub trait TheTrait {
22+
pub trait TheTrait: PhantomFn<Self, Self> {
2123
type TheAssocType;
22-
23-
fn dummy(&self) { }
2424
}
2525

2626
pub trait TheSubTrait : TheTrait {

src/test/compile-fail/regions-assoc-type-outlives-container-hrtb.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
#![allow(dead_code)]
1515
#![feature(rustc_attrs)]
1616

17+
use std::marker::PhantomFn;
18+
1719
///////////////////////////////////////////////////////////////////////////
1820

19-
pub trait TheTrait<'b> {
21+
pub trait TheTrait<'b> : PhantomFn<Self,Self> {
2022
type TheAssocType;
21-
22-
fn dummy(&'b self) { }
2323
}
2424

2525
pub struct TheType<'b> {

src/test/compile-fail/regions-assoc-type-outlives-container-wc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
#![allow(dead_code)]
1717

18+
use std::marker::PhantomFn;
19+
1820
///////////////////////////////////////////////////////////////////////////
1921

20-
pub trait TheTrait {
22+
pub trait TheTrait: PhantomFn<Self, Self> {
2123
type TheAssocType;
22-
23-
fn dummy(&self) { }
2424
}
2525

2626
pub struct TheType<'b> {

src/test/compile-fail/regions-assoc-type-outlives-container.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
// outlive the location in which the type appears. Issue #22246.
1414

1515
#![allow(dead_code)]
16+
#![feature(rustc_attrs)]
17+
18+
use std::marker::PhantomFn;
1619

1720
///////////////////////////////////////////////////////////////////////////
1821

19-
pub trait TheTrait {
22+
pub trait TheTrait: PhantomFn<Self, Self> {
2023
type TheAssocType;
21-
22-
fn dummy(&self) { }
2324
}
2425

2526
pub struct TheType<'b> {

0 commit comments

Comments
 (0)