Skip to content

Commit 5834772

Browse files
Update Tests
1 parent 2975a21 commit 5834772

10 files changed

+92
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn foo<T>() where T: Default -> impl Default + 'static {}
2+
//~^ ERROR return type should be specified after the function parameters
3+
//~| HELP place the return type after the function parameters
4+
5+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: return type should be specified after the function parameters
2+
--> $DIR/misplaced-return-type-complex-type-issue-126311.rs:1:30
3+
|
4+
LL | fn foo<T>() where T: Default -> impl Default + 'static {}
5+
| ^^ expected one of `(`, `+`, `,`, `::`, `<`, or `{`
6+
|
7+
help: place the return type after the function parameters
8+
|
9+
LL - fn foo<T>() where T: Default -> impl Default + 'static {}
10+
LL + fn foo<T>() -> impl Default + 'static where T: Default {}
11+
|
12+
13+
error: aborting due to 1 previous error
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn foo<T>() where T: Default -> u8 {}
2+
//~^ ERROR return type should be specified after the function parameters
3+
//~| HELP place the return type after the function parameters
4+
5+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: return type should be specified after the function parameters
2+
--> $DIR/misplaced-return-type-issue-126311.rs:1:30
3+
|
4+
LL | fn foo<T>() where T: Default -> u8 {}
5+
| ^^ expected one of `(`, `+`, `,`, `::`, `<`, or `{`
6+
|
7+
help: place the return type after the function parameters
8+
|
9+
LL - fn foo<T>() where T: Default -> u8 {}
10+
LL + fn foo<T>() -> u8 where T: Default {}
11+
|
12+
13+
error: aborting due to 1 previous error
14+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fn foo<T, K>()
2+
//~^ HELP place the return type after the function parameters
3+
where
4+
T: Default,
5+
K: Clone, -> Result<u8, String>
6+
//~^ ERROR return type should be specified after the function parameters
7+
{
8+
Ok(0)
9+
}
10+
11+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error: return type should be specified after the function parameters
2+
--> $DIR/misplaced-return-type-where-in-next-line-issue-126311.rs:5:15
3+
|
4+
LL | K: Clone, -> Result<u8, String>
5+
| ^^ expected one of `{`, lifetime, or type
6+
|
7+
help: place the return type after the function parameters
8+
|
9+
LL ~ fn foo<T, K>() -> Result<u8, String>
10+
LL |
11+
LL | where
12+
LL | T: Default,
13+
LL ~ K: Clone,
14+
|
15+
16+
error: aborting due to 1 previous error
17+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn foo<T>() where T: Default -> {
2+
//~^ ERROR expected one of `(`, `+`, `,`, `::`, `<`, or `{`, found `->`
3+
0
4+
}
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `(`, `+`, `,`, `::`, `<`, or `{`, found `->`
2+
--> $DIR/misplaced-return-type-without-type-issue-126311.rs:1:30
3+
|
4+
LL | fn foo<T>() where T: Default -> {
5+
| ^^ expected one of `(`, `+`, `,`, `::`, `<`, or `{`
6+
7+
error: aborting due to 1 previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn bar<T>() -> u8 -> u64 {}
2+
//~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found `->`
3+
4+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected one of `!`, `(`, `+`, `::`, `<`, `where`, or `{`, found `->`
2+
--> $DIR/misplaced-return-type-without-where-issue-126311.rs:1:19
3+
|
4+
LL | fn bar<T>() -> u8 -> u64 {}
5+
| ^^ expected one of 7 possible tokens
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)