pub struct TypeDecl {
pub kw: KwType,
pub tyvars: Vec<TypeVarTok>,
pub name: VarTok,
pub eq: DefEqTok,
pub body: TypeDeclBody,
pub ands: Vec<AndTypeClause>,
}Expand description
A type declaration, optionally with mutual (and) recursion between
several type declarations (parser.mly’s nxvariantdec and-chain, e.g.
satysfi-base’s stream.satyg: type 'a state = … and 'a u = ('a state) Promise.t). The head clause is kw..body; every further and-clause is
an AndTypeClause. All clauses in one chain are mutually visible — they
lower to consecutive UserTypeDecl/UserSynonymDecls, exactly the shape
the 0.1 lowering (v1/lower.rs) already produces for type … and …, which
the typechecker resolves with the same forward-reference tolerance.
Fields§
§kw: KwType§tyvars: Vec<TypeVarTok>§name: VarTok§eq: DefEqTok§body: TypeDeclBody§ands: Vec<AndTypeClause>Trait Implementations§
Source§impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for TypeDecl
impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for TypeDecl
Source§type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
Every error must be convertible to the universal one, so a field’s failure can become the
enclosing type’s failure with no per-field where-predicate. Stating it HERE rather than at
each derived impl is what keeps it out of the obligation graph: a per-field
<FieldTy as Parse<Atom>>::Error: Into<…> predicate re-creates a projection cycle on a
recursive field (E0275), which decycle’s bound-peeling does not break.Source§fn parse_stream<__SyanMacro_S: ParseStream<Atom = __SyanMacro_Atom>>(
__syan_stream: &mut __SyanMacro_S,
) -> Result<Self, Self::Error>
fn parse_stream<__SyanMacro_S: ParseStream<Atom = __SyanMacro_Atom>>( __syan_stream: &mut __SyanMacro_S, ) -> Result<Self, Self::Error>
Parse from a reborrowable stream. Read more
impl StructuralPartialEq for TypeDecl
Source§impl<__SyanMacro_Atom> Unparse<__SyanMacro_Atom> for TypeDeclwhere
KwType: Unparse<__SyanMacro_Atom>,
Vec<TypeVarTok>: Unparse<__SyanMacro_Atom>,
VarTok: Unparse<__SyanMacro_Atom>,
DefEqTok: Unparse<__SyanMacro_Atom>,
TypeDeclBody: Unparse<__SyanMacro_Atom>,
Vec<AndTypeClause>: Unparse<__SyanMacro_Atom>,
impl<__SyanMacro_Atom> Unparse<__SyanMacro_Atom> for TypeDeclwhere
KwType: Unparse<__SyanMacro_Atom>,
Vec<TypeVarTok>: Unparse<__SyanMacro_Atom>,
VarTok: Unparse<__SyanMacro_Atom>,
DefEqTok: Unparse<__SyanMacro_Atom>,
TypeDeclBody: Unparse<__SyanMacro_Atom>,
Vec<AndTypeClause>: Unparse<__SyanMacro_Atom>,
Auto Trait Implementations§
impl Freeze for TypeDecl
impl RefUnwindSafe for TypeDecl
impl Send for TypeDecl
impl Sync for TypeDecl
impl Unpin for TypeDecl
impl UnsafeUnpin for TypeDecl
impl UnwindSafe for TypeDecl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more