TyAliasWhereClause in rustc_ast::ast - Rust (original) (raw)

Struct TyAliasWhereClause

Source

pub struct TyAliasWhereClause {
    pub has_where_token: bool,
    pub span: Span,
}

Expand description

The location of a where clause on a TyAlias (Span) and whether there was a where keyword (bool). This is split out from WhereClause, since there are two locations for where clause on type aliases, but their predicates are concatenated together.

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;
  //                 ^^^^^^^^^^^^^^ first where clause
  //                                     ^^^^^^^^^^^^^^ second where clause
}

If there is no where clause, then this is false with DUMMY_SP.

§

§

§

§

§

§

§

§

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: 12 bytes