From e8d01ea4c76f6f3cb4f71dbff261355f825d12bb Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 25 Jan 2017 22:01:11 +0200 Subject: rustc: store type parameter defaults outside of ty::Generics. --- src/test/compile-fail/cycle-trait-default-type-trait.rs | 1 + src/test/compile-fail/generic-non-trailing-defaults.rs | 4 ++-- src/test/compile-fail/generic-type-params-forward-mention.rs | 2 +- src/test/compile-fail/issue-18183.rs | 4 ++-- src/test/compile-fail/resolve-self-in-impl.rs | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/test/compile-fail') 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> { //~^ 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; +struct Vec(A, T); //~^ ERROR type parameters with a default must be trailing -struct Foo, C>; +struct Foo, 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, U = bool>; +struct Foo, 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; //~ ERROR E0128 - //~| NOTE defaulted type parameters cannot be forward declared +pub struct Foo(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 for S {} // OK // FIXME: `Self` cannot be used in bounds because it depends on bounds itself. impl> Tr for S {} //~ ERROR `Self` type is used before it's determined -impl Tr for S {} //~ ERROR `Self` type is used before it's determined +impl Tr for S {} impl Tr for S where Self: Copy {} //~ ERROR `Self` type is used before it's determined impl Tr for S where S: 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 -- cgit 1.4.1-3-g733a5