TyAlias in rustc_ast::ast - Rust (original) (raw)
pub struct TyAlias {
pub defaultness: Defaultness,
pub ident: Ident,
pub generics: Generics,
pub after_where_clause: WhereClause,
pub bounds: GenericBounds,
pub ty: Option<Box<Ty>>,
}There are two locations for where clause on type aliases. This represents the second where clause, before the semicolon. The first where clause is stored inside generics.
Take this example:
trait Foo {
type Assoc<'a, 'b> where Self: 'a, Self: 'b;
}
impl Foo for () {
type Assoc<'a, 'b> where Self: 'a = () where Self: 'b;
// ^^^^^^^^^^^^^^ before where clause
// ^^^^^^^^^^^^^^ after where clause
}
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 120 bytes