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

pub struct Path {
    pub span: Span,
    pub segments: ThinVec<PathSegment>,
    pub tokens: Option<LazyAttrTokenStream>,
}

Expand description

A “Path” is essentially Rust’s notion of a name.

It’s represented as a sequence of identifiers, along with a bunch of supporting information.

E.g., std::cmp::PartialEq.

The segments in the path: the things separated by ::. Global paths begin with kw::PathRoot.

Source§

Source

Convert a span and an identifier to the corresponding one-segment path.

Source

Source

Source

Check if this path is potentially a trivial const arg, i.e., one that can _potentially_be represented without an anon const in the HIR.

If allow_mgca_arg is true (as should be the case in most situations when#![feature(min_generic_const_args)] is enabled), then this always returns true because all paths are valid.

Otherwise, it returns true iff the path has exactly one segment, and it has no generic args (i.e., it is potentially a const parameter).

§

§

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 24 bytes