-
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.
Auto merge of #78432 - sexxi-goose:fix-77993-take3, r=nikomatsakis
Handle type errors in closure/generator upvar_tys Fixes #77993
- Loading branch information
Showing
5 changed files
with
82 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#[derive(Clone)] | ||
struct InGroup<F> { | ||
it: It, | ||
//~^ ERROR cannot find type `It` in this scope | ||
f: F, | ||
} | ||
fn dates_in_year() -> impl Clone { | ||
InGroup { f: |d| d } | ||
//~^ ERROR missing field `it` in initializer of `InGroup<_>` | ||
} | ||
|
||
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,16 @@ | ||
error[E0412]: cannot find type `It` in this scope | ||
--> $DIR/issue-77993-1.rs:3:9 | ||
| | ||
LL | it: It, | ||
| ^^ not found in this scope | ||
|
||
error[E0063]: missing field `it` in initializer of `InGroup<_>` | ||
--> $DIR/issue-77993-1.rs:8:5 | ||
| | ||
LL | InGroup { f: |d| d } | ||
| ^^^^^^^ missing `it` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0063, E0412. | ||
For more information about an error, try `rustc --explain E0063`. |
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,9 @@ | ||
// edition:2018 | ||
|
||
async fn test() -> Result<(), Box<dyn std::error::Error>> { | ||
macro!(); | ||
//~^ ERROR expected identifier, found `!` | ||
Ok(()) | ||
} | ||
|
||
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,8 @@ | ||
error: expected identifier, found `!` | ||
--> $DIR/issue-77993-2.rs:4:10 | ||
| | ||
LL | macro!(); | ||
| ^ expected identifier | ||
|
||
error: aborting due to previous error | ||
|