Skip to content

Commit 0d25ff8

Browse files
committed
Test aller things
1 parent ed10a5b commit 0d25ff8

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
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 two<T: 'static, U: 'static>(t: T, _: U) -> Two<U, T> {
13+
//~^ ERROR defining existential type use differs from previous
14+
t
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_use5.rs:12:1
3+
|
4+
LL | / fn two<T: 'static, U: 'static>(t: T, _: U) -> Two<U, T> {
5+
LL | | //~^ ERROR defining existential type use differs from previous
6+
LL | | t
7+
LL | | }
8+
| |_^
9+
|
10+
note: previous use here
11+
--> $DIR/generic_duplicate_param_use5.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+

0 commit comments

Comments
 (0)