Skip to content

Commit

Permalink
Correct a test. The error message changed because, with this fix, we
Browse files Browse the repository at this point in the history
detected (correctly) that there was only one impl and hence ignored the
`Self` bound completely. I (semi-arbitrarily) elected to delect the
impl, forcing the trait matcher to be more conservative and lean on the
where clauses in scope, yielding the original error message.
  • Loading branch information
nikomatsakis committed Oct 17, 2014
1 parent 590a61f commit f4a7d32
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/test/compile-fail/type-params-in-different-spaces-2.rs
Expand Up @@ -8,28 +8,25 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Test static calls to make sure that we align the Self and input
// type parameters on a trait correctly.

trait Tr<T> {
fn op(T) -> Self;
}

// these compile as if Self: Tr<U>, even tho only Self: Tr<Self or T>
trait A: Tr<Self> {
fn test<U>(u: U) -> Self {
Tr::op(u) //~ ERROR not implemented
}
}

trait B<T>: Tr<T> {
fn test<U>(u: U) -> Self {
Tr::op(u) //~ ERROR not implemented
}
}

impl<T> Tr<T> for T {
fn op(t: T) -> T { t }
}
impl<T> A for T {}

fn main() {
std::io::println(A::test((&7306634593706211700, 8)));
}

17 comments on commit f4a7d32

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at nikomatsakis@f4a7d32

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging nikomatsakis/rust/issue-18019 = f4a7d32 into auto

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nikomatsakis/rust/issue-18019 = f4a7d32 merged ok, testing candidate = b0c4728

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at nikomatsakis@f4a7d32

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging nikomatsakis/rust/issue-18019 = f4a7d32 into auto

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nikomatsakis/rust/issue-18019 = f4a7d32 merged ok, testing candidate = 2fe96fd2

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at nikomatsakis@f4a7d32

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging nikomatsakis/rust/issue-18019 = f4a7d32 into auto

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nikomatsakis/rust/issue-18019 = f4a7d32 merged ok, testing candidate = 7124b838

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 17, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at nikomatsakis@f4a7d32

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging nikomatsakis/rust/issue-18019 = f4a7d32 into auto

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nikomatsakis/rust/issue-18019 = f4a7d32 merged ok, testing candidate = 2c0f876

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on f4a7d32 Oct 18, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 2c0f876

Please sign in to comment.