Skip to content

Commit 3eb7b78

Browse files
eholkoli-obk
andcommitted
Update and fix tests
Co-authored-by: Oli Scherer <[email protected]>
1 parent b770e51 commit 3eb7b78

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
909909
.coroutine_kind(self.tcx.coroutine_for_closure(closure_def_id))
910910
.unwrap()
911911
{
912-
rustc_hir::CoroutineKind::Desugared(desugaring, _) => format!("{desugaring:#}"),
913-
coro => format!("{coro:#}"),
912+
rustc_hir::CoroutineKind::Desugared(desugaring, _) => desugaring.to_string(),
913+
coro => coro.to_string(),
914914
};
915915
let mut err = self.dcx().create_err(CoroClosureNotFn {
916916
span: self.tcx.def_span(closure_def_id),

library/core/src/iter/sources/generator.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
///
1010
/// ```
1111
/// #![feature(iter_macro, coroutines)]
12+
/// # #[cfg(not(bootstrap))]
13+
/// # {
1214
///
13-
/// let it = std::iter::iter!{
15+
/// let it = std::iter::iter!{|| {
1416
/// yield 1;
1517
/// yield 2;
1618
/// yield 3;
17-
/// };
19+
/// } }();
1820
/// let v: Vec<_> = it.collect();
1921
/// assert_eq!(v, [1, 2, 3]);
22+
/// # }
2023
/// ```
2124
#[unstable(feature = "iter_macro", issue = "none", reason = "generators are unstable")]
2225
#[allow_internal_unstable(coroutines, iter_from_coroutine)]

tests/ui/coroutine/gen_block.none.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ LL | let _ = || yield true;
3131
| ^^^^^^^^^^
3232
|
3333
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
34-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
34+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
3535
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3636

3737
error[E0658]: yield syntax is experimental
@@ -41,7 +41,7 @@ LL | let _ = #[coroutine] || yield true;
4141
| ^^^^^^^^^^
4242
|
4343
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
44-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
44+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
4545
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
4646

4747
error[E0658]: the `#[coroutine]` attribute is an experimental feature

tests/ui/feature-gates/feature-gate-coroutines.e2024.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | yield true;
55
| ^^^^^^^^^^
66
|
77
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
8-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
8+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error[E0658]: yield syntax is experimental
@@ -15,7 +15,7 @@ LL | let _ = || yield true;
1515
| ^^^^^^^^^^
1616
|
1717
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
18-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
18+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

2121
error[E0658]: yield syntax is experimental
@@ -25,7 +25,7 @@ LL | yield;
2525
| ^^^^^
2626
|
2727
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
28-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
28+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
2929
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3030

3131
error[E0658]: yield syntax is experimental
@@ -35,7 +35,7 @@ LL | yield 0;
3535
| ^^^^^^^
3636
|
3737
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
38-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
38+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
3939
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
4040

4141
error[E0658]: yield syntax is experimental

tests/ui/feature-gates/feature-gate-coroutines.none.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | yield true;
55
| ^^^^^^^^^^
66
|
77
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
8-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
8+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error[E0658]: yield syntax is experimental
@@ -15,7 +15,7 @@ LL | let _ = || yield true;
1515
| ^^^^^^^^^^
1616
|
1717
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
18-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
18+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
1919
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2020

2121
error[E0658]: yield syntax is experimental
@@ -25,7 +25,7 @@ LL | yield;
2525
| ^^^^^
2626
|
2727
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
28-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
28+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
2929
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3030

3131
error[E0658]: yield syntax is experimental
@@ -35,7 +35,7 @@ LL | yield 0;
3535
| ^^^^^^^
3636
|
3737
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
38-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
38+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
3939
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
4040

4141
error[E0658]: yield syntax is experimental

tests/ui/feature-gates/feature-gate-yield-expr.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | yield ();
55
| ^^^^^^^^
66
|
77
= note: see issue #43122 <https://github.com/rust-lang/rust/issues/43122> for more information
8-
= help: add `#![feature(coroutines)]` to the crate attributes to enable
8+
= help: add `#![feature(yield_expr)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

1111
error[E0658]: yield syntax is experimental

tests/ui/iterators/generator_returned_from_fn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | | }
1010
LL | | } }
1111
| |_____^ returns a reference to data owned by the current function
1212

13-
error: `gen` closure does not implement `Fn` because it captures state from its environment
13+
error: gen closure does not implement `Fn` because it captures state from its environment
1414
--> $DIR/generator_returned_from_fn.rs:33:13
1515
|
1616
LL | iter! { move || {

0 commit comments

Comments
 (0)