Skip to content

Commit ed10a5b

Browse files
committed
Test all the things
1 parent 6982fd2 commit ed10a5b

7 files changed

+87
-24
lines changed

src/test/ui/existential_types/generic_duplicate_param_use.stderr

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// compile-pass
2+
#![feature(existential_type)]
3+
4+
fn main() {}
5+
6+
// test that unused generic parameters are ok
7+
existential type Two<T, U>: 'static;
8+
9+
fn one<T: 'static>(t: T) -> Two<T, T> {
10+
t
11+
}
12+
13+
fn two<T: 'static, U: 'static>(t: T, _: U) -> Two<T, U> {
14+
t
15+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#![feature(existential_type)]
2+
3+
fn main() {}
4+
5+
// test that unused generic parameters are ok
6+
existential type Two<T, U>: 'static;
7+
8+
fn one<T: 'static>(t: T) -> Two<T, T> {
9+
t
10+
}
11+
12+
fn two<T: 'static, U: 'static>(t: T, _: U) -> Two<T, U> {
13+
t
14+
}
15+
16+
fn three<T: 'static, U: 'static>(_: T, u: U) -> Two<T, U> {
17+
//~^ ERROR defining existential type use differs from previous
18+
u
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error: defining existential type use differs from previous
2+
--> $DIR/generic_duplicate_param_use3.rs:16:1
3+
|
4+
LL | / fn three<T: 'static, U: 'static>(_: T, u: U) -> Two<T, U> {
5+
LL | | //~^ ERROR defining existential type use differs from previous
6+
LL | | u
7+
LL | | }
8+
| |_^
9+
|
10+
note: previous use here
11+
--> $DIR/generic_duplicate_param_use3.rs:8:1
12+
|
13+
LL | / fn one<T: 'static>(t: T) -> Two<T, T> {
14+
LL | | t
15+
LL | | }
16+
| |_^
17+
18+
error: aborting due to previous error
19+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![feature(existential_type)]
2+
3+
fn main() {}
4+
5+
// test that unused generic parameters are ok
6+
existential type Two<T, U>: 'static;
7+
8+
fn one<T: 'static>(t: T) -> Two<T, T> {
9+
t
10+
}
11+
12+
fn three<T: 'static, U: 'static>(_: T, u: U) -> Two<T, U> {
13+
//~^ ERROR defining existential type use differs from previous
14+
u
15+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error: defining existential type use differs from previous
2+
--> $DIR/generic_duplicate_param_use4.rs:12:1
3+
|
4+
LL | / fn three<T: 'static, U: 'static>(_: T, u: U) -> Two<T, U> {
5+
LL | | //~^ ERROR defining existential type use differs from previous
6+
LL | | u
7+
LL | | }
8+
| |_^
9+
|
10+
note: previous use here
11+
--> $DIR/generic_duplicate_param_use4.rs:8:1
12+
|
13+
LL | / fn one<T: 'static>(t: T) -> Two<T, T> {
14+
LL | | t
15+
LL | | }
16+
| |_^
17+
18+
error: aborting due to previous error
19+

src/test/ui/existential_types/unused_generic_param.stderr

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)