about summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-02-29 02:16:21 +0100
committerGitHub <noreply@github.com>2020-02-29 02:16:21 +0100
commitc8db7dcc1cd91366dda9bea92e38b5d215ede1f1 (patch)
tree30b13312973df647f11481151c9fc7bea077479a /src/librustc_parse/parser
parentba2df27525ab535aa600cd25fda4aa7f0f13a2aa (diff)
parent1622b6ef7372c40381914facf8794d851fcd9eb1 (diff)
downloadrust-c8db7dcc1cd91366dda9bea92e38b5d215ede1f1.tar.gz
rust-c8db7dcc1cd91366dda9bea92e38b5d215ede1f1.zip
Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-Simulacrum
use is_empty() instead of len() == x  to determine if structs are empty.
Diffstat (limited to 'src/librustc_parse/parser')
-rw-r--r--src/librustc_parse/parser/path.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_parse/parser/path.rs b/src/librustc_parse/parser/path.rs
index f3a61ad4419..1db920625e3 100644
--- a/src/librustc_parse/parser/path.rs
+++ b/src/librustc_parse/parser/path.rs
@@ -469,7 +469,7 @@ impl<'a> Parser<'a> {
         // FIXME: we would like to report this in ast_validation instead, but we currently do not
         // preserve ordering of generic parameters with respect to associated type binding, so we
         // lose that information after parsing.
-        if misplaced_assoc_ty_constraints.len() > 0 {
+        if !misplaced_assoc_ty_constraints.is_empty() {
             let mut err = self.struct_span_err(
                 args_lo.to(self.prev_span),
                 "associated type bindings must be declared after generic parameters",