-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #111120 - chenyukang:yukang-suggest-let, r=Nilstrieb
Suggest let for possible binding with ty Origin from #109128 (comment) r? `@Nilstrieb`
- Loading branch information
Showing
15 changed files
with
122 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// run-rustfix | ||
|
||
fn fun(x: i32) -> i32 { x } | ||
|
||
fn main() { | ||
let _closure_annotated = |value: i32| -> i32 { | ||
let temp: i32 = fun(5i32); | ||
//~^ ERROR expected identifier, found `:` | ||
temp + value + 1 | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
error: expected identifier, found `:` | ||
--> $DIR/type-ascription-instead-of-let.rs:5:13 | ||
--> $DIR/type-ascription-instead-of-let.rs:7:13 | ||
| | ||
LL | temp: i32 = fun(5i32); | ||
| ^ expected identifier | ||
| | ||
help: you might have meant to introduce a new binding | ||
| | ||
LL | let temp: i32 = fun(5i32); | ||
| +++ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// run-rustfix | ||
|
||
fn main() { | ||
let _v: Vec<i32> = vec![1, 2, 3]; //~ ERROR expected identifier, found `:` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// run-rustfix | ||
|
||
fn main() { | ||
_v: Vec<i32> = vec![1, 2, 3]; //~ ERROR expected identifier, found `:` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: expected identifier, found `:` | ||
--> $DIR/missing-let-in-binding-2.rs:4:7 | ||
| | ||
LL | _v: Vec<i32> = vec![1, 2, 3]; | ||
| ^ expected identifier | ||
| | ||
help: you might have meant to introduce a new binding | ||
| | ||
LL | let _v: Vec<i32> = vec![1, 2, 3]; | ||
| +++ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
struct A { | ||
: :u8, //~ ERROR expected identifier, found `:` | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: expected identifier, found `:` | ||
--> $DIR/missing-let-in-binding-3.rs:2:5 | ||
| | ||
LL | struct A { | ||
| - while parsing this struct | ||
LL | : :u8, | ||
| ^ expected identifier | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
struct A { | ||
: u8 =, //~ ERROR expected identifier, found `:` | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: expected identifier, found `:` | ||
--> $DIR/missing-let-in-binding-4.rs:2:5 | ||
| | ||
LL | struct A { | ||
| - while parsing this struct | ||
LL | : u8 =, | ||
| ^ expected identifier | ||
|
||
error: aborting due to previous error | ||
|