about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2017-01-25 22:01:11 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2017-02-25 17:07:59 +0200
commite8d01ea4c76f6f3cb4f71dbff261355f825d12bb (patch)
treebd71bb08ce70f9e7e9eebcddd20d084b12dbf96c /src/test/compile-fail
parent1572bf104dbf65d58bd6b889fa46229c9b92d6f9 (diff)
downloadrust-e8d01ea4c76f6f3cb4f71dbff261355f825d12bb.tar.gz
rust-e8d01ea4c76f6f3cb4f71dbff261355f825d12bb.zip
rustc: store type parameter defaults outside of ty::Generics.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/cycle-trait-default-type-trait.rs1
-rw-r--r--src/test/compile-fail/generic-non-trailing-defaults.rs4
-rw-r--r--src/test/compile-fail/generic-type-params-forward-mention.rs2
-rw-r--r--src/test/compile-fail/issue-18183.rs4
-rw-r--r--src/test/compile-fail/resolve-self-in-impl.rs2
5 files changed, 7 insertions, 6 deletions
diff --git a/src/test/compile-fail/cycle-trait-default-type-trait.rs b/src/test/compile-fail/cycle-trait-default-type-trait.rs
index e6caeb34a8c..6825572b26c 100644
--- a/src/test/compile-fail/cycle-trait-default-type-trait.rs
+++ b/src/test/compile-fail/cycle-trait-default-type-trait.rs
@@ -13,6 +13,7 @@
 
 trait Foo<X = Box<Foo>> {
     //~^ ERROR unsupported cyclic reference
+    //~| ERROR unsupported cyclic reference
 }
 
 fn main() { }
diff --git a/src/test/compile-fail/generic-non-trailing-defaults.rs b/src/test/compile-fail/generic-non-trailing-defaults.rs
index 77e55203263..13b7753082c 100644
--- a/src/test/compile-fail/generic-non-trailing-defaults.rs
+++ b/src/test/compile-fail/generic-non-trailing-defaults.rs
@@ -10,10 +10,10 @@
 
 struct Heap;
 
-struct Vec<A = Heap, T>;
+struct Vec<A = Heap, T>(A, T);
 //~^ ERROR type parameters with a default must be trailing
 
-struct Foo<A, B = Vec<C>, C>;
+struct Foo<A, B = Vec<C>, C>(A, B, C);
 //~^ ERROR type parameters with a default must be trailing
 //~| ERROR type parameters with a default cannot use forward declared identifiers
 
diff --git a/src/test/compile-fail/generic-type-params-forward-mention.rs b/src/test/compile-fail/generic-type-params-forward-mention.rs
index eda1b014fa7..bfa6af0da43 100644
--- a/src/test/compile-fail/generic-type-params-forward-mention.rs
+++ b/src/test/compile-fail/generic-type-params-forward-mention.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // Ensure that we get an error and not an ICE for this problematic case.
-struct Foo<T = Option<U>, U = bool>;
+struct Foo<T = Option<U>, U = bool>(T, U);
 //~^ ERROR type parameters with a default cannot use forward declared identifiers
 fn main() {
     let x: Foo;
diff --git a/src/test/compile-fail/issue-18183.rs b/src/test/compile-fail/issue-18183.rs
index b3fc3aea148..feab04531b7 100644
--- a/src/test/compile-fail/issue-18183.rs
+++ b/src/test/compile-fail/issue-18183.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-pub struct Foo<Bar=Bar>; //~ ERROR E0128
-                         //~| NOTE defaulted type parameters cannot be forward declared
+pub struct Foo<Bar=Bar>(Bar); //~ ERROR E0128
+                              //~| NOTE defaulted type parameters cannot be forward declared
 pub struct Baz(Foo);
 fn main() {}
diff --git a/src/test/compile-fail/resolve-self-in-impl.rs b/src/test/compile-fail/resolve-self-in-impl.rs
index 04f98c7ab32..ab9ac039825 100644
--- a/src/test/compile-fail/resolve-self-in-impl.rs
+++ b/src/test/compile-fail/resolve-self-in-impl.rs
@@ -15,7 +15,7 @@ impl Tr<Self> for S {} // OK
 
 // FIXME: `Self` cannot be used in bounds because it depends on bounds itself.
 impl<T: Tr<Self>> Tr<T> for S {} //~ ERROR `Self` type is used before it's determined
-impl<T = Self> Tr<T> for S {} //~ ERROR `Self` type is used before it's determined
+impl<T = Self> Tr<T> for S {}
 impl Tr for S where Self: Copy {} //~ ERROR `Self` type is used before it's determined
 impl Tr for S where S<Self>: Copy {} //~ ERROR `Self` type is used before it's determined
 impl Tr for S where Self::Assoc: Copy {} //~ ERROR `Self` type is used before it's determined