Lines Matching refs:input
275 fn parse(input: ParseStream) -> Result<Self> {
278 ambig_ty(input, allow_plus, allow_group_generic)
289 pub fn without_plus(input: ParseStream) -> Result<Self> {
292 ambig_ty(input, allow_plus, allow_group_generic)
297 input: ParseStream,
301 let begin = input.fork();
303 if input.peek(token::Group) {
304 let mut group: TypeGroup = input.parse()?;
305 if input.peek(Token![::]) && input.peek3(Ident::peek_any) {
307 Path::parse_rest(input, &mut ty.path, false)?;
318 path: Path::parse_helper(input, false)?,
321 } else if input.peek(Token![<]) && allow_group_generic
322 || input.peek(Token![::]) && input.peek3(Token![<])
327 *arguments = PathArguments::AngleBracketed(input.parse()?);
328 Path::parse_rest(input, &mut ty.path, false)?;
339 let mut lookahead = input.lookahead1();
341 lifetimes = input.parse()?;
342 lookahead = input.lookahead1();
351 || input.peek(Token![dyn])
359 let paren_token = parenthesized!(content in input);
381 while let Some(plus) = input.parse()? {
383 bounds.push_value(input.parse()?);
408 if allow_plus && input.peek(Token![+]) {
448 while let Some(plus) = input.parse()? {
450 bounds.push_value(input.parse()?);
465 let mut bare_fn: TypeBareFn = input.parse()?;
469 || input.peek(Token![super])
470 || input.peek(Token![self])
471 || input.peek(Token![Self])
472 || input.peek(Token![crate])
476 let ty: TypePath = input.parse()?;
481 if input.peek(Token![!]) && !input.peek(Token![!=]) && ty.path.is_mod_style() {
482 let bang_token: Token![!] = input.parse()?;
483 let (delimiter, tokens) = mac::parse_delimiter(input)?;
494 if lifetimes.is_some() || allow_plus && input.peek(Token![+]) {
503 while input.peek(Token![+]) {
504 bounds.push_punct(input.parse()?);
505 if !(input.peek(Ident::peek_any)
506 || input.peek(Token![::])
507 || input.peek(Token![?])
508 || input.peek(Lifetime)
509 || input.peek(token::Paren))
513 bounds.push_value(input.parse()?);
524 let dyn_token: Token![dyn] = input.parse()?;
526 let star_token: Option<Token![*]> = input.parse()?;
527 let bounds = TypeTraitObject::parse_bounds(dyn_span, input, allow_plus)?;
529 Type::Verbatim(verbatim::between(&begin, input))
538 let bracket_token = bracketed!(content in input);
554 input.parse().map(Type::Ptr)
556 input.parse().map(Type::Reference)
557 } else if lookahead.peek(Token![!]) && !input.peek(Token![=]) {
558 input.parse().map(Type::Never)
560 TypeImplTrait::parse(input, allow_plus).map(Type::ImplTrait)
562 input.parse().map(Type::Infer)
564 input.parse().map(Type::TraitObject)
572 fn parse(input: ParseStream) -> Result<Self> {
575 bracket_token: bracketed!(content in input),
583 fn parse(input: ParseStream) -> Result<Self> {
586 bracket_token: bracketed!(content in input),
596 fn parse(input: ParseStream) -> Result<Self> {
597 let star_token: Token![*] = input.parse()?;
599 let lookahead = input.lookahead1();
601 (Some(input.parse()?), None)
603 (None, Some(input.parse()?))
612 elem: Box::new(input.call(Type::without_plus)?),
619 fn parse(input: ParseStream) -> Result<Self> {
621 and_token: input.parse()?,
622 lifetime: input.parse()?,
623 mutability: input.parse()?,
625 elem: Box::new(input.call(Type::without_plus)?),
632 fn parse(input: ParseStream) -> Result<Self> {
637 lifetimes: input.parse()?,
638 unsafety: input.parse()?,
639 abi: input.parse()?,
640 fn_token: input.parse()?,
641 paren_token: parenthesized!(args in input),
672 output: input.call(ReturnType::without_plus)?,
679 fn parse(input: ParseStream) -> Result<Self> {
681 bang_token: input.parse()?,
688 fn parse(input: ParseStream) -> Result<Self> {
690 underscore_token: input.parse()?,
697 fn parse(input: ParseStream) -> Result<Self> {
699 let paren_token = parenthesized!(content in input);
730 fn parse(input: ParseStream) -> Result<Self> {
732 mac: input.parse()?,
739 fn parse(input: ParseStream) -> Result<Self> {
741 let (qself, path) = path::parsing::qpath(input, expr_style)?;
748 pub fn without_plus(input: ParseStream) -> Result<Self> {
750 Self::parse(input, allow_plus)
753 pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
754 if input.peek(Token![->]) {
755 let arrow = input.parse()?;
757 let ty = ambig_ty(input, allow_plus, allow_group_generic)?;
767 fn parse(input: ParseStream) -> Result<Self> {
769 Self::parse(input, allow_plus)
775 fn parse(input: ParseStream) -> Result<Self> {
777 Self::parse(input, allow_plus)
783 pub fn without_plus(input: ParseStream) -> Result<Self> {
785 Self::parse(input, allow_plus)
789 pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
790 let dyn_token: Option<Token![dyn]> = input.parse()?;
793 None => input.span(),
795 let bounds = Self::parse_bounds(dyn_span, input, allow_plus)?;
801 input: ParseStream,
804 let bounds = TypeParamBound::parse_multiple(input, allow_plus)?;
829 fn parse(input: ParseStream) -> Result<Self> {
831 Self::parse(input, allow_plus)
837 pub fn without_plus(input: ParseStream) -> Result<Self> {
839 Self::parse(input, allow_plus)
842 pub(crate) fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
843 let impl_token: Token![impl] = input.parse()?;
844 let bounds = TypeParamBound::parse_multiple(input, allow_plus)?;
872 fn parse(input: ParseStream) -> Result<Self> {
873 let group = crate::group::parse_group(input)?;
883 fn parse(input: ParseStream) -> Result<Self> {
885 Self::parse(input, allow_plus)
890 fn parse(input: ParseStream, allow_plus: bool) -> Result<Self> {
893 paren_token: parenthesized!(content in input),
904 fn parse(input: ParseStream) -> Result<Self> {
906 parse_bare_fn_arg(input, allow_self)
910 fn parse_bare_fn_arg(input: ParseStream, allow_self: bool) -> Result<BareFnArg> {
911 let attrs = input.call(Attribute::parse_outer)?;
913 let begin = input.fork();
915 let has_mut_self = allow_self && input.peek(Token![mut]) && input.peek2(Token![self]);
917 input.parse::<Token![mut]>()?;
921 let mut name = if (input.peek(Ident) || input.peek(Token![_]) || {
922 has_self = allow_self && input.peek(Token![self]);
924 }) && input.peek2(Token![:])
925 && !input.peek2(Token![::])
927 let name = input.call(Ident::parse_any)?;
928 let colon: Token![:] = input.parse()?;
935 let ty = if allow_self && !has_self && input.peek(Token![mut]) && input.peek2(Token![self])
937 input.parse::<Token![mut]>()?;
938 input.parse::<Token![self]>()?;
941 input.parse::<Token![self]>()?;
944 Some(input.parse()?)
951 Type::Verbatim(verbatim::between(&begin, input))
958 fn parse_bare_variadic(input: ParseStream, attrs: Vec<Attribute>) -> Result<BareVariadic> {
961 name: if input.peek(Ident) || input.peek(Token![_]) {
962 let name = input.call(Ident::parse_any)?;
963 let colon: Token![:] = input.parse()?;
968 dots: input.parse()?,
969 comma: input.parse()?,
975 fn parse(input: ParseStream) -> Result<Self> {
977 extern_token: input.parse()?,
978 name: input.parse()?,
985 fn parse(input: ParseStream) -> Result<Self> {
986 if input.peek(Token![extern]) {
987 input.parse().map(Some)