rust/tests/ui/coroutine/const_gen_fn.stderr
Oli Scherer 5fbdfc3e10
Add iter macro
This adds an `iter!` macro that can be used to create movable
generators.

This also adds a yield_expr feature so the `yield` keyword can be used
within iter! macro bodies. This was needed because several unstable
features each need `yield` expressions, so this allows us to stabilize
them separately from any individual feature.

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
Co-authored-by: Travis Cross <tc@traviscross.com>
2025-06-03 10:52:32 -07:00

33 lines
806 B
Plaintext

error: functions cannot be both `const` and `gen`
--> $DIR/const_gen_fn.rs:5:1
|
LL | const gen fn a() {}
| ^^^^^-^^^----------
| | |
| | `gen` because of this
| `const` because of this
error: functions cannot be both `const` and `async gen`
--> $DIR/const_gen_fn.rs:9:1
|
LL | const async gen fn b() {}
| ^^^^^-^^^^^^^^^----------
| | |
| | `async gen` because of this
| `const` because of this
error: `gen` fn bodies are not allowed in constant functions
--> $DIR/const_gen_fn.rs:5:18
|
LL | const gen fn a() {}
| ^^
error: `async gen` fn bodies are not allowed in constant functions
--> $DIR/const_gen_fn.rs:9:24
|
LL | const async gen fn b() {}
| ^^
error: aborting due to 4 previous errors