Add generator lang-item
This commit is contained in:
parent
ce182d17f8
commit
b84a52c95a
3 changed files with 3 additions and 0 deletions
|
@ -268,6 +268,7 @@ language_item_table! {
|
||||||
Future, sym::future_trait, future_trait, Target::Trait, GenericRequirement::Exact(0);
|
Future, sym::future_trait, future_trait, Target::Trait, GenericRequirement::Exact(0);
|
||||||
GeneratorState, sym::generator_state, gen_state, Target::Enum, GenericRequirement::None;
|
GeneratorState, sym::generator_state, gen_state, Target::Enum, GenericRequirement::None;
|
||||||
Generator, sym::generator, gen_trait, Target::Trait, GenericRequirement::Minimum(1);
|
Generator, sym::generator, gen_trait, Target::Trait, GenericRequirement::Minimum(1);
|
||||||
|
GeneratorReturn, sym::generator_return, generator_return, Target::AssocTy, GenericRequirement::None;
|
||||||
Unpin, sym::unpin, unpin_trait, Target::Trait, GenericRequirement::None;
|
Unpin, sym::unpin, unpin_trait, Target::Trait, GenericRequirement::None;
|
||||||
Pin, sym::pin, pin_type, Target::Struct, GenericRequirement::None;
|
Pin, sym::pin, pin_type, Target::Struct, GenericRequirement::None;
|
||||||
|
|
||||||
|
|
|
@ -678,6 +678,7 @@ symbols! {
|
||||||
gen_future,
|
gen_future,
|
||||||
gen_kill,
|
gen_kill,
|
||||||
generator,
|
generator,
|
||||||
|
generator_return,
|
||||||
generator_state,
|
generator_state,
|
||||||
generators,
|
generators,
|
||||||
generic_arg_infer,
|
generic_arg_infer,
|
||||||
|
|
|
@ -82,6 +82,7 @@ pub trait Generator<R = ()> {
|
||||||
/// `return` statement or implicitly as the last expression of a generator
|
/// `return` statement or implicitly as the last expression of a generator
|
||||||
/// literal. For example futures would use this as `Result<T, E>` as it
|
/// literal. For example futures would use this as `Result<T, E>` as it
|
||||||
/// represents a completed future.
|
/// represents a completed future.
|
||||||
|
#[cfg_attr(not(bootstrap), lang = "generator_return")]
|
||||||
type Return;
|
type Return;
|
||||||
|
|
||||||
/// Resumes the execution of this generator.
|
/// Resumes the execution of this generator.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue