]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_parse/parser/path.rs
Rollup merge of #69554 - GuillaumeGomez:cleanup-e0374, r=Dylan-DPC
[rust.git] / src / librustc_parse / parser / path.rs
index b588fe5954d68fa88b32216cd40ded4b272a4971..355b6429a7494fdc8122120e81b88c766ffeb357 100644 (file)
@@ -1,14 +1,16 @@
 use super::ty::{AllowPlus, RecoverQPath};
 use super::{Parser, TokenType};
 use crate::maybe_whole;
+use rustc_ast::ast::{
+    self, AngleBracketedArgs, Ident, ParenthesizedArgs, Path, PathSegment, QSelf,
+};
+use rustc_ast::ast::{
+    AnonConst, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode, GenericArg,
+};
+use rustc_ast::token::{self, Token};
 use rustc_errors::{pluralize, Applicability, PResult};
 use rustc_span::source_map::{BytePos, Span};
 use rustc_span::symbol::{kw, sym};
-use syntax::ast::{self, AngleBracketedArgs, Ident, ParenthesizedArgs, Path, PathSegment, QSelf};
-use syntax::ast::{
-    AnonConst, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode, GenericArg,
-};
-use syntax::token::{self, Token};
 
 use log::debug;
 use std::mem;
@@ -469,7 +471,7 @@ fn parse_generic_args(&mut self) -> PResult<'a, (Vec<GenericArg>, Vec<AssocTyCon
         // 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_token.span),
                 "associated type bindings must be declared after generic parameters",