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/compile-fail | |
| 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/compile-fail')
| -rw-r--r-- | src/test/compile-fail/issue-2611-3.rs | 29 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-2611-4.rs | 2 |
2 files changed, 1 insertions, 30 deletions
diff --git a/src/test/compile-fail/issue-2611-3.rs b/src/test/compile-fail/issue-2611-3.rs deleted file mode 100644 index 248bea2d9b5..00000000000 --- a/src/test/compile-fail/issue-2611-3.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// 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. - -trait A { - fn b<C:Copy + Const,D>(x: C) -> C; -} - -struct E { - f: int -} - -impl A for E { - fn b<F:Copy,G>(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 1 bound, but -} - -fn main() {} 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() {} |
