From 5ced0445c0c91ee1d1288b16aa3a281a6b9dde08 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 28 Mar 2021 21:45:16 -0400 Subject: [PATCH] Report no precedence for `:` binary operator in non-full mode --- src/expr.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/expr.rs b/src/expr.rs index dfa59695c0..32c60cb8ec 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -1422,7 +1422,9 @@ pub(crate) mod parsing { Precedence::Assign } else if input.peek(Token![..]) { Precedence::Range - } else if input.peek(Token![as]) || input.peek(Token![:]) && !input.peek(Token![::]) { + } else if input.peek(Token![as]) + || cfg!(feature = "full") && input.peek(Token![:]) && !input.peek(Token![::]) + { Precedence::Cast } else { Precedence::Any