Test aller things

This commit is contained in:
Oliver Scherer 2019-01-25 20:37:10 +01:00
parent ed10a5ba01
commit 0d25ff8842
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#![feature(existential_type)]
fn main() {}
// test that unused generic parameters are ok
existential type Two<T, U>: 'static;
fn one<T: 'static>(t: T) -> Two<T, T> {
t
}
fn two<T: 'static, U: 'static>(t: T, _: U) -> Two<U, T> {
//~^ ERROR defining existential type use differs from previous
t
}

View File

@ -0,0 +1,19 @@
error: defining existential type use differs from previous
--> $DIR/generic_duplicate_param_use5.rs:12:1
|
LL | / fn two<T: 'static, U: 'static>(t: T, _: U) -> Two<U, T> {
LL | | //~^ ERROR defining existential type use differs from previous
LL | | t
LL | | }
| |_^
|
note: previous use here
--> $DIR/generic_duplicate_param_use5.rs:8:1
|
LL | / fn one<T: 'static>(t: T) -> Two<T, T> {
LL | | t
LL | | }
| |_^
error: aborting due to previous error