[][src]Struct syntax::parse::parser::Parser

pub struct Parser<'a> {
    pub sess: &'a ParseSess,
    pub token: Token,
    pub span: Span,
    meta_var_span: Option<Span>,
    pub prev_span: Span,
    prev_token_kind: PrevTokenKind,
    restrictions: Restrictions,
    pub(crate) directory: Directory<'a>,
    pub recurse_into_file_modules: bool,
    pub root_module_name: Option<String>,
    pub(crate) expected_tokens: Vec<TokenType>,
    pub(crate) token_cursor: TokenCursor,
    desugar_doc_comments: bool,
    pub cfg_mods: bool,
    pub(crate) unmatched_angle_bracket_count: u32,
    pub(crate) max_angle_bracket_count: u32,
    pub(crate) unclosed_delims: Vec<UnmatchedBrace>,
    pub(crate) last_unexpected_token_span: Option<Span>,
    pub(crate) 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:

span: 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.

the span of the current token:

meta_var_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.

the span of the previous token:

prev_span: 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.

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 kind

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.

directory: Directory<'a>
⚙️ This is an internal compiler API. (rustc_private)

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

Used to determine the path to externally loaded source files

recurse_into_file_modules: 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.

Whether to parse sub-modules in other files.

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

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

Name of the root module this parser originated from. If None, then the name is not known. This does not change while the parser is descending into modules, and sub-parsers have new values for this name.

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.

cfg_mods: 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.

Whether we should configure out of line modules as we parse.

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.

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.

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.

Methods

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

pub fn new(
    sess: &'a ParseSess,
    tokens: TokenStream,
    directory: Option<Directory<'a>>,
    recurse_into_file_modules: bool,
    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) -> TokenAndSpan[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 this_token_to_string(&self) -> String[src]

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

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

Converts the current token to a string using self's reader.

pub(crate) fn token_descr(&self) -> Option<&'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.

pub(crate) fn this_token_descr(&self) -> String[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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: &Token) -> 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: &[Token],
    inedible: &[Token]
) -> 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.

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.

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.

pub(crate) fn check(&mut self, tok: &Token) -> 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: &Token) -> 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.

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.

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.

pub(crate) 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 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.

Expects and consumes a +. if += is seen, replaces it with a = and continues. If a + is not seen, returns false.

This is used when token-splitting += into +. See issue #47856 for an example of when this may occur.

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 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.

Expects and consumes an &. If && is seen, replaces it with a single & and continues. If an & is not seen, signals an error.

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.

Expects and consumes an |. If || is seen, replaces it with a single | and continues. If an | is not seen, signals an error.

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

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 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.

Attempts to consume a <. If << is seen, replaces it with a single < and continue. If <- is seen, replaces it with a single < and continue. If a < is not seen, returns false.

This is meant to be used when parsing generics on a path to get the starting token.

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.

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.

Expects and consumes a single > token. if a >> is seen, replaces it with a single > and continues. If a > is not seen, signals an error.

pub fn parse_seq_to_end<T, F>(
    &mut self,
    ket: &Token,
    sep: SeqSep,
    f: F
) -> PResult<'a, Vec<T>> where
    F: FnMut(&mut Parser<'a>) -> 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.

Parses a sequence, including the closing delimiter. The function f must consume tokens until reaching the next separator or closing bracket.

pub fn parse_seq_to_before_end<T, F>(
    &mut self,
    ket: &Token,
    sep: SeqSep,
    f: F
) -> PResult<'a, (Vec<T>, bool)> where
    F: FnMut(&mut Parser<'a>) -> 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.

Parses a sequence, not including the closing delimiter. The function f must consume tokens until reaching the next separator or closing bracket.

pub(crate) fn parse_seq_to_before_tokens<T, F>(
    &mut self,
    kets: &[&Token],
    sep: SeqSep,
    expect: TokenExpectType,
    f: F
) -> PResult<'a, (Vec<T>, bool)> where
    F: FnMut(&mut Parser<'a>) -> 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.

fn parse_unspanned_seq<T, F>(
    &mut self,
    bra: &Token,
    ket: &Token,
    sep: SeqSep,
    f: F
) -> PResult<'a, Vec<T>> where
    F: FnMut(&mut Parser<'a>) -> 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.

Parses a sequence, including the closing delimiter. The function f must consume tokens until reaching the next separator or closing bracket.

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

fn bump_with(&mut self, next: Token, 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.

Advance the parser using provided token as a next one. Use this when consuming a part of a token. For example a single < from <<.

pub fn look_ahead<R, F>(&self, dist: usize, f: F) -> R where
    F: FnOnce(&Token) -> 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.

pub(crate) fn look_ahead_span(&self, dist: usize) -> 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 token_is_bare_fn_keyword(&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 one of the keywords that signals a bare function type?

fn parse_ty_bare_fn(
    &mut self,
    generic_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 TyKind::BareFn type.

fn parse_asyncness(&mut self) -> IsAsync[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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) -> Unsafety[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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.

pub fn parse_trait_item(&mut self, at_end: &mut bool) -> PResult<'a, TraitItem>[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 items in a trait declaration.

fn parse_trait_item_(
    &mut self,
    at_end: &mut bool,
    attrs: Vec<Attribute>
) -> PResult<'a, TraitItem>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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_ret_ty(&mut self, allow_plus: bool) -> PResult<'a, FunctionRetTy>[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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.

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.

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.

fn parse_ty_common(
    &mut self,
    allow_plus: bool,
    allow_qpath_recovery: bool,
    allow_c_variadic: bool
) -> 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_remaining_bounds(
    &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_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_ptr(&mut self) -> PResult<'a, MutTy>[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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_named_argument(&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_arg_general(
    &mut self,
    require_name: bool,
    is_trait_item: bool,
    allow_c_variadic: bool
) -> PResult<'a, Arg>
[src]

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

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

Skips unexpected attributes and doc comments in this position and emits an appropriate error. This version of parse arg doesn't necessarily require identifier names.

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

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 argument in a lambda header (e.g., |arg, arg|).

fn maybe_parse_fixed_length_of_vec(&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.

pub(crate) 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).

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_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_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)

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 fn parse_path_allowing_meta(
    &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.

Like parse_path, but also supports parsing Word meta items into paths for backwards-compatibility. This is used when parsing derive macro paths in #[derive] attributes.

pub(crate) 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.

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(crate) 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(crate) 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.

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_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_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_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.

Parse ident (COLON expr)?

pub(crate) fn mk_expr(
    &self,
    span: Span,
    node: ExprKind,
    attrs: ThinVec<Attribute>
) -> 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 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_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_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_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_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 expect_delimited_token_tree(
    &mut self
) -> PResult<'a, (MacDelimiter, 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 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 parse_await_macro_or_alt(
    &mut self,
    lo: Span,
    await_sp: 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 await!(<expr>) calls, or alternatively recover from incorrect but reasonable alternative syntaxes await <expr>, await? <expr>, await(<expr>) and await { <expr> }.

fn maybe_parse_struct_expr(
    &mut self,
    lo: Span,
    path: &Path,
    attrs: &ThinVec<Attribute>
) -> 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 parse_struct_expr(
    &mut self,
    lo: Span,
    pth: Path,
    attrs: ThinVec<Attribute>
) -> 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_or_use_outer_attributes(
    &mut self,
    already_parsed_attrs: Option<ThinVec<Attribute>>
) -> PResult<'a, ThinVec<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(crate) fn parse_block_expr(
    &mut self,
    opt_label: Option<Label>,
    lo: Span,
    blk_mode: BlockCheckMode,
    outer_attrs: ThinVec<Attribute>
) -> 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 parse_dot_or_call_expr(
    &mut self,
    already_parsed_attrs: Option<ThinVec<Attribute>>
) -> 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.

fn parse_dot_or_call_expr_with(
    &mut self,
    e0: P<Expr>,
    lo: Span,
    attrs: ThinVec<Attribute>
) -> 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(
    &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.

fn parse_dot_or_call_expr_with_(
    &mut self,
    e0: 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 process_potential_macro_variable(&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(crate) 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.

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 parse_prefix_expr(
    &mut self,
    already_parsed_attrs: Option<ThinVec<Attribute>>
) -> 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 a prefix-unary-operator expr

fn parse_assoc_expr(
    &mut self,
    already_parsed_attrs: Option<ThinVec<Attribute>>
) -> 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.

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 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_prefix_range_expr(
    &mut self,
    already_parsed_attrs: Option<ThinVec<Attribute>>
) -> 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 prefix-forms of range notation: ..expr, .., ..=expr

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_if_expr(&mut self, attrs: ThinVec<Attribute>) -> 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 or if let expression (if token already eaten).

fn parse_if_let_expr(
    &mut self,
    attrs: ThinVec<Attribute>
) -> 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 let expression (if token already eaten).

fn parse_lambda_expr(
    &mut self,
    attrs: ThinVec<Attribute>
) -> 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 move |args| expr.

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.

fn parse_for_expr(
    &mut self,
    opt_label: Option<Label>,
    span_lo: Span,
    attrs: ThinVec<Attribute>
) -> 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 a 'for' .. 'in' expression ('for' token already eaten)

fn parse_while_expr(
    &mut self,
    opt_label: Option<Label>,
    span_lo: Span,
    attrs: ThinVec<Attribute>
) -> 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_while_let_expr(
    &mut self,
    opt_label: Option<Label>,
    span_lo: Span,
    attrs: ThinVec<Attribute>
) -> 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 let expression (while token already eaten).

fn parse_loop_expr(
    &mut self,
    opt_label: Option<Label>,
    span_lo: Span,
    attrs: ThinVec<Attribute>
) -> 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 fn parse_async_block(
    &mut self,
    attrs: ThinVec<Attribute>
) -> 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 parse_try_block(
    &mut self,
    span_lo: Span,
    attrs: ThinVec<Attribute>
) -> 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 parse_match_expr(
    &mut self,
    attrs: ThinVec<Attribute>
) -> 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 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.

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.

fn with_res<F, T>(&mut self, r: Restrictions, f: F) -> T where
    F: FnOnce(&mut Self) -> 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 parse_expr_res(
    &mut self,
    r: Restrictions,
    already_parsed_attrs: Option<ThinVec<Attribute>>
) -> 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_initializer(&mut self, skip_eq: 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;').

fn parse_pats(&mut self) -> PResult<'a, Vec<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 patterns, separated by '|' s.

fn parse_parenthesized_pat_list(
    &mut self
) -> PResult<'a, (Vec<P<Pat>>, Option<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.

fn parse_pat_list(&mut self) -> PResult<'a, (Vec<P<Pat>>, Option<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.

fn parse_pat_vec_elements(
    &mut self
) -> PResult<'a, (Vec<P<Pat>>, Option<P<Pat>>, Vec<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_pat_field(
    &mut self,
    lo: Span,
    attrs: Vec<Attribute>
) -> PResult<'a, Spanned<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.

fn parse_pat_fields(&mut self) -> PResult<'a, (Vec<Spanned<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 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 parse_as_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 parse_top_level_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.

A wrapper around parse_pat with some special error handling for the "top-level" patterns in a match arm, for loop, let, &c. (in contrast to subpatterns within such).

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.

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 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_local(&mut self, attrs: ThinVec<Attribute>) -> 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_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 expected_item_err(&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.

Emits an expected-item-after-attributes error.

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.

Parse 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_(&mut self, macro_legacy_warnings: bool) -> 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 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_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 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 is_union_item(&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_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.

fn is_existential_type_decl(&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_auto_trait_item(&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 eat_macro_def(
    &mut self,
    attrs: &[Attribute],
    vis: &Visibility,
    lo: Span
) -> 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_stmt_without_recovery(
    &mut self,
    macro_legacy_warnings: bool
) -> 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 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.

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 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.

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(crate) fn parse_full_stmt(
    &mut self,
    macro_legacy_warnings: bool
) -> 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.

fn warn_missing_semicolon(&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 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 parse_generic_bounds_common(
    &mut self,
    allow_plus: bool,
    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 +.

BOUND = TY_BOUND | LT_BOUND
LT_BOUND = LIFETIME (e.g., `'a`)
TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
TY_BOUND_NOPAREN = [?] [for] SIMPLE_PATH (e.g., `?for<'a: 'b> m::Trait<'a>`)

pub(crate) 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_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_trait_item_assoc_ty(
    &mut self
) -> PResult<'a, (Ident, TraitItemKind, 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 the following grammar:

TraitItemAssocTy = Ident ["<"...">"] [":" [GenericBounds]] ["where" ...] ["=" 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(crate) 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.

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 )

fn parse_generic_args_with_leaning_angle_bracket_recovery(
    &mut self,
    style: PathStyle,
    lo: Span
) -> PResult<'a, (Vec<GenericArg>, Vec<TypeBinding>)>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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_generic_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_generic_args(
    &mut self
) -> PResult<'a, (Vec<GenericArg>, Vec<TypeBinding>)>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 lifetime and type arguments and associated type bindings, possibly including trailing comma.

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_fn_args(
    &mut self,
    named_args: bool,
    allow_c_variadic: bool
) -> PResult<'a, (Vec<Arg>, 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_fn_decl(&mut self, allow_c_variadic: bool) -> 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 argument list and result type of a function declaration.

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

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 argument and whether a self shortcut was used.

fn parse_fn_decl_with_self<F>(
    &mut self,
    parse_arg_fn: F
) -> PResult<'a, P<FnDecl>> where
    F: FnMut(&mut Parser<'a>) -> PResult<'a, Arg>, 
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 that may have a self parameter.

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_header(&mut self) -> PResult<'a, (Ident, 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 the name and optional generic types of a function header.

fn mk_item(
    &self,
    span: Span,
    ident: Ident,
    node: ItemKind,
    vis: Visibility,
    attrs: Vec<Attribute>
) -> 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_fn(
    &mut self,
    unsafety: Unsafety,
    asyncness: Spanned<IsAsync>,
    constness: Spanned<Constness>,
    abi: Abi
) -> PResult<'a, (Ident, ItemKind, Option<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 an item-position function declaration.

fn is_const_item(&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.

Returns true if we are looking at const ID (returns false for things like const fn, etc.).

fn parse_fn_front_matter(
    &mut self
) -> PResult<'a, (Spanned<Constness>, Unsafety, Spanned<IsAsync>, Abi)>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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" for a fn declaration, up to and including the fn keyword:

  • const fn
  • unsafe fn
  • const unsafe fn
  • extern fn
  • etc.

pub fn parse_impl_item(&mut self, at_end: &mut bool) -> PResult<'a, ImplItem>[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 item.

fn parse_impl_item_(
    &mut self,
    at_end: &mut bool,
    attrs: Vec<Attribute>
) -> PResult<'a, ImplItem>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 complain_if_pub_macro(&self, vis: &VisibilityKind, 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.

fn missing_assoc_item_kind_err(
    &self,
    item_type: &str,
    prev_span: Span
) -> 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 parse_impl_method(
    &mut self,
    vis: &Visibility,
    at_end: &mut bool
) -> PResult<'a, (Ident, Vec<Attribute>, Generics, ImplItemKind)>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 method or a macro invocation in a trait impl.

fn parse_item_trait(
    &mut self,
    is_auto: IsAuto,
    unsafety: Unsafety
) -> PResult<'a, (Ident, ItemKind, Option<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 trait Foo { ... } or trait Foo = Bar;.

fn choose_generics_over_qpath(&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_impl_body(&mut self) -> PResult<'a, (Vec<ImplItem>, 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.

fn parse_item_impl(
    &mut self,
    unsafety: Unsafety,
    defaultness: Defaultness
) -> PResult<'a, (Ident, ItemKind, Option<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 an implementation item, impl keyword is already parsed.

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

We actually parse slightly more relaxed grammar for better error reporting and recovery. impl GENERICS !? TYPE for? (TYPE | ..) (where PREDICATES)? { BODY } impl GENERICS !? TYPE (where PREDICATES)? { BODY }

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.

fn parse_item_struct(
    &mut self
) -> PResult<'a, (Ident, ItemKind, Option<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 struct Foo { ... }.

fn parse_item_union(
    &mut self
) -> PResult<'a, (Ident, ItemKind, Option<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 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_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_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.

pub fn parse_visibility(
    &mut self,
    can_take_tuple: bool
) -> 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 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 parse_mod_items(&mut self, term: &Token, 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.

fn parse_item_const(
    &mut self,
    m: Option<Mutability>
) -> PResult<'a, (Ident, ItemKind, Option<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.

fn parse_item_mod(
    &mut self,
    outer_attrs: &[Attribute]
) -> PResult<'a, (Ident, ItemKind, Option<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.

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

fn push_directory(&mut self, id: Ident, 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.

pub fn submod_path_from_attr(
    attrs: &[Attribute],
    dir_path: &Path
) -> Option<PathBuf>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 default_submod_path(
    id: Ident,
    relative: Option<Ident>,
    dir_path: &Path,
    source_map: &SourceMap
) -> ModulePath
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 path to a module.

fn submod_path(
    &mut self,
    id: Ident,
    outer_attrs: &[Attribute],
    id_sp: Span
) -> PResult<'a, ModulePathSuccess>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 eval_src_mod(
    &mut self,
    path: PathBuf,
    directory_ownership: DirectoryOwnership,
    name: String,
    id_sp: Span
) -> 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.

Reads a module from a source file.

fn parse_item_foreign_fn(
    &mut self,
    vis: Visibility,
    lo: Span,
    attrs: Vec<Attribute>
) -> PResult<'a, 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 function declaration from a foreign module.

fn parse_item_foreign_static(
    &mut self,
    vis: Visibility,
    lo: Span,
    attrs: Vec<Attribute>
) -> PResult<'a, 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 static item from a foreign module. Assumes that the static keyword is already parsed.

fn parse_item_foreign_type(
    &mut self,
    vis: Visibility,
    lo: Span,
    attrs: Vec<Attribute>
) -> PResult<'a, 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 type from a foreign module.

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_extern_crate(
    &mut self,
    lo: Span,
    visibility: Visibility,
    attrs: Vec<Attribute>
) -> PResult<'a, 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.

Parses extern crate links.

Examples

extern crate foo;
extern crate bar as foo;

fn parse_item_foreign_mod(
    &mut self,
    lo: Span,
    opt_abi: Option<Abi>,
    visibility: Visibility,
    attrs: Vec<Attribute>
) -> PResult<'a, 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.

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 {}

fn eat_type(&mut self) -> Option<PResult<'a, (Ident, AliasKind, 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 type Foo = Bar; or existential type Foo: Bar; or return None`` without modifying the parser state.

fn parse_existential_or_alias(
    &mut self,
    existential: bool
) -> PResult<'a, (Ident, AliasKind, 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 type alias or existential type.

fn parse_enum_def(&mut self, _generics: &Generics) -> PResult<'a, EnumDef>[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 part of an enum declaration following the {.

fn parse_item_enum(
    &mut self
) -> PResult<'a, (Ident, ItemKind, Option<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 an enum declaration.

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

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 as an ABI spec on an extern type or module. Consumes the extern keyword, if one is found.

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 parse_item_(
    &mut self,
    attrs: Vec<Attribute>,
    macros_allowed: bool,
    attributes_allowed: bool
) -> 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_implementation(
    &mut self,
    attrs: Vec<Attribute>,
    macros_allowed: bool,
    attributes_allowed: bool
) -> 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.

Parses one of the items allowed by the flags.

pub(crate) fn parse_foreign_item(&mut self) -> PResult<'a, 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.

fn parse_macro_use_or_failure(
    &mut self,
    attrs: Vec<Attribute>,
    macros_allowed: bool,
    attributes_allowed: bool,
    lo: Span,
    visibility: Visibility
) -> 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.

This is the fall-through for parsing items.

fn parse_assoc_macro_invoc(
    &mut self,
    item_kind: &str,
    vis: Option<&Visibility>,
    at_end: &mut bool
) -> PResult<'a, Option<Mac>>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 invocation inside a trait, impl or extern block.

fn collect_tokens<F, R>(&mut self, f: F) -> PResult<'a, (R, TokenStream)> where
    F: FnOnce(&mut Self) -> PResult<'a, 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.

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 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 ::*

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_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.

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.

pub fn parse_optional_str(&mut self) -> Option<(Symbol, StrStyle, Option<Name>)>[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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_str(&mut self) -> PResult<'a, (Symbol, StrStyle)>[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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)[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 construct_async_arguments(
    &mut self,
    asyncness: &mut Spanned<IsAsync>,
    decl: &mut 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.

When lowering a async fn to the HIR, we need to move all of the arguments of the function into the generated closure so that they are dropped when the future is polled and not when it is created.

The arguments of the function are replaced in HIR lowering with the arguments created by this function and the statements created here are inserted at the top of the closure body.

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

pub(crate) 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.

Parse attributes that appear before an item

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: InnerAttributeParsePolicy
) -> 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 InnerAttributeParsePolicy that prescribes how to handle inner attributes.

pub(crate) fn parse_meta_item_unrestricted(
    &mut self
) -> PResult<'a, (Path, 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.

Parse an inner part of attribute - 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 = TOKEN_TREE 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.

Parse 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*

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_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.

Per RFC#1559, matches the following grammar:

meta_item : IDENT ( '=' 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) ;

fn parse_meta_seq(&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 meta_seq = ( COMMASEP(meta_item_inner) )

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

pub fn fatal(&self, 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_fatal<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_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 bug(&self, 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 fn span_err<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(crate) 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(crate) 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(crate) fn cancel(&self, err: &mut DiagnosticBuilder)[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 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(crate) 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 fn expected_one_of_not_found(
    &mut self,
    edible: &[Token],
    inedible: &[Token]
) -> 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(crate) fn eat_to_tokens(&mut self, kets: &[&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.

Eats and discards tokens until one of kets is encountered. Respects token trees, passes through any errors encountered. Used for error recovery.

pub(crate) fn check_trailing_angle_brackets(
    &mut self,
    segment: &PathSegment,
    end: 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.

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

pub(crate) fn check_no_chained_comparison(&self, lhs: &Expr, outer_op: &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.

Produce an error if comparison operators are chained (RFC #558). We only need to check lhs, not rhs, because all comparison ops have same precedence and are left-associative

pub(crate) fn maybe_report_ambiguous_plus(
    &mut self,
    allow_plus: bool,
    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(crate) fn maybe_report_invalid_custom_discriminants(
    &mut self,
    discriminant_spans: Vec<Span>,
    variants: &[Spanned<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.

pub(crate) fn maybe_recover_from_bad_type_plus(
    &mut self,
    allow_plus: bool,
    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(crate) 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.

Try to recover from associated item paths like [T]::AssocItem/(T, U)::AssocItem. Attempt to convert the base expression/pattern/type into a type, parse the ::AssocItem tail, and combine them into a <Ty>::AssocItem expression/pattern/type.

pub(crate) 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 parse the ::AssocItem tail and combine them into a <Ty>::AssocItem expression/pattern/type.

pub(crate) 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 fn unexpected_try_recover(&mut self, t: &Token) -> 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.

Create a DiagnosticBuilder for an unexpected token t and try to recover if it is a closing delimiter.

pub(crate) fn parse_incorrect_await_syntax(
    &mut self,
    lo: Span,
    await_sp: 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.

Consume alternative await syntaxes like await <expr>, await? <expr>, await(<expr>) and await { <expr> }.

pub(crate) 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(), consume and emit error.

pub(crate) 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(crate) fn bad_type_ascription(
    &self,
    err: &mut DiagnosticBuilder<'a>,
    lhs_span: Span,
    cur_op_span: Span,
    next_sp: Span,
    maybe_path: 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(crate) 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(crate) fn recover_closing_delimiter(
    &mut self,
    tokens: &[Token],
    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(crate) fn eat_bad_pub(&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.

Recover from pub keyword in places where it seems reasonable but isn't valid.

pub(crate) 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.

pub(crate) 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.

pub(crate) 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(crate) fn expected_semi_or_open_brace(&mut self) -> PResult<'a, TraitItem>[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 eat_incorrect_doc_comment(&mut self, applied_to: &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(crate) fn argument_without_type(
    &mut self,
    err: &mut DiagnosticBuilder,
    pat: P<Pat>,
    require_name: bool,
    is_trait_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(crate) 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(crate) fn recover_bad_self_arg(
    &mut self,
    arg: Arg,
    is_trait_item: bool
) -> PResult<'a, Arg>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 consume_block(&mut self, delim: DelimToken)[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 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.

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

pub(crate) 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.

Matches lit = true | false | token_lit.

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

pub fn parse_ast_fragment(
    &mut self,
    kind: AstFragmentKind,
    macro_legacy_warnings: bool
) -> PResult<'a, AstFragment>
[src]

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

This crate is being loaded from the sysroot, a permanently unstable location for 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 ensure_complete_parse(
    &mut self,
    macro_path: &Path,
    kind_name: &str,
    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.

Trait Implementations

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

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

Auto Trait Implementations

impl<'a> !Send for Parser<'a>

impl<'a> !Sync for Parser<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<E> SpecializationError for E[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]