mirror of
https://github.com/rust-lang/rust
synced 2024-09-06 01:11:17 +00:00
Add generator lang-item
This commit is contained in:
parent
ce182d17f8
commit
b84a52c95a
|
@ -268,6 +268,7 @@ pub fn extract<'a, F>(check_name: F, attrs: &'a [ast::Attribute]) -> Option<(Sym
|
|||
Future, sym::future_trait, future_trait, Target::Trait, GenericRequirement::Exact(0);
|
||||
GeneratorState, sym::generator_state, gen_state, Target::Enum, GenericRequirement::None;
|
||||
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;
|
||||
Pin, sym::pin, pin_type, Target::Struct, GenericRequirement::None;
|
||||
|
||||
|
|
|
@ -678,6 +678,7 @@
|
|||
gen_future,
|
||||
gen_kill,
|
||||
generator,
|
||||
generator_return,
|
||||
generator_state,
|
||||
generators,
|
||||
generic_arg_infer,
|
||||
|
|
|
@ -82,6 +82,7 @@ pub trait Generator<R = ()> {
|
|||
/// `return` statement or implicitly as the last expression of a generator
|
||||
/// literal. For example futures would use this as `Result<T, E>` as it
|
||||
/// represents a completed future.
|
||||
#[cfg_attr(not(bootstrap), lang = "generator_return")]
|
||||
type Return;
|
||||
|
||||
/// Resumes the execution of this generator.
|
||||
|
|
Loading…
Reference in a new issue