]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #53600 - varkor:expected-generic-arg-s, r=eddyb
authorkennytm <kennytm@gmail.com>
Fri, 24 Aug 2018 08:44:40 +0000 (16:44 +0800)
committerkennytm <kennytm@gmail.com>
Fri, 24 Aug 2018 11:24:37 +0000 (19:24 +0800)
Fix a grammatical mistake in "expected generic arguments" errors

r? @eddyb

1  2 
src/librustc_typeck/astconv.rs

index a528c8e9b4f96d26932851085cf648d88b9a6b9f,3f88bf829a82ef6b2f34805cd3d724dffae27654..d0778a729adb0c39a49cfb58fd62830f54f115bc
@@@ -108,7 -108,7 +108,7 @@@ struct GenericArgMismatchErrorCode 
  /// Dummy type used for the `Self` of a `TraitRef` created for converting
  /// a trait object, and which gets removed in `ExistentialTraitRef`.
  /// This type must not appear anywhere in other converted types.
 -const TRAIT_OBJECT_DUMMY_SELF: ty::TypeVariants<'static> = ty::TyInfer(ty::FreshTy(0));
 +const TRAIT_OBJECT_DUMMY_SELF: ty::TyKind<'static> = ty::Infer(ty::FreshTy(0));
  
  impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
      pub fn ast_region_to_region(&self,
                      quantifier,
                      bound,
                      kind,
-                     if required != 1 { "s" } else { "" },
+                     if bound != 1 { "s" } else { "" },
                  )
              };
  
                      Err(ErrorReported) => return (tcx.types.err, Def::Err),
                  }
              }
 -            (&ty::TyParam(_), Def::SelfTy(Some(param_did), None)) |
 -            (&ty::TyParam(_), Def::TyParam(param_did)) => {
 +            (&ty::Param(_), Def::SelfTy(Some(param_did), None)) |
 +            (&ty::Param(_), Def::TyParam(param_did)) => {
                  match self.find_bound_for_assoc_item(param_did, assoc_name, span) {
                      Ok(bound) => bound,
                      Err(ErrorReported) => return (tcx.types.err, Def::Err),
                  )
              }
              Def::Enum(did) | Def::TyAlias(did) | Def::Struct(did) |
 -            Def::Union(did) | Def::TyForeign(did) => {
 +            Def::Union(did) | Def::ForeignTy(did) => {
                  assert_eq!(opt_self_ty, None);
                  self.prohibit_generics(path.segments.split_last().unwrap().1);
                  self.ast_path_to_ty(span, did, path.segments.last().unwrap())
                  assert_eq!(opt_self_ty, None);
                  self.prohibit_generics(&path.segments);
                  match prim_ty {
 -                    hir::TyBool => tcx.types.bool,
 -                    hir::TyChar => tcx.types.char,
 -                    hir::TyInt(it) => tcx.mk_mach_int(it),
 -                    hir::TyUint(uit) => tcx.mk_mach_uint(uit),
 -                    hir::TyFloat(ft) => tcx.mk_mach_float(ft),
 -                    hir::TyStr => tcx.mk_str()
 +                    hir::Bool => tcx.types.bool,
 +                    hir::Char => tcx.types.char,
 +                    hir::Int(it) => tcx.mk_mach_int(it),
 +                    hir::Uint(uit) => tcx.mk_mach_uint(uit),
 +                    hir::Float(ft) => tcx.mk_mach_float(ft),
 +                    hir::Str => tcx.mk_str()
                  }
              }
              Def::Err => {
              }
              hir::TyKind::Rptr(ref region, ref mt) => {
                  let r = self.ast_region_to_region(region, None);
 -                debug!("TyRef r={:?}", r);
 +                debug!("Ref r={:?}", r);
                  let t = self.ast_ty_to_ty(&mt.ty);
                  tcx.mk_ref(r, ty::TypeAndMut {ty: t, mutbl: mt.mutbl})
              }
                  let length_def_id = tcx.hir.local_def_id(length.id);
                  let substs = Substs::identity_for_item(tcx, length_def_id);
                  let length = ty::Const::unevaluated(tcx, length_def_id, substs, tcx.types.usize);
 -                let array_ty = tcx.mk_ty(ty::TyArray(self.ast_ty_to_ty(&ty), length));
 +                let array_ty = tcx.mk_ty(ty::Array(self.ast_ty_to_ty(&ty), length));
                  self.normalize_ty(ast_ty.span, array_ty)
              }
              hir::TyKind::Typeof(ref _e) => {
                  tcx.types.err
              }
              hir::TyKind::Infer => {
 -                // TyInfer also appears as the type of arguments or return
 +                // Infer also appears as the type of arguments or return
                  // values in a ExprKind::Closure, or as
                  // the type of local variables. Both of these cases are
                  // handled specially and will not descend into this routine.
      /// we return `None`.
      fn compute_object_lifetime_bound(&self,
          span: Span,
 -        existential_predicates: ty::Binder<&'tcx ty::Slice<ty::ExistentialPredicate<'tcx>>>)
 +        existential_predicates: ty::Binder<&'tcx ty::List<ty::ExistentialPredicate<'tcx>>>)
          -> Option<ty::Region<'tcx>> // if None, use the default
      {
          let tcx = self.tcx();