Lines Matching refs:path
5 /// A path at which a named item is exported (e.g. `std::collections::HashMap`).
18 let mut path = Path {
22 path.segments.push_value(segment.into());
23 path
28 /// Determines whether this is a path of length 1 equal to the given
33 /// - the path has no leading colon,
34 /// - the number of path segments is 1,
35 /// - the first path segment has no angle bracketed or parenthesized
36 /// path arguments, and
37 /// - the ident of the first path segment is equal to the given one.
46 /// if attr.path().is_ident("serde") {
67 /// If this path consists of a single ident, returns the ident.
69 /// A path is considered an ident if:
71 /// - the path has no leading colon,
72 /// - the number of path segments is 1, and
73 /// - the first path segment has no angle bracketed or parenthesized
74 /// path arguments.
86 /// An error if this path is not a single ident, as defined in `get_ident`.
94 "expected this path to be an identifier",
101 /// A segment of a path together with any path arguments on that segment.
122 /// Angle bracketed or parenthesized arguments of a path segment.
190 /// Angle bracketed arguments of a path segment: the `<K, V>` in `HashMap<K,
237 /// Arguments of a function path segment: the `(A, B) -> C` in `Fn(A,B) ->
250 /// The explicit Self type in a qualified path: the `T` in `<T as
253 /// The actual path, including the trait and the associated item, is stored
306 && ty.path.leading_colon.is_none()
307 && ty.path.segments.len() == 1
308 && match &ty.path.segments[0].arguments {
314 let segment = ty.path.segments.pop().unwrap().into_value();
340 let segment = ty.path.segments.pop().unwrap().into_value();
390 path: Path::from(ident),
513 /// Parse a `Path` containing no path arguments on any of its segments.
531 /// path: Path,
538 /// path: input.call(Path::parse_mod_style)?,
569 return Err(input.error("expected path segment after `::`"));
577 let mut path = Path {
586 Path::parse_rest(input, &mut path, expr_style)?;
587 Ok(path)
592 path: &mut Self,
597 path.segments.push_punct(punct);
599 path.segments.push_value(value);
615 let path = if input.peek(Token![as]) {
617 let path: Path = input.parse()?;
618 Some((as_token, path))
626 let path = PathSegment::parse_helper(input, expr_style)?;
627 rest.push_value(path);
634 let (position, as_token, path) = match path {
635 Some((as_token, mut path)) => {
636 let pos = path.segments.len();
637 path.segments.push_punct(colon2_token);
638 path.segments.extend(rest.into_pairs());
639 (pos, Some(as_token), path)
642 let path = Path {
646 (0, None, path)
656 Ok((Some(qself), path))
658 let path = Path::parse_helper(input, expr_style)?;
659 Ok((None, path))
720 && expr.path.get_ident().is_some() =>
827 pub(crate) fn print_path(tokens: &mut TokenStream, qself: &Option<QSelf>, path: &Path) {
831 path.to_tokens(tokens);
838 let pos = cmp::min(qself.position, path.segments.len());
839 let mut segments = path.segments.pairs();
842 path.leading_colon.to_tokens(tokens);
854 path.leading_colon.to_tokens(tokens);