diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-05-07 17:30:21 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-05-09 11:39:06 -0400 |
| commit | dc2ca9d8830a7a34242aa7722f545bc242813af3 (patch) | |
| tree | 11dfc9ff9b5cfe26411815ce70be0d58af905092 /src/test | |
| parent | ca95e7f94ed7b9f793a061bd0a7cc4d74de6b10d (diff) | |
| download | rust-dc2ca9d8830a7a34242aa7722f545bc242813af3.tar.gz rust-dc2ca9d8830a7a34242aa7722f545bc242813af3.zip | |
Refactor representation of bounds to separate out BuiltinBounds into
its own type. Use a bitset to represent built-in bounds. There are several places in the language where only builtin bounds (aka kinds) will be accepted, e.g. on closures, destructor type parameters perhaps, and on trait types.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/issue-2611-4.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/issue-2611-3.rs (renamed from src/test/compile-fail/issue-2611-3.rs) | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/test/compile-fail/issue-2611-4.rs b/src/test/compile-fail/issue-2611-4.rs index cf644fc198c..2385be5723e 100644 --- a/src/test/compile-fail/issue-2611-4.rs +++ b/src/test/compile-fail/issue-2611-4.rs @@ -20,7 +20,7 @@ struct E { } impl A for E { - fn b<F:Copy + Const,G>(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 2 bounds, but + fn b<F:Copy + Const,G>(_x: F) -> F { fail!() } //~ ERROR type parameter 0 requires `Const` } fn main() {} diff --git a/src/test/compile-fail/issue-2611-3.rs b/src/test/run-pass/issue-2611-3.rs index 248bea2d9b5..acc6ffd0dd1 100644 --- a/src/test/compile-fail/issue-2611-3.rs +++ b/src/test/run-pass/issue-2611-3.rs @@ -8,11 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Tests that impl methods are matched to traits exactly: -// we might be tempted to think matching is contravariant, but if -// we let an impl method can have more permissive bounds than the trait -// method it's implementing, the return type might be less specific than -// needed. Just punt and make it invariant. +// Tests that impls are allowed to have looser, more permissive bounds +// than the traits require. trait A { fn b<C:Copy + Const,D>(x: C) -> C; |
