Handle type errors in closure/generator upvar_tys
Co-authored-by: Roxane Fruytier <roxane.fruytier@hotmail.com>
This commit is contained in:
parent
28f03ac4c0
commit
f0ae24e100
7 changed files with 74 additions and 7 deletions
12
src/test/ui/issues/issue-77993-1.rs
Normal file
12
src/test/ui/issues/issue-77993-1.rs
Normal file
|
|
@ -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() {}
|
||||
16
src/test/ui/issues/issue-77993-1.stderr
Normal file
16
src/test/ui/issues/issue-77993-1.stderr
Normal file
|
|
@ -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`.
|
||||
9
src/test/ui/issues/issue-77993-2.rs
Normal file
9
src/test/ui/issues/issue-77993-2.rs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// edition:2018
|
||||
|
||||
async fn test() -> Result<(), Box<dyn std::error::Error>> {
|
||||
macro!();
|
||||
//~^ ERROR expected identifier, found `!`
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
8
src/test/ui/issues/issue-77993-2.stderr
Normal file
8
src/test/ui/issues/issue-77993-2.stderr
Normal file
|
|
@ -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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue