Skip to content

Commit 92aab95

Browse files
Rollup merge of #156171 - teor2345:missing-coro-test, r=cjgillot
Fix a coroutine UI test which is missing `#[coroutine]` This looks like a typo, although the test now produces a different error to the other errors in the file. I also fixed some comment typos in tests, happy to drop that commit if you don't want to review it.
2 parents 8ae06c8 + 6311909 commit 92aab95

5 files changed

Lines changed: 21 additions & 20 deletions

File tree

tests/coverage/assert.coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
LL| |// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce
2828
LL| |// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to
2929
LL| |// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails).
30-
LL| |// 4. `TerminatoKind::Assert` is, however, also present in the MIR generated for this test
30+
LL| |// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test
3131
LL| |// (and in many other coverage tests). The `Assert` terminator is typically generated by the
3232
LL| |// Rust compiler to check for runtime failures, such as numeric overflows.
3333

tests/coverage/assert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ fn main() -> Result<(), u8> {
2727
// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce
2828
// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to
2929
// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails).
30-
// 4. `TerminatoKind::Assert` is, however, also present in the MIR generated for this test
30+
// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test
3131
// (and in many other coverage tests). The `Assert` terminator is typically generated by the
3232
// Rust compiler to check for runtime failures, such as numeric overflows.

tests/ui/argument-suggestions/exotic-calls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Checks variations of E0057, which is the incorrect number of agruments passed into a closure
1+
//! Checks variations of E0057, which is the incorrect number of arguments passed into a closure
22
33
//@ check-fail
44

tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,54 @@ fn option(i: i32) -> impl Sized {
99
}
1010

1111
fn tuple() -> impl Sized {
12-
//~^ ERROR
12+
//~^ ERROR cannot resolve opaque type
1313
(tuple(),)
1414
}
1515

1616
fn array() -> impl Sized {
17-
//~^ ERROR
17+
//~^ ERROR cannot resolve opaque type
1818
[array()]
1919
}
2020

2121
fn ptr() -> impl Sized {
22-
//~^ ERROR
22+
//~^ ERROR cannot resolve opaque type
2323
&ptr() as *const _
2424
}
2525

2626
fn fn_ptr() -> impl Sized {
27-
//~^ ERROR
27+
//~^ ERROR cannot resolve opaque type
2828
fn_ptr as fn() -> _
2929
}
3030

3131
fn closure_capture() -> impl Sized {
32-
//~^ ERROR
32+
//~^ ERROR cannot resolve opaque type
3333
let x = closure_capture();
3434
move || {
3535
x;
3636
}
3737
}
3838

3939
fn closure_ref_capture() -> impl Sized {
40-
//~^ ERROR
40+
//~^ ERROR cannot resolve opaque type
4141
let x = closure_ref_capture();
4242
move || {
4343
&x;
4444
}
4545
}
4646

4747
fn closure_sig() -> impl Sized {
48-
//~^ ERROR
48+
//~^ ERROR cannot resolve opaque type
4949
|| closure_sig()
5050
}
5151

5252
fn coroutine_sig() -> impl Sized {
53-
//~^ ERROR
54-
|| coroutine_sig()
53+
//~^ ERROR cannot resolve opaque type
54+
#[coroutine]
55+
|| yield coroutine_sig()
5556
}
5657

5758
fn coroutine_capture() -> impl Sized {
58-
//~^ ERROR
59+
//~^ ERROR cannot resolve opaque type
5960
let x = coroutine_capture();
6061

6162
#[coroutine]
@@ -66,7 +67,7 @@ fn coroutine_capture() -> impl Sized {
6667
}
6768

6869
fn substs_change<T: 'static>() -> impl Sized {
69-
//~^ ERROR
70+
//~^ ERROR cannot resolve opaque type
7071
(substs_change::<&T>(),)
7172
}
7273

@@ -76,12 +77,12 @@ fn use_fn_ptr() -> impl Sized {
7677
}
7778

7879
fn mutual_recursion() -> impl Sync {
79-
//~^ ERROR
80+
//~^ ERROR cannot resolve opaque type
8081
mutual_recursion_b()
8182
}
8283

8384
fn mutual_recursion_b() -> impl Sized {
84-
//~^ ERROR
85+
//~^ ERROR cannot resolve opaque type
8586
mutual_recursion()
8687
}
8788

tests/ui/impl-trait/recursive-impl-trait-type-indirect.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,19 @@ LL | fn coroutine_sig() -> impl Sized {
5353
| ^^^^^^^^^^
5454

5555
error[E0720]: cannot resolve opaque type
56-
--> $DIR/recursive-impl-trait-type-indirect.rs:57:27
56+
--> $DIR/recursive-impl-trait-type-indirect.rs:58:27
5757
|
5858
LL | fn coroutine_capture() -> impl Sized {
5959
| ^^^^^^^^^^
6060

6161
error[E0720]: cannot resolve opaque type
62-
--> $DIR/recursive-impl-trait-type-indirect.rs:68:35
62+
--> $DIR/recursive-impl-trait-type-indirect.rs:69:35
6363
|
6464
LL | fn substs_change<T: 'static>() -> impl Sized {
6565
| ^^^^^^^^^^
6666

6767
error[E0720]: cannot resolve opaque type
68-
--> $DIR/recursive-impl-trait-type-indirect.rs:78:26
68+
--> $DIR/recursive-impl-trait-type-indirect.rs:79:26
6969
|
7070
LL | fn mutual_recursion() -> impl Sync {
7171
| ^^^^^^^^^ recursive opaque type
@@ -77,7 +77,7 @@ LL | fn mutual_recursion_b() -> impl Sized {
7777
| ---------- returning this opaque type `impl Sized`
7878

7979
error[E0720]: cannot resolve opaque type
80-
--> $DIR/recursive-impl-trait-type-indirect.rs:83:28
80+
--> $DIR/recursive-impl-trait-type-indirect.rs:84:28
8181
|
8282
LL | fn mutual_recursion() -> impl Sync {
8383
| --------- returning this opaque type `impl Sync`

0 commit comments

Comments
 (0)