Skip to content

Commit

Permalink
Merge pull request #1002 from dtolnay/castprecedence
Browse files Browse the repository at this point in the history
Report no precedence for `:` binary operator in non-full mode
  • Loading branch information
dtolnay authored Mar 29, 2021
2 parents 725fca7 + 5ced044 commit c37d618
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c37d618

Please sign in to comment.