[][src]Struct rustc_parse::parser::Parser

pub struct Parser<'a> {
    pub sess: &'a ParseSess,
    pub token: Token,
    pub prev_token: Token,
    restrictions: Restrictions,
    expected_tokens: Vec<TokenType>,
    token_cursor: TokenCursor,
    desugar_doc_comments: bool,
    unmatched_angle_bracket_count: u32,
    max_angle_bracket_count: u32,
    pub(super) unclosed_delims: Vec<UnmatchedBrace>,
    last_unexpected_token_span: Option<Span>,
    pub last_type_ascription: Option<(Span, bool)>,
    subparser_name: Option<&'static str>,
}
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Fields

sess: &'a ParseSess
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

token: Token
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The current token.

prev_token: Token
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The previous token.

restrictions: Restrictions
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

expected_tokens: Vec<TokenType>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

token_cursor: TokenCursor
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

desugar_doc_comments: bool
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

unmatched_angle_bracket_count: u32
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

This field is used to keep track of how many left angle brackets we have seen. This is required in order to detect extra leading left angle brackets (< characters) and error appropriately.

See the comments in the parse_path_segment function for more details.

max_angle_bracket_count: u32
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

unclosed_delims: Vec<UnmatchedBrace>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A list of all unclosed delimiters found by the lexer. If an entry is used for error recovery it gets removed from here. Every entry left at the end gets emitted as an independent error.

last_unexpected_token_span: Option<Span>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

last_type_ascription: Option<(Span, bool)>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

subparser_name: Option<&'static str>
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

If present, this Parser is not parsing Rust code but rather a macro call.

Implementations

impl<'a> Parser<'a>[src]

pub(super) fn parse_outer_attributes(
    &mut self
) -> PResult<'a, Vec<Attribute>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses attributes that appear before an item.

fn mk_doc_comment(&self, s: Symbol) -> Attribute[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn parse_attribute(&mut self, permit_inner: bool) -> PResult<'a, Attribute>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Matches attribute = # ! [ meta_item ].

If permit_inner is true, then a leading ! indicates an inner attribute.

fn parse_attribute_with_inner_parse_policy(
    &mut self,
    inner_parse_policy: InnerAttrPolicy
) -> PResult<'a, Attribute>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

The same as parse_attribute, except it takes in an InnerAttrPolicy that prescribes how to handle inner attributes.

pub(super) fn error_on_forbidden_inner_attr(
    &self,
    attr_sp: Span,
    policy: InnerAttrPolicy
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn parse_attr_item(&mut self) -> PResult<'a, AttrItem>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an inner part of an attribute (the path and following tokens). The tokens must be either a delimited token stream, or empty token stream, or the "legacy" key-value form. PATH ( TOKEN_STREAM ) PATH [ TOKEN_STREAM ] PATH { TOKEN_STREAM } PATH PATH = UNSUFFIXED_LIT The delimiters or = are still put into the resulting token stream.

pub(crate) fn parse_inner_attributes(&mut self) -> PResult<'a, Vec<Attribute>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses attributes that appear after the opening of an item. These should be preceded by an exclamation mark, but we accept and warn about one terminated by a semicolon.

Matches inner_attrs*.

pub(crate) fn parse_unsuffixed_lit(&mut self) -> PResult<'a, Lit>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn parse_cfg_attr(
    &mut self
) -> PResult<'a, (MetaItem, Vec<(AttrItem, Span)>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses cfg_attr(pred, attr_item_list) where attr_item_list is comma-delimited.

pub(crate) fn parse_meta_seq_top(&mut self) -> PResult<'a, Vec<NestedMetaItem>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Matches COMMASEP(meta_item_inner).

pub fn parse_meta_item(&mut self) -> PResult<'a, MetaItem>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Matches the following grammar (per RFC 1559).

meta_item : PATH ( '=' UNSUFFIXED_LIT | '(' meta_item_inner? ')' )? ;
meta_item_inner : (meta_item | UNSUFFIXED_LIT) (',' meta_item_inner)? ;

pub(crate) fn parse_meta_item_kind(&mut self) -> PResult<'a, MetaItemKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_meta_item_inner(&mut self) -> PResult<'a, NestedMetaItem>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Matches meta_item_inner : (meta_item | UNSUFFIXED_LIT) ;.

impl<'a> Parser<'a>[src]

pub fn parse_expr(&mut self) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an expression.

pub(super) fn parse_anon_const_expr(
    &mut self
) -> PResult<'a, AnonConst>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_expr_catch_underscore(&mut self) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_paren_expr_seq(&mut self) -> PResult<'a, Vec<P<Expr>>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a sequence of expressions delimited by parentheses.

pub(super) fn parse_expr_res(
    &mut self,
    r: Restrictions,
    already_parsed_attrs: Option<AttrVec>
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an expression, subject to the given restrictions.

fn parse_assoc_expr(
    &mut self,
    already_parsed_attrs: Option<AttrVec>
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an associative expression.

This parses an expression accounting for associativity and precedence of the operators in the expression.

pub(super) fn parse_assoc_expr_with(
    &mut self,
    min_prec: usize,
    lhs: LhsExpr
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an associative expression with operators of at least min_prec precedence.

fn should_continue_as_assoc_expr(&mut self, lhs: &Expr) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn error_found_expr_would_be_stmt(&self, lhs: &Expr)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

We've found an expression that would be parsed as a statement, but the next token implies this should be parsed as an expression. For example: if let Some(x) = x { x } else { 0 } / 2.

fn check_assoc_op(&self) -> Option<Spanned<AssocOp>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Possibly translate the current token to an associative operator. The method does not advance the current token.

Also performs recovery for and / or which are mistaken for && and || respectively.

fn error_bad_logical_op(&self, bad: &str, good: &str, english: &str)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Error on and and or suggesting && and || respectively.

fn expr_is_complete(&self, e: &Expr) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Checks if this expression is a successfully parsed statement.

fn parse_range_expr(
    &mut self,
    prec: usize,
    lhs: P<Expr>,
    op: AssocOp,
    cur_op_span: Span
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses x..y, x..=y, and x../x..=. The other two variants are handled in parse_prefix_range_expr below.

fn is_at_start_of_range_notation_rhs(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_prefix_range_expr(
    &mut self,
    attrs: Option<AttrVec>
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses prefix-forms of range notation: ..expr, .., ..=expr.

fn parse_prefix_expr(&mut self, attrs: Option<AttrVec>) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a prefix-unary-operator expr.

fn parse_prefix_expr_common(&mut self, lo: Span) -> PResult<'a, (Span, P<Expr>)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_unary_expr(
    &mut self,
    lo: Span,
    op: UnOp
) -> PResult<'a, (Span, ExprKind)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_tilde_expr(&mut self, lo: Span) -> PResult<'a, (Span, ExprKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_box_expr(&mut self, lo: Span) -> PResult<'a, (Span, ExprKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse box expr.

fn is_mistaken_not_ident_negation(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_not_expr(&mut self, lo: Span) -> PResult<'a, (Span, ExprKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on not expr in favor of !expr.

fn interpolated_or_expr_span(
    &self,
    expr: PResult<'a, P<Expr>>
) -> PResult<'a, (Span, P<Expr>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns the span of expr, if it was not interpolated or the span of the interpolated token.

fn parse_assoc_op_cast(
    &mut self,
    lhs: P<Expr>,
    lhs_span: Span,
    expr_kind: fn(_: P<Expr>, _: P<Ty>) -> ExprKind
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_and_disallow_postfix_after_cast(
    &mut self,
    cast_expr: P<Expr>
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a postfix operators such as ., ?, or index ([]) after a cast, then emits an error and returns the newly parsed tree. The resulting parse tree for &x as T[0] has a precedence of ((&x) as T)[0].

fn parse_assoc_op_ascribe(
    &mut self,
    lhs: P<Expr>,
    lhs_span: Span
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_borrow_expr(&mut self, lo: Span) -> PResult<'a, (Span, ExprKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse & mut? <expr> or & raw [ const | mut ] <expr>.

fn error_remove_borrow_lifetime(&self, span: Span, lt_span: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_borrow_modifiers(&mut self, lo: Span) -> (BorrowKind, Mutability)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse mut? or raw [ const | mut ].

fn parse_dot_or_call_expr(
    &mut self,
    attrs: Option<AttrVec>
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a.b or a(13) or a[4] or just a.

pub(super) fn parse_dot_or_call_expr_with(
    &mut self,
    e0: P<Expr>,
    lo: Span,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_dot_or_call_expr_with_(
    &mut self,
    e: P<Expr>,
    lo: Span
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_dot_suffix_expr(
    &mut self,
    lo: Span,
    base: P<Expr>
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn error_unexpected_after_dot(&self)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_field_access_by_float_lit(
    &mut self,
    lo: Span,
    base: P<Expr>,
    sym: Symbol
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_tuple_field_access_expr(
    &mut self,
    lo: Span,
    base: P<Expr>,
    field: Symbol,
    suffix: Option<Symbol>
) -> P<Expr>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_fn_call_expr(&mut self, lo: Span, fun: P<Expr>) -> P<Expr>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a function call expression, expr(...).

fn parse_index_expr(&mut self, lo: Span, base: P<Expr>) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse an indexing expression expr[...].

fn parse_dot_suffix(
    &mut self,
    self_arg: P<Expr>,
    lo: Span
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Assuming we have just parsed ., continue parsing into an expression.

fn parse_bottom_expr(&mut self) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

At the bottom (top?) of the precedence hierarchy, Parses things like parenthesized exprs, macros, return, etc.

N.B., this does not parse outer attributes, and is private because it only works correctly if called from parse_dot_or_call_expr().

fn maybe_collect_tokens(
    &mut self,
    has_outer_attrs: bool,
    f: impl FnOnce(&mut Self) -> PResult<'a, P<Expr>>
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_lit_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_tuple_parens_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_array_or_repeat_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_path_start_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_labeled_expr(
    &mut self,
    label: Label,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse 'label: $expr. The label is already parsed.

fn error_labeled_expr_must_be_followed_by_colon(&self, lo: Span, span: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_do_catch(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on the syntax do catch { ... } suggesting try { ... } instead.

fn parse_expr_opt(&mut self) -> PResult<'a, Option<P<Expr>>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse an expression if the token can begin one.

fn parse_return_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse "return" expr?.

fn parse_break_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse "('label ":")? break expr?.

fn parse_yield_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse "yield" expr?.

pub fn parse_str_lit(&mut self) -> Result<StrLit, Option<Lit>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns a string literal if the next token is a string literal. In case of error returns Some(lit) if the next token is a literal with a wrong kind, and returns None if the next token is not literal at all.

pub(super) fn parse_lit(
    &mut self
) -> PResult<'a, Lit>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parse_opt_lit(
    &mut self
) -> Option<Lit>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Matches lit = true | false | token_lit. Returns None if the next token is not a literal.

fn error_float_lits_must_have_int_part(&self, token: &Token)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn report_lit_error(&self, err: LitError, lit: Lit, span: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn expect_no_suffix(
    &self,
    sp: Span,
    kind: &str,
    suffix: Option<Symbol>
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn parse_literal_maybe_minus(&mut self) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Matches '-' lit | lit (cf. ast_validation::AstValidator::check_expr_within_pat). Keep this in sync with Token::can_begin_literal_maybe_minus.

pub(super) fn parse_block_expr(
    &mut self,
    opt_label: Option<Label>,
    lo: Span,
    blk_mode: BlockCheckMode,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a block or unsafe block.

fn recover_quantified_closure_expr(
    &mut self,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on an explicitly quantified closure expression, e.g., for<'a> |x: &'a u8| *x + 1.

fn parse_closure_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a closure expression (e.g., move |args| expr).

fn parse_capture_clause(&mut self) -> CaptureBy[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an optional move prefix to a closure-like construct.

fn parse_fn_block_decl(&mut self) -> PResult<'a, P<FnDecl>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the |arg, arg| header of a closure.

fn parse_fn_block_param(&mut self) -> PResult<'a, Param>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a parameter in a closure header (e.g., |arg, arg|).

fn parse_if_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an if expression (if token already eaten).

fn error_missing_if_cond(&self, lo: Span, span: Span) -> P<Block>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_cond_expr(&mut self) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the condition of a if or while expression.

fn parse_let_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a let $pat = $expr pseudo-expression. The let token has already been eaten.

fn parse_else_expr(&mut self) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an else { ... } expression (else token already eaten).

fn error_on_if_block_attrs(
    &self,
    ctx_span: Span,
    is_ctx_else: bool,
    branch_span: Span,
    attrs: &[Attribute]
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_for_expr(
    &mut self,
    opt_label: Option<Label>,
    lo: Span,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses for <src_pat> in <src_expr> <src_loop_block> (for token already eaten).

fn error_missing_in_for_loop(&self)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_while_expr(
    &mut self,
    opt_label: Option<Label>,
    lo: Span,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a while or while let expression (while token already eaten).

fn parse_loop_expr(
    &mut self,
    opt_label: Option<Label>,
    lo: Span,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses loop { ... } (loop token already eaten).

fn eat_label(&mut self) -> Option<Label>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_match_expr(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a match ... { ... } expression (match token already eaten).

pub(super) fn parse_arm(
    &mut self
) -> PResult<'a, Arm>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_try_block(
    &mut self,
    span_lo: Span,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a try {...} expression (try token already eaten).

fn is_do_catch_block(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn is_try_block(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_async_block(&mut self, attrs: AttrVec) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an async move? {...} expression.

fn is_async_block(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn is_certainly_not_a_block(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn maybe_parse_struct_expr(
    &mut self,
    path: &Path,
    attrs: &AttrVec
) -> Option<PResult<'a, P<Expr>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn error_struct_lit_not_allowed_here(&self, lo: Span, sp: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parse_struct_expr(
    &mut self,
    pth: Path,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn find_struct_error_after_field_looking_code(&self) -> Option<Field>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Use in case of error after field-looking code: S { foo: () with a }.

fn recover_struct_comma_after_dotdot(&mut self, span: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_field(&mut self) -> PResult<'a, Field>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses ident (COLON expr)?.

fn error_on_eq_field_init(&self, field_name: Ident)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Check for =. This means the source incorrectly attempts to initialize a field with an eq rather than a colon.

fn err_dotdotdot_syntax(&self, span: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn err_larrow_operator(&self, span: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_assign_op(&self, binop: BinOp, lhs: P<Expr>, rhs: P<Expr>) -> ExprKind[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_range(
    &self,
    start: Option<P<Expr>>,
    end: Option<P<Expr>>,
    limits: RangeLimits
) -> PResult<'a, ExprKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_unary(&self, unop: UnOp, expr: P<Expr>) -> ExprKind[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_binary(&self, binop: BinOp, lhs: P<Expr>, rhs: P<Expr>) -> ExprKind[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_index(&self, expr: P<Expr>, idx: P<Expr>) -> ExprKind[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_call(&self, f: P<Expr>, args: Vec<P<Expr>>) -> ExprKind[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_await_expr(&mut self, self_arg: P<Expr>, lo: Span) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(crate) fn mk_expr(
    &self,
    span: Span,
    kind: ExprKind,
    attrs: AttrVec
) -> P<Expr>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn mk_expr_err(
    &self,
    span: Span
) -> P<Expr>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a> Parser<'a>[src]

pub fn parse_crate_mod(&mut self) -> PResult<'a, Crate>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a source module as a crate. This is the main entry point for the parser.

fn parse_item_mod(
    &mut self,
    attrs: &mut Vec<Attribute>
) -> PResult<'a, (Ident, ItemKind)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a mod <foo> { ... } or mod <foo>; item.

pub fn parse_mod(
    &mut self,
    term: &TokenKind
) -> PResult<'a, (Mod, Vec<Attribute>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the contents of a module (inner attributes followed by module items).

fn parse_mod_items(
    &mut self,
    term: &TokenKind,
    inner_lo: Span
) -> PResult<'a, Mod>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Given a termination token, parses all of the items in a module.

impl<'a> Parser<'a>[src]

pub fn parse_item(&mut self) -> PResult<'a, Option<P<Item>>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_item_(
    &mut self,
    req_name: fn(_: Edition) -> bool
) -> PResult<'a, Option<Item>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parse_item_common(
    &mut self,
    attrs: Vec<Attribute>,
    mac_allowed: bool,
    attrs_allowed: bool,
    req_name: fn(_: Edition) -> bool
) -> PResult<'a, Option<Item>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_item_common_(
    &mut self,
    attrs: Vec<Attribute>,
    mac_allowed: bool,
    attrs_allowed: bool,
    req_name: fn(_: Edition) -> bool
) -> PResult<'a, Option<Item>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn error_on_unmatched_vis(&self, vis: &Visibility)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Error in-case a non-inherited visibility was parsed but no item followed.

fn error_on_unmatched_defaultness(&self, def: Defaultness)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Error in-case a default was parsed but no item followed.

fn error_on_unconsumed_default(&self, def: Defaultness, kind: &ItemKind)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Error in-case default was parsed in an in-appropriate context.

fn parse_item_kind(
    &mut self,
    attrs: &mut Vec<Attribute>,
    macros_allowed: bool,
    lo: Span,
    vis: &Visibility,
    def: &mut Defaultness,
    req_name: fn(_: Edition) -> bool
) -> PResult<'a, Option<(Ident, ItemKind)>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses one of the items allowed by the flags.

pub(super) fn is_path_start_item(
    &mut self
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

When parsing a statement, would the start of a path be an item?

fn isnt_macro_invocation(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Are we sure this could not possibly be a macro invocation?

fn recover_missing_kw_before_item(&mut self) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on encountering a struct or method definition where the user forgot to add the struct or fn keyword after writing pub: pub S {}.

fn parse_item_macro(&mut self, vis: &Visibility) -> PResult<'a, MacCall>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an item macro, e.g., item!();.

fn recover_attrs_no_item(&mut self, attrs: &[Attribute]) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover if we parsed attributes and expected an item but there was none.

fn is_async_fn(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_polarity(&mut self) -> ImplPolarity[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_item_impl(
    &mut self,
    attrs: &mut Vec<Attribute>,
    defaultness: Defaultness
) -> PResult<'a, (Ident, ItemKind)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an implementation item.

impl<'a, T> TYPE { /* impl items */ }
impl<'a, T> TRAIT for TYPE { /* impl items */ }
impl<'a, T> !TRAIT for TYPE { /* impl items */ }
impl<'a, T> const TRAIT for TYPE { /* impl items */ }

We actually parse slightly more relaxed grammar for better error reporting and recovery.

"impl" GENERICS "const"? "!"? TYPE "for"? (TYPE | "..") ("where" PREDICATES)? "{" BODY "}"
"impl" GENERICS "const"? "!"? TYPE ("where" PREDICATES)? "{" BODY "}"

fn parse_item_list<T>(
    &mut self,
    attrs: &mut Vec<Attribute>,
    parse_item: impl FnMut(&mut Parser<'a>) -> PResult<'a, Option<Option<T>>>
) -> PResult<'a, Vec<T>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_doc_comment_before_brace(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on a doc comment before }.

fn parse_defaultness(&mut self) -> Defaultness[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses defaultness (i.e., default or nothing).

fn check_auto_or_unsafe_trait_item(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Is this an (unsafe auto? | auto) trait item?

fn parse_item_trait(
    &mut self,
    attrs: &mut Vec<Attribute>,
    lo: Span
) -> PResult<'a, (Ident, ItemKind)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses unsafe? auto? trait Foo { ... } or trait Foo = Bar;.

pub fn parse_impl_item(&mut self) -> PResult<'a, Option<Option<P<AssocItem>>>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn parse_trait_item(&mut self) -> PResult<'a, Option<Option<P<AssocItem>>>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_assoc_item(
    &mut self,
    req_name: fn(_: Edition) -> bool
) -> PResult<'a, Option<Option<P<AssocItem>>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses associated items.

fn parse_type_alias(
    &mut self,
    def: Defaultness
) -> PResult<'a, (Ident, ItemKind)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a type alias with the following grammar:

TypeAlias = "type" Ident Generics {":" GenericBounds}? {"=" Ty}? ";" ;

The "type" has already been eaten.

fn parse_use_tree(&mut self) -> PResult<'a, UseTree>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a UseTree.

USE_TREE = [`::`] `*` |
           [`::`] `{` USE_TREE_LIST `}` |
           PATH `::` `*` |
           PATH `::` `{` USE_TREE_LIST `}` |
           PATH [`as` IDENT]

fn parse_use_tree_glob_or_nested(&mut self) -> PResult<'a, UseTreeKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses * or {...}.

fn parse_use_tree_list(&mut self) -> PResult<'a, Vec<(UseTree, NodeId)>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a UseTreeKind::Nested(list).

USE_TREE_LIST = Ø | (USE_TREE `,`)* USE_TREE [`,`]

fn parse_rename(&mut self) -> PResult<'a, Option<Ident>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_ident_or_underscore(&mut self) -> PResult<'a, Ident>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_item_extern_crate(&mut self) -> PResult<'a, (Ident, ItemKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses extern crate links.

Examples

extern crate foo;
extern crate bar as foo;

fn parse_crate_name_with_dashes(&mut self) -> PResult<'a, Ident>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_item_foreign_mod(
    &mut self,
    attrs: &mut Vec<Attribute>
) -> PResult<'a, (Ident, ItemKind)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses extern for foreign ABIs modules.

extern is expected to have been consumed before calling this method.

Examples

This example is not tested
extern "C" {}
extern {}

pub fn parse_foreign_item(
    &mut self
) -> PResult<'a, Option<Option<P<ForeignItem>>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a foreign item (one in an extern { ... } block).

fn error_bad_item_kind<T>(
    &self,
    span: Span,
    kind: &ItemKind,
    ctx: &str
) -> Option<T>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn error_on_foreign_const(&self, span: Span, ident: Ident)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn is_static_global(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_const_mut(&mut self, const_span: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on const mut with const already eaten.

fn parse_item_global(
    &mut self,
    m: Option<Mutability>
) -> PResult<'a, (Ident, P<Ty>, Option<P<Expr>>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse ["const" | ("static" "mut"?)] $ident ":" $ty (= $expr)? with ["const" | ("static" "mut"?)] already parsed and stored in m.

When m is "const", $ident may also be "_".

fn recover_missing_const_type(
    &mut self,
    id: Ident,
    m: Option<Mutability>
) -> P<Ty>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

We were supposed to parse : but the : was missing. This means that the type is missing.

fn parse_item_enum(&mut self) -> PResult<'a, (Ident, ItemKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an enum declaration.

fn parse_enum_variant(&mut self) -> PResult<'a, Option<Variant>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_item_struct(&mut self) -> PResult<'a, (Ident, ItemKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses struct Foo { ... }.

fn parse_item_union(&mut self) -> PResult<'a, (Ident, ItemKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses union Foo { ... }.

fn parse_record_struct_body(&mut self) -> PResult<'a, (Vec<StructField>, bool)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_tuple_struct_body(&mut self) -> PResult<'a, Vec<StructField>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_struct_decl_field(&mut self) -> PResult<'a, StructField>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an element of a struct declaration.

fn parse_single_struct_field(
    &mut self,
    lo: Span,
    vis: Visibility,
    attrs: Vec<Attribute>
) -> PResult<'a, StructField>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a structure field declaration.

fn parse_name_and_ty(
    &mut self,
    lo: Span,
    vis: Visibility,
    attrs: Vec<Attribute>
) -> PResult<'a, StructField>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a structure field.

fn parse_item_decl_macro(&mut self, lo: Span) -> PResult<'a, (Ident, ItemKind)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a declarative macro 2.0 definition. The macro keyword has already been parsed.

MacBody = "{" TOKEN_STREAM "}" ;
MacParams = "(" TOKEN_STREAM ")" ;
DeclMac = "macro" Ident MacParams? MacBody ;

fn is_macro_rules_item(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Is this unambiguously the start of a macro_rules! foo item defnition?

fn parse_item_macro_rules(
    &mut self,
    vis: &Visibility
) -> PResult<'a, (Ident, ItemKind)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a macro_rules! foo { ... } declarative macro.

fn complain_if_pub_macro(&self, vis: &Visibility, macro_rules: bool)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Item macro invocations or macro_rules! definitions need inherited visibility. If that's not the case, emit an error.

fn eat_semi_for_macro_if_needed(&mut self, args: &MacArgs)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn report_invalid_macro_expansion_item(&self, args: &MacArgs)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_nested_adt_item(&mut self, keyword: Symbol) -> PResult<'a, bool>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Checks if current token is one of tokens which cannot be nested like kw::Enum. In case it is, we try to parse the item and report error about nested types.

impl<'a> Parser<'a>[src]

Parsing of functions and methods.

fn parse_fn(
    &mut self,
    attrs: &mut Vec<Attribute>,
    req_name: fn(_: Edition) -> bool
) -> PResult<'a, (Ident, FnSig, Generics, Option<P<Block>>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a function starting from the front matter (const ...) to the body { ... } or ;.

fn parse_fn_body(
    &mut self,
    attrs: &mut Vec<Attribute>
) -> PResult<'a, Option<P<Block>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse the "body" of a function. This can either be ; when there's no body, or e.g. a block when the function is a provided one.

pub(super) fn check_fn_front_matter(
    &mut self
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Is the current token the start of an FnHeader / not a valid parse?

pub(super) fn parse_fn_front_matter(
    &mut self
) -> PResult<'a, FnHeader>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses all the "front matter" (or "qualifiers") for a fn declaration, up to and including the fn keyword. The formal grammar is:

Extern = "extern" StringLit ;
FnQual = "const"? "async"? "unsafe"? Extern? ;
FnFrontMatter = FnQual? "fn" ;

fn ban_async_in_2015(&self, span: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

We are parsing async fn. If we are on Rust 2015, emit an error.

pub(super) fn parse_fn_decl(
    &mut self,
    req_name: fn(_: Edition) -> bool,
    ret_allow_plus: AllowPlus
) -> PResult<'a, P<FnDecl>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the parameter list and result type of a function declaration.

fn parse_fn_params(
    &mut self,
    req_name: fn(_: Edition) -> bool
) -> PResult<'a, Vec<Param>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the parameter list of a function, including the ( and ) delimiters.

fn parse_param_general(
    &mut self,
    req_name: fn(_: Edition) -> bool,
    first_param: bool
) -> PResult<'a, Param>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a single function parameter.

  • self is syntactically allowed when first_param holds.

fn parse_self_param(&mut self) -> PResult<'a, Option<Param>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns the parsed optional self parameter and whether a self shortcut was used.

fn is_named_param(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_first_param(&mut self) -> &'static str[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a> Parser<'a>[src]

pub fn parse_pat(
    &mut self,
    expected: Option<&'static str>
) -> PResult<'a, P<Pat>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a pattern.

Corresponds to pat<no_top_alt> in RFC 2535 and does not admit or-patterns at the top level. Used when parsing the parameters of lambda expressions, functions, function pointers, and pat macro fragments.

pub(super) fn parse_top_pat(
    &mut self,
    gate_or: GateOr
) -> PResult<'a, P<Pat>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Entry point to the main pattern parser. Corresponds to top_pat in RFC 2535 and allows or-pattern at the top level.

pub(super) fn parse_fn_param_pat(
    &mut self
) -> PResult<'a, P<Pat>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse the pattern for a function or function pointer parameter. Special recovery is provided for or-patterns and leading |.

fn ban_illegal_fn_param_or_pat(&self, pat: &Pat)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Ban A | B immediately in a parameter pattern and suggest wrapping in parens.

fn parse_pat_with_or(
    &mut self,
    expected: Option<&'static str>,
    gate_or: GateOr,
    rc: RecoverComma
) -> PResult<'a, P<Pat>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a pattern, that may be a or-pattern (e.g. Foo | Bar in Some(Foo | Bar)). Corresponds to pat<allow_top_alt> in RFC 2535.

fn eat_or_separator(&mut self, lo: Option<Span>) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eat the or-pattern | separator. If instead a || token is encountered, recover and pretend we parsed |.

fn recover_trailing_vert(&mut self, lo: Option<Span>) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover if | or || is the current token and we have one of the tokens =>, if, =, :, ;, ,, ], ), or } ahead of us.

These tokens all indicate that we reached the end of the or-pattern list and can now reliably say that the | was an illegal trailing vert. Note that there are more tokens such as @ for which we know that the | is an illegal parse. However, the user's intent is less clear in that case.

fn ban_unexpected_or_or(&mut self, lo: Option<Span>)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

We have parsed || instead of |. Error and suggest | instead.

fn maybe_recover_unexpected_comma(
    &mut self,
    lo: Span,
    rc: RecoverComma
) -> PResult<'a, ()>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Some special error handling for the "top-level" patterns in a match arm, for loop, let, &c. (in contrast to subpatterns within such).

fn skip_pat_list(&mut self) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse and throw away a parentesized comma separated sequence of patterns until ) is reached.

fn parse_pat_with_or_inner(&mut self) -> PResult<'a, P<Pat>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recursive possibly-or-pattern parser with recovery for an erroneous leading |. See parse_pat_with_or for details on parsing or-patterns.

fn recover_leading_vert(&mut self, lo: Option<Span>, ctx: &str)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover if | or || is here. The user is thinking that a leading | is allowed in this position.

fn ban_illegal_vert(&mut self, lo: Option<Span>, pos: &str, ctx: &str)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

A | or possibly || token shouldn't be here. Ban it.

fn parse_pat_with_range_pat(
    &mut self,
    allow_range_pat: bool,
    expected: Option<&'static str>
) -> PResult<'a, P<Pat>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a pattern, with a setting whether modern range patterns (e.g., a..=b, a..b are allowed).

fn recover_dotdotdot_rest_pat(&mut self, lo: Span) -> PatKind[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover from a typoed ... pattern that was encountered Ref: Issue #70388

fn recover_intersection_pat(&mut self, lhs: P<Pat>) -> PResult<'a, P<Pat>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Try to recover the more general form intersect ::= $pat_lhs @ $pat_rhs.

Allowed binding patterns generated by binding ::= ref? mut? $ident @ $pat_rhs should already have been parsed by now at this point, if the next token is @ then we can try to parse the more general form.

Consult parse_pat_ident for the binding grammar.

The notion of intersection patterns are found in e.g. F# where they are called AND-patterns.

fn ban_pat_range_if_ambiguous(&self, pat: &Pat)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Ban a range pattern if it has an ambiguous interpretation.

fn parse_pat_deref(
    &mut self,
    expected: Option<&'static str>
) -> PResult<'a, PatKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse &pat / &mut pat.

fn recover_lifetime_in_deref_pat(&mut self)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_pat_tuple_or_parens(&mut self) -> PResult<'a, PatKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a tuple or parenthesis pattern.

fn parse_pat_ident_mut(&mut self) -> PResult<'a, PatKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a mutable binding with the mut token already eaten.

fn recover_mut_ref_ident(&mut self, lo: Span) -> PResult<'a, PatKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on mut ref? ident @ pat and suggest that the order of mut and ref is incorrect.

fn make_all_value_bindings_mutable(pat: &mut P<Pat>) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Turn all by-value immutable bindings in a pattern into mutable bindings. Returns true if any change was made.

fn ban_mut_general_pat(&self, lo: Span, pat: &Pat, changed_any_binding: bool)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Error on mut $pat where $pat is not an ident.

fn recover_additional_muts(&mut self)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eat any extraneous muts and error + recover if we ate any.

fn parse_pat_mac_invoc(&mut self, path: Path) -> PResult<'a, PatKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse macro invocation

fn fatal_unexpected_non_pat(
    &mut self,
    err: DiagnosticBuilder<'a>,
    expected: Option<&'static str>
) -> PResult<'a, P<Pat>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_range_end(&mut self) -> Option<Spanned<RangeEnd>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the range pattern end form ".." | "..." | "..=" ;.

fn parse_pat_range_begin_with(
    &mut self,
    begin: P<Expr>,
    re: Spanned<RangeEnd>
) -> PResult<'a, PatKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a range pattern $begin $form $end? where $form = ".." | "..." | "..=" ;. $begin $form has already been parsed.

pub(super) fn error_inclusive_range_with_no_end(
    &self,
    span: Span
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_pat_range_to(&mut self, re: Spanned<RangeEnd>) -> PResult<'a, PatKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a range-to pattern, ..X or ..=X where X remains to be parsed.

The form ...X is prohibited to reduce confusion with the potential expression syntax ...expr for splatting in expressions.

fn is_pat_range_end_start(&self, dist: usize) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Is the token dist away from the current suitable as the start of a range patterns end?

fn parse_pat_range_end(&mut self) -> PResult<'a, P<Expr>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn is_start_of_pat_with_path(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Is this the start of a pattern beginning with a path?

fn can_be_ident_pat(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Would parse_pat_ident be appropriate here?

fn parse_pat_ident(&mut self, binding_mode: BindingMode) -> PResult<'a, PatKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses ident or ident @ pat. Used by the copy foo and ref foo patterns to give a good error message when parsing mistakes like ref foo(a, b).

fn parse_pat_struct(
    &mut self,
    qself: Option<QSelf>,
    path: Path
) -> PResult<'a, PatKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a struct ("record") pattern (e.g. Foo { ... } or Foo::Bar { ... }).

fn parse_pat_tuple_struct(
    &mut self,
    qself: Option<QSelf>,
    path: Path
) -> PResult<'a, PatKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse tuple struct or tuple variant pattern (e.g. Foo(...) or Foo::Bar(...)).

fn error_qpath_before_pat(
    &mut self,
    path: &Path,
    token: &str
) -> PResult<'a, PatKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Error when there's a qualified path, e.g. <Foo as Bar>::Baz as the path of e.g., a tuple or record struct pattern.

fn parse_pat_fields(&mut self) -> PResult<'a, (Vec<FieldPat>, bool)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the fields of a struct-like pattern.

fn recover_one_fewer_dotdot(&self)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on ... as if it were .. to avoid further errors. See issue #46718.

fn parse_pat_field(
    &mut self,
    lo: Span,
    attrs: Vec<Attribute>
) -> PResult<'a, FieldPat>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn mk_pat_ident(
    &self,
    span: Span,
    bm: BindingMode,
    ident: Ident
) -> P<Pat>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_pat(&self, span: Span, kind: PatKind) -> P<Pat>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a> Parser<'a>[src]

pub(super) fn parse_qpath(
    &mut self,
    style: PathStyle
) -> PResult<'a, (QSelf, Path)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a qualified path. Assumes that the leading < has been parsed already.

qualified_path = <type [as trait_ref]>::path

Examples

<T>::default <T as U>::a <T as U>::F::a<S> (without disambiguator) <T as U>::F::a::<S> (with disambiguator)

fn recover_colon_before_qpath_proj(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover from an invalid single colon, when the user likely meant a qualified path. We avoid emitting this if not followed by an identifier, as our assumption that the user intended this to be a qualified path may not be correct.

This example is not tested
<Bar as Baz<T>>:Qux
               ^ help: use double colon

pub fn parse_path(&mut self, style: PathStyle) -> PResult<'a, Path>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses simple paths.

path = [::] segment+ segment = ident | ident[::]<args> | ident[::](args) [-> type]

Examples

a::b::C<D> (without disambiguator) a::b::C::<D> (with disambiguator) Fn(Args) (without disambiguator) Fn::(Args) (with disambiguator)

pub(super) fn parse_path_segments(
    &mut self,
    segments: &mut Vec<PathSegment>,
    style: PathStyle
) -> PResult<'a, ()>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parse_path_segment(
    &mut self,
    style: PathStyle
) -> PResult<'a, PathSegment>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parse_path_segment_ident(
    &mut self
) -> PResult<'a, Ident>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_angle_args_with_leading_angle_bracket_recovery(
    &mut self,
    style: PathStyle,
    lo: Span
) -> PResult<'a, Vec<AngleBracketedArg>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses generic args (within a path segment) with recovery for extra leading angle brackets. For the purposes of understanding the parsing logic of generic arguments, this function can be thought of being the same as just calling self.parse_angle_args() if the source had the correct amount of leading angle brackets.

This example is not tested
bar::<<<<T as Foo>::Output>();
     ^^ help: remove extra angle brackets

fn parse_angle_args(&mut self) -> PResult<'a, Vec<AngleBracketedArg>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses (possibly empty) list of generic arguments / associated item constraints, possibly including trailing comma.

fn parse_angle_arg(&mut self) -> PResult<'a, Option<AngleBracketedArg>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a single argument in the angle arguments <...> of a path segment.

fn parse_assoc_equality_term(
    &mut self,
    ident: Ident,
    eq: Span
) -> PResult<'a, P<Ty>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse the term to the right of an associated item equality constraint. That is, parse <term> in Item = <term>. Right now, this only admits types in <term>.

fn parse_generic_arg(&mut self) -> PResult<'a, Option<GenericArg>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a generic argument in a path segment. This does not include constraints, e.g., Item = u8, which is handled in parse_angle_arg.

impl<'a> Parser<'a>[src]

pub fn parse_ty(&mut self) -> PResult<'a, P<Ty>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a type.

pub(super) fn parse_ty_for_param(
    &mut self
) -> PResult<'a, P<Ty>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse a type suitable for a function or function pointer parameter. The difference from parse_ty is that this version allows ... (CVarArgs) at the top level of the the type.

pub(super) fn parse_ty_no_plus(
    &mut self
) -> PResult<'a, P<Ty>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a type in restricted contexts where + is not permitted.

Example 1: &'a TYPE + is prohibited to maintain operator priority (P(+) < P(&)). Example 2: value1 as TYPE + value2 + is prohibited to avoid interactions with expression grammar.

pub(super) fn parse_ret_ty(
    &mut self,
    allow_plus: AllowPlus,
    recover_qpath: RecoverQPath
) -> PResult<'a, FnRetTy>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an optional return type [ -> TY ] in a function declaration.

fn parse_ty_common(
    &mut self,
    allow_plus: AllowPlus,
    recover_qpath: RecoverQPath,
    allow_c_variadic: AllowCVariadic
) -> PResult<'a, P<Ty>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_ty_tuple_or_parens(
    &mut self,
    lo: Span,
    allow_plus: AllowPlus
) -> PResult<'a, TyKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses either:

  • (TYPE), a parenthesized type.
  • (TYPE,), a tuple with a single field of type TYPE.

fn parse_bare_trait_object(
    &mut self,
    lo: Span,
    allow_plus: AllowPlus
) -> PResult<'a, TyKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_remaining_bounds_path(
    &mut self,
    generic_params: Vec<GenericParam>,
    path: Path,
    lo: Span,
    parse_plus: bool
) -> PResult<'a, TyKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_remaining_bounds(
    &mut self,
    bounds: GenericBounds,
    plus: bool
) -> PResult<'a, TyKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parse the remainder of a bare trait object type given an already parsed list.

fn parse_ty_ptr(&mut self) -> PResult<'a, TyKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a raw pointer type: *[const | mut] $type.

fn parse_array_or_slice_ty(&mut self) -> PResult<'a, TyKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an array ([TYPE; EXPR]) or slice ([TYPE]) type. The opening [ bracket is already eaten.

fn parse_borrowed_pointee(&mut self) -> PResult<'a, TyKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_typeof_ty(&mut self) -> PResult<'a, TyKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_ty_bare_fn(
    &mut self,
    lo: Span,
    params: Vec<GenericParam>
) -> PResult<'a, TyKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a function pointer type (TyKind::BareFn).

[unsafe] [extern "ABI"] fn (S) -> T
 ^~~~~^          ^~~~^     ^~^    ^
   |               |        |     |
   |               |        |   Return type
Function Style    ABI  Parameter types

We actually parse FnHeader FnDecl, but we error on const and async qualifiers.

fn error_fn_ptr_bad_qualifier(&self, span: Span, qual_span: Span, qual: &str)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Emit an error for the given bad function pointer qualifier.

fn parse_impl_ty(&mut self, impl_dyn_multi: &mut bool) -> PResult<'a, TyKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an impl B0 + ... + Bn type.

fn is_explicit_dyn_type(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Is a dyn B0 + ... + Bn type allowed here?

fn parse_dyn_ty(&mut self, impl_dyn_multi: &mut bool) -> PResult<'a, TyKind>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a dyn B0 + ... + Bn type.

Note that this does not parse bare trait objects.

fn parse_path_start_ty(
    &mut self,
    lo: Span,
    allow_plus: AllowPlus
) -> PResult<'a, TyKind>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a type starting with a path.

This can be:

  1. a type macro, mac!(...),
  2. a bare trait object, B0 + ... + Bn,
  3. or a path, path::to::MyType.

fn error_illegal_c_varadic_ty(&self, lo: Span)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parse_generic_bounds(
    &mut self,
    colon_span: Option<Span>
) -> PResult<'a, GenericBounds>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_generic_bounds_common(
    &mut self,
    allow_plus: AllowPlus,
    colon_span: Option<Span>
) -> PResult<'a, GenericBounds>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses bounds of a type parameter BOUND + BOUND + ..., possibly with trailing +.

See parse_generic_bound for the BOUND grammar.

fn can_begin_bound(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Can the current token begin a bound?

fn error_negative_bounds(
    &self,
    colon_span: Option<Span>,
    bounds: &[GenericBound],
    negative_bounds: Vec<Span>
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_generic_bound(&mut self) -> PResult<'a, Result<GenericBound, Span>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a bound according to the grammar:

BOUND = TY_BOUND | LT_BOUND

fn parse_generic_lt_bound(
    &mut self,
    lo: Span,
    inner_lo: Span,
    has_parens: bool
) -> PResult<'a, GenericBound>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a lifetime ("outlives") bound, e.g. 'a, according to:

LT_BOUND = LIFETIME

fn error_lt_bound_with_modifiers(&self, modifiers: BoundModifiers)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Emits an error if any trait bound modifiers were present.

fn recover_paren_lifetime(
    &mut self,
    lo: Span,
    inner_lo: Span
) -> PResult<'a, ()>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recover on ('lifetime) with ( already eaten.

fn parse_ty_bound_modifiers(&mut self) -> BoundModifiers[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the modifiers that may precede a trait in a bound, e.g. ?Trait or ?const Trait.

If no modifiers are present, this does not consume any tokens.

TY_BOUND_MODIFIERS = "?" ["const" ["?"]]

fn parse_generic_ty_bound(
    &mut self,
    lo: Span,
    has_parens: bool,
    modifiers: BoundModifiers
) -> PResult<'a, GenericBound>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a type bound according to:

TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
TY_BOUND_NOPAREN = [TY_BOUND_MODIFIERS] [for<LT_PARAM_DEFS>] SIMPLE_PATH

For example, this grammar accepts ?const ?for<'a: 'b> m::Trait<'a>.

pub(super) fn parse_late_bound_lifetime_defs(
    &mut self
) -> PResult<'a, Vec<GenericParam>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Optionally parses for<$generic_params>.

pub fn check_lifetime(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn expect_lifetime(&mut self) -> Lifetime[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a single lifetime 'a or panics.

pub(super) fn mk_ty(
    &self,
    span: Span,
    kind: TyKind
) -> P<Ty>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a> Parser<'a>[src]

pub(super) fn span_fatal_err<S: Into<MultiSpan>>(
    &self,
    sp: S,
    err: Error
) -> DiagnosticBuilder<'a>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn struct_span_err<S: Into<MultiSpan>>(
    &self,
    sp: S,
    m: &str
) -> DiagnosticBuilder<'a>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn span_bug<S: Into<MultiSpan>>(&self, sp: S, m: &str) -> ![src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn diagnostic(
    &self
) -> &'a Handler
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn span_to_snippet(
    &self,
    span: Span
) -> Result<String, SpanSnippetError>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn expected_ident_found(
    &self
) -> DiagnosticBuilder<'a>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn expected_one_of_not_found(
    &mut self,
    edible: &[TokenKind],
    inedible: &[TokenKind]
) -> PResult<'a, bool>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn check_too_many_raw_str_terminators(
    &mut self,
    err: &mut DiagnosticBuilder
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn maybe_annotate_with_ascription(
    &mut self,
    err: &mut DiagnosticBuilder,
    maybe_expected_semicolon: bool
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn eat_to_tokens(
    &mut self,
    kets: &[&TokenKind]
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats and discards tokens until one of kets is encountered. Respects token trees, passes through any errors encountered. Used for error recovery.

pub(super) fn check_trailing_angle_brackets(
    &mut self,
    segment: &PathSegment,
    end: TokenKind
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

This function checks if there are trailing angle brackets and produces a diagnostic to suggest removing them.

This example is not tested
let _ = vec![1, 2, 3].into_iter().collect::<Vec<usize>>>>();
                                                       ^^ help: remove extra angle brackets

fn attempt_chained_comparison_suggestion(
    &mut self,
    err: &mut DiagnosticBuilder,
    inner_op: &Expr,
    outer_op: &Spanned<AssocOp>
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Check to see if a pair of chained operators looks like an attempt at chained comparison, e.g. 1 < x <= 3. If so, suggest either splitting the comparison into two, or parenthesising the leftmost comparison.

pub(super) fn check_no_chained_comparison(
    &mut self,
    inner_op: &Expr,
    outer_op: &Spanned<AssocOp>
) -> PResult<'a, Option<P<Expr>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Produces an error if comparison operators are chained (RFC #558). We only need to check the LHS, not the RHS, because all comparison ops have same precedence (see fn precedence) and are left-associative (see fn fixity).

This can also be hit if someone incorrectly writes foo<bar>() when they should have used the turbofish (foo::<bar>()) syntax. We attempt some heuristic recovery if that is the case.

Keep in mind that given that outer_op.is_comparison() holds and comparison ops are left associative we can infer that we have:

          outer_op
          /   \
    inner_op   r2
       /  \
     l1    r1

fn consume_fn_args(&mut self) -> Result<(), ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn maybe_report_ambiguous_plus(
    &mut self,
    allow_plus: AllowPlus,
    impl_dyn_multi: bool,
    ty: &Ty
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn maybe_recover_from_bad_type_plus(
    &mut self,
    allow_plus: AllowPlus,
    ty: &Ty
) -> PResult<'a, ()>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn maybe_recover_from_bad_qpath<T: RecoverQPath>(
    &mut self,
    base: P<T>,
    allow_recovery: bool
) -> PResult<'a, P<T>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Tries to recover from associated item paths like [T]::AssocItem / (T, U)::AssocItem. Attempts to convert the base expression/pattern/type into a type, parses the ::AssocItem tail, and combines them into a <Ty>::AssocItem expression/pattern/type.

pub(super) fn maybe_recover_from_bad_qpath_stage_2<T: RecoverQPath>(
    &mut self,
    ty_span: Span,
    ty: P<Ty>
) -> PResult<'a, P<T>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Given an already parsed Ty, parses the ::AssocItem tail and combines them into a <Ty>::AssocItem expression/pattern/type.

pub(super) fn maybe_consume_incorrect_semicolon(
    &mut self,
    items: &[P<Item>]
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn unexpected_try_recover(
    &mut self,
    t: &TokenKind
) -> PResult<'a, bool>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Creates a DiagnosticBuilder for an unexpected token t and tries to recover if it is a closing delimiter.

pub(super) fn expect_semi(
    &mut self
) -> PResult<'a, ()>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn recover_incorrect_await_syntax(
    &mut self,
    lo: Span,
    await_sp: Span,
    attrs: AttrVec
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Consumes alternative await syntaxes like await!(<expr>), await <expr>, await? <expr>, await(<expr>), and await { <expr> }.

fn recover_await_macro(&mut self) -> PResult<'a, (Span, P<Expr>, bool)>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn recover_await_prefix(
    &mut self,
    await_sp: Span
) -> PResult<'a, (Span, P<Expr>, bool)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn error_on_incorrect_await(
    &self,
    lo: Span,
    hi: Span,
    expr: &Expr,
    is_question: bool
) -> Span
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn recover_from_await_method_call(
    &mut self
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

If encountering future.await(), consumes and emits an error.

pub(super) fn try_macro_suggestion(
    &mut self
) -> PResult<'a, P<Expr>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn recover_parens_around_for_head(
    &mut self,
    pat: P<Pat>,
    expr: &Expr,
    begin_paren: Option<Span>
) -> P<Pat>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recovers a situation like for ( $pat in $expr ) and suggest writing for $pat in $expr instead.

This should be called before parsing the $block.

pub(super) fn could_ascription_be_path(
    &self,
    node: &ExprKind
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn recover_seq_parse_error(
    &mut self,
    delim: DelimToken,
    lo: Span,
    result: PResult<'a, P<Expr>>
) -> P<Expr>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn recover_closing_delimiter(
    &mut self,
    tokens: &[TokenKind],
    err: DiagnosticBuilder<'a>
) -> PResult<'a, bool>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn recover_stmt(
    &mut self
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats tokens until we can be relatively sure we reached the end of the statement. This is something of a best-effort heuristic.

We terminate when we find an unmatched } (without consuming it).

pub(super) fn recover_stmt_(
    &mut self,
    break_on_semi: SemiColonMode,
    break_on_block: BlockMode
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

If break_on_semi is Break, then we will stop consuming tokens after finding (and consuming) a ; outside of {} or [] (note that this is approximate -- it can mean we break too early due to macros, but that should only lead to sub-optimal recovery, not inaccurate parsing).

If break_on_block is Break, then we will stop consuming tokens after finding (and consuming) a brace-delimited block.

pub(super) fn check_for_for_in_in_typo(
    &mut self,
    in_span: Span
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn expected_semi_or_open_brace<T>(
    &mut self
) -> PResult<'a, T>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn eat_incorrect_doc_comment_for_param_type(
    &mut self
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parameter_without_type(
    &mut self,
    err: &mut DiagnosticBuilder,
    pat: P<Pat>,
    require_name: bool,
    first_param: bool
) -> Option<Ident>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn recover_arg_parse(
    &mut self
) -> PResult<'a, (P<Pat>, P<Ty>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn recover_bad_self_param(
    &mut self,
    param: Param
) -> PResult<'a, Param>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn consume_block(
    &mut self,
    delim: DelimToken,
    consume_close: ConsumeClosingDelim
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn expected_expression_found(
    &self
) -> DiagnosticBuilder<'a>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn consume_tts(&mut self, acc: i64, modifier: &[(TokenKind, i64)])[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn deduplicate_recovered_params_names(
    &self,
    fn_inputs: &mut Vec<Param>
)
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Replace duplicated recovered parameters with _ pattern to avoid unnecessary errors.

This is necessary because at this point we don't know whether we parsed a function with anonymous parameters or a function with names but no types. In order to minimize unnecessary errors, we assume the parameters are in the shape of fn foo(a, b, c) where the parameters are names (so we don't emit errors about not being able to find b in the local scope), but if we find the same name multiple times, like in fn foo(i8, i8), we deduplicate them to not complain about duplicated parameter names.

impl<'a> Parser<'a>[src]

fn parse_lt_param_bounds(&mut self) -> GenericBounds[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses bounds of a lifetime parameter BOUND + BOUND + BOUND, possibly with trailing +.

BOUND = LT_BOUND (e.g., `'a`)

fn parse_ty_param(
    &mut self,
    preceding_attrs: Vec<Attribute>
) -> PResult<'a, GenericParam>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Matches typaram = IDENT (? unbound)? optbounds ( EQ ty )?.

fn parse_const_param(
    &mut self,
    preceding_attrs: Vec<Attribute>
) -> PResult<'a, GenericParam>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parse_generic_params(
    &mut self
) -> PResult<'a, Vec<GenericParam>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a (possibly empty) list of lifetime and type parameters, possibly including a trailing comma and erroneous trailing attributes.

pub(super) fn parse_generics(
    &mut self
) -> PResult<'a, Generics>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a set of optional generic type parameter declarations. Where clauses are not parsed here, and must be added later via parse_where_clause().

matches generics = ( ) | ( < > ) | ( < typaramseq ( , )? > ) | ( < lifetimes ( , )? > ) | ( < lifetimes , typaramseq ( , )? > ) where typaramseq = ( typaram ) | ( typaram , typaramseq )

pub(super) fn parse_where_clause(
    &mut self
) -> PResult<'a, WhereClause>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses an optional where-clause and places it in generics.

This example is not tested
where T : Trait<U, V> + 'b, 'a : 'b

fn parse_ty_where_predicate(&mut self) -> PResult<'a, WherePredicate>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn choose_generics_over_qpath(
    &self,
    start: usize
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a> Parser<'a>[src]

pub fn parse_stmt(&mut self) -> PResult<'a, Option<Stmt>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a statement. This stops just before trailing semicolons on everything but items. e.g., a StmtKind::Semi parses to a StmtKind::Expr, leaving the trailing ; unconsumed.

fn parse_stmt_without_recovery(&mut self) -> PResult<'a, Option<Stmt>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_stmt_path_start(
    &mut self,
    lo: Span,
    attrs: Vec<Attribute>
) -> PResult<'a, Stmt>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_stmt_mac(
    &mut self,
    lo: Span,
    attrs: AttrVec,
    path: Path
) -> PResult<'a, Stmt>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a statement macro mac!(args) provided a path representing mac. At this point, the ! token after the path has already been eaten.

fn error_outer_attrs(&self, attrs: &[Attribute])[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Error on outer attributes in this context. Also error if the previous token was a doc comment.

fn recover_stmt_local(
    &mut self,
    lo: Span,
    attrs: AttrVec,
    msg: &str,
    sugg: &str
) -> PResult<'a, Stmt>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_local_mk(&mut self, lo: Span, attrs: AttrVec) -> PResult<'a, Stmt>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_local(&mut self, attrs: AttrVec) -> PResult<'a, P<Local>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a local variable declaration.

fn parse_initializer(
    &mut self,
    eq_optional: bool
) -> PResult<'a, Option<P<Expr>>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the RHS of a local variable declaration (e.g., '= 14;').

pub fn parse_block(&mut self) -> PResult<'a, P<Block>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a block. No inner attributes are allowed.

fn error_block_no_opening_brace<T>(&mut self) -> PResult<'a, T>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn parse_inner_attrs_and_block(
    &mut self
) -> PResult<'a, (Vec<Attribute>, P<Block>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a block. Inner attributes are allowed.

pub(super) fn parse_block_common(
    &mut self,
    lo: Span,
    blk_mode: BlockCheckMode
) -> PResult<'a, (Vec<Attribute>, P<Block>)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a block. Inner attributes are allowed.

fn parse_block_tail(
    &mut self,
    lo: Span,
    s: BlockCheckMode
) -> PResult<'a, P<Block>>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses the rest of a block expression or function body. Precondition: already parsed the '{'.

pub fn parse_full_stmt(&mut self) -> PResult<'a, Option<Stmt>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a statement, including the trailing semicolon.

pub(super) fn mk_block(
    &self,
    stmts: Vec<Stmt>,
    rules: BlockCheckMode,
    span: Span
) -> P<Block>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn mk_stmt(
    &self,
    span: Span,
    kind: StmtKind
) -> Stmt
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn mk_stmt_err(&self, span: Span) -> Stmt[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(super) fn mk_block_err(
    &self,
    span: Span
) -> P<Block>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<'a> Parser<'a>[src]

pub fn new(
    sess: &'a ParseSess,
    tokens: TokenStream,
    desugar_doc_comments: bool,
    subparser_name: Option<&'static str>
) -> Self
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn next_tok(&mut self, fallback_span: Span) -> Token[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub(crate) fn unexpected<T>(&mut self) -> PResult<'a, T>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn expect(&mut self, t: &TokenKind) -> PResult<'a, bool>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Expects and consumes the token t. Signals an error if the next token is not t.

pub fn expect_one_of(
    &mut self,
    edible: &[TokenKind],
    inedible: &[TokenKind]
) -> PResult<'a, bool>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Expect next token to be edible or inedible token. If edible, then consume it; if inedible, then return without consuming anything. Signal a fatal error if next token is unexpected.

pub fn parse_ident(&mut self) -> PResult<'a, Ident>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_ident_common(&mut self, recover: bool) -> PResult<'a, Ident>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn check(&mut self, tok: &TokenKind) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Checks if the next token is tok, and returns true if so.

This method will automatically add tok to expected_tokens if tok is not encountered.

pub fn eat(&mut self, tok: &TokenKind) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Consumes a token 'tok' if it exists. Returns whether the given token was present.

fn check_keyword(&mut self, kw: Symbol) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

If the next token is the given keyword, returns true without eating it. An expectation is also added for diagnostics purposes.

pub fn eat_keyword(&mut self, kw: Symbol) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

If the next token is the given keyword, eats it and returns true. Otherwise, returns false. An expectation is also added for diagnostics purposes.

fn eat_keyword_noexpect(&mut self, kw: Symbol) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn expect_keyword(&mut self, kw: Symbol) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

If the given word is not a keyword, signals an error. If the next token is not the given word, signals an error. Otherwise, eats it.

fn is_kw_followed_by_ident(&self, kw: Symbol) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Is the given keyword kw followed by a non-reserved identifier?

fn check_or_expected(&mut self, ok: bool, typ: TokenType) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn check_ident(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn check_path(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn check_type(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn check_const_arg(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn check_plus(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Checks to see if the next token is either + or +=. Otherwise returns false.

fn break_and_eat(&mut self, expected: TokenKind) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats the expected token if it's present possibly breaking compound tokens like multi-character operators in process. Returns true if the token was eaten.

fn eat_plus(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats + possibly breaking tokens like += in process.

fn expect_and(&mut self) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats & possibly breaking tokens like && in process. Signals an error if & is not eaten.

fn expect_or(&mut self) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats | possibly breaking tokens like || in process. Signals an error if | was not eaten.

fn eat_lt(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats < possibly breaking tokens like << in process.

fn expect_lt(&mut self) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats < possibly breaking tokens like << in process. Signals an error if < was not eaten.

fn expect_gt(&mut self) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Eats > possibly breaking tokens like >> in process. Signals an error if > was not eaten.

fn expect_any_with_type(
    &mut self,
    kets: &[&TokenKind],
    expect: TokenExpectType
) -> bool
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_seq_to_before_tokens<T>(
    &mut self,
    kets: &[&TokenKind],
    sep: SeqSep,
    expect: TokenExpectType,
    f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>
) -> PResult<'a, (Vec<T>, bool, bool)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_seq_to_before_end<T>(
    &mut self,
    ket: &TokenKind,
    sep: SeqSep,
    f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>
) -> PResult<'a, (Vec<T>, bool, bool)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a sequence, not including the closing delimiter. The function f must consume tokens until reaching the next separator or closing bracket.

fn parse_seq_to_end<T>(
    &mut self,
    ket: &TokenKind,
    sep: SeqSep,
    f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>
) -> PResult<'a, (Vec<T>, bool)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a sequence, including the closing delimiter. The function f must consume tokens until reaching the next separator or closing bracket.

fn parse_unspanned_seq<T>(
    &mut self,
    bra: &TokenKind,
    ket: &TokenKind,
    sep: SeqSep,
    f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>
) -> PResult<'a, (Vec<T>, bool)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a sequence, including the closing delimiter. The function f must consume tokens until reaching the next separator or closing bracket.

fn parse_delim_comma_seq<T>(
    &mut self,
    delim: DelimToken,
    f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>
) -> PResult<'a, (Vec<T>, bool)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_paren_comma_seq<T>(
    &mut self,
    f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>
) -> PResult<'a, (Vec<T>, bool)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn bump_with(&mut self, next_token: Token)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Advance the parser by one token using provided token as the next one.

pub fn bump(&mut self)[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Advance the parser by one token.

pub fn look_ahead<R>(&self, dist: usize, looker: impl FnOnce(&Token) -> R) -> R[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Look-ahead dist tokens of self.token and get access to that token there. When dist == 0 then the current token is looked at.

fn is_keyword_ahead(&self, dist: usize, kws: &[Symbol]) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Returns whether any of the given keywords are dist tokens ahead of the current one.

fn parse_asyncness(&mut self) -> Async[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses asyncness: async or nothing.

fn parse_unsafety(&mut self) -> Unsafe[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses unsafety: unsafe or nothing.

fn parse_constness(&mut self) -> Const[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses constness: const or nothing.

fn parse_mutability(&mut self) -> Mutability[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses mutability (mut or nothing).

fn parse_const_or_mut(&mut self) -> Option<Mutability>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Possibly parses mutability (const or mut).

fn parse_field_name(&mut self) -> PResult<'a, Ident>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_mac_args(&mut self) -> PResult<'a, P<MacArgs>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_attr_args(&mut self) -> PResult<'a, MacArgs>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_mac_args_common(
    &mut self,
    delimited_only: bool
) -> PResult<'a, MacArgs>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn parse_or_use_outer_attributes(
    &mut self,
    already_parsed_attrs: Option<AttrVec>
) -> PResult<'a, AttrVec>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn parse_token_tree(&mut self) -> TokenTree[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a single token tree from the input.

pub fn parse_all_token_trees(&mut self) -> PResult<'a, Vec<TokenTree>>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a stream of tokens into a list of TokenTrees, up to EOF.

pub fn parse_tokens(&mut self) -> TokenStream[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn with_res<T>(
    &mut self,
    res: Restrictions,
    f: impl FnOnce(&mut Self) -> T
) -> T
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Evaluates the closure with restrictions in place.

Afters the closure is evaluated, restrictions are reset.

fn is_crate_vis(&self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

pub fn parse_visibility(
    &mut self,
    fbt: FollowedByType
) -> PResult<'a, Visibility>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses pub, pub(crate) and pub(in path) plus shortcuts crate for pub(crate), pub(self) for pub(in self) and pub(super) for pub(in super). If the following element can't be a tuple (i.e., it's a function definition), then it's not a tuple struct field), and the contents within the parentheses isn't valid, so emit a proper diagnostic.

fn recover_incorrect_vis_restriction(&mut self) -> PResult<'a, ()>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Recovery for e.g. pub(something) fn ... or struct X { pub(something) y: Z }

fn parse_extern(&mut self) -> PResult<'a, Extern>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses extern string_literal?.

fn parse_abi(&mut self) -> Option<StrLit>[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Parses a string literal as an ABI spec.

pub fn collect_tokens<R>(
    &mut self,
    f: impl FnOnce(&mut Self) -> PResult<'a, R>
) -> PResult<'a, (R, TokenStream)>
[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Records all tokens consumed by the provided callback, including the current token. These tokens are collected into a TokenStream, and returned along with the result of the callback.

Note: If your callback consumes an opening delimiter (including the case where you call collect_tokens when the current token is an opening delimeter), you must also consume the corresponding closing delimiter.

That is, you can consume something ([{ }]) or ([{}]), but not ([{}]

This restriction shouldn't be an issue in practice, since this function is used to record the tokens for a parsed AST item, which always has matching delimiters.

fn is_import_coupler(&mut self) -> bool[src]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

::{ or ::*

Trait Implementations

impl<'a> Clone for Parser<'a>[src]

impl<'a> Drop for Parser<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Parser<'a>

impl<'a> !Send for Parser<'a>

impl<'a> !Sync for Parser<'a>

impl<'a> Unpin for Parser<'a>

impl<'a> !UnwindSafe for Parser<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> MaybeResult<T> for T[src]

type Error = !

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

impl<T> Same<T> for T

type Output = T

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Should always be Self

impl<E> SpecializationError for E[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.