From 272ab5df9bcb1e71faa867ec598f71cfc531b5ee Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 5 Jan 2021 12:36:16 -0800 Subject: [PATCH] Parse simple literal const generic path args even without "full" --- src/path.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/path.rs b/src/path.rs index 31a80e59f6..601891e1db 100644 --- a/src/path.rs +++ b/src/path.rs @@ -241,12 +241,15 @@ pub mod parsing { if input.peek(Ident) && input.peek2(Token![:]) && !input.peek2(Token![::]) { return Ok(GenericArgument::Constraint(input.parse()?)); } + } - if input.peek(Lit) { - let lit = input.parse()?; - return Ok(GenericArgument::Const(Expr::Lit(lit))); - } + if input.peek(Lit) { + let lit = input.parse()?; + return Ok(GenericArgument::Const(Expr::Lit(lit))); + } + #[cfg(feature = "full")] + { if input.peek(token::Brace) { let block = input.call(expr::parsing::expr_block)?; return Ok(GenericArgument::Const(Expr::Block(block)));