about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAhmed Charles <acharles@outlook.com>2015-01-24 09:53:05 -0800
committerFlavio Percoco <flaper87@gmail.com>2015-02-22 16:31:19 +0100
commit3ebdbac2651cd21f2efda8d3b381ed396d7bb725 (patch)
tree1ed52971404152d3d20f1a70f11823c5aa0e55e2 /src/test
parentdcc6ce2c772cb851ac35cbc2ddafcae9bf2fa9fd (diff)
downloadrust-3ebdbac2651cd21f2efda8d3b381ed396d7bb725.tar.gz
rust-3ebdbac2651cd21f2efda8d3b381ed396d7bb725.zip
Do not permit type parameters on builtin bounds.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/typeck-builtin-bound-type-parameters.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/compile-fail/typeck-builtin-bound-type-parameters.rs b/src/test/compile-fail/typeck-builtin-bound-type-parameters.rs
new file mode 100644
index 00000000000..3914fb96a0d
--- /dev/null
+++ b/src/test/compile-fail/typeck-builtin-bound-type-parameters.rs
@@ -0,0 +1,27 @@
+// Copyright 2015 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.
+
+fn foo1<T:Copy<U>, U>(x: T) {}
+//~^ ERROR: builtin bounds do not require arguments, 1 given
+
+trait Trait: Copy<Send> {}
+//~^ ERROR: builtin bounds do not require arguments, 1 given
+
+struct MyStruct1<T: Copy<T>>;
+//~^ ERROR: builtin bounds do not require arguments, 1 given
+
+struct MyStruct2<'a, T: Copy<'a>>;
+//~^ ERROR: builtin bounds do not require arguments, 1 given
+
+fn foo2<'a, T:Copy<'a, U>, U>(x: T) {}
+//~^ ERROR: builtin bounds do not require arguments, 1 given
+
+fn main() {
+}