diff options
| author | varkor <github@varkor.com> | 2019-03-20 18:32:30 +0000 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-03-20 18:32:30 +0000 |
| commit | 4900585a4f15f93bb466f8c194445a0e9e628d49 (patch) | |
| tree | 95e3efd93d0722ed1c045fd4b3e77ad62c73156b /src | |
| parent | c745708aa31e9a54d5a6b10f810a296fe3a56376 (diff) | |
| download | rust-4900585a4f15f93bb466f8c194445a0e9e628d49.tar.gz rust-4900585a4f15f93bb466f8c194445a0e9e628d49.zip | |
Unify E0109, E0110 and E0111 errors
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/astconv.rs | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index df8b1bcfe70..c65f3443fbb 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1486,37 +1486,34 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o { segment.with_generic_args(|generic_args| { let (mut err_for_lt, mut err_for_ty, mut err_for_ct) = (false, false, false); for arg in &generic_args.args { - let (mut span_err, span, kind) = match arg { - // FIXME(varkor): unify E0109, E0110 and E0111. + let (span, kind) = match arg { hir::GenericArg::Lifetime(lt) => { if err_for_lt { continue } err_for_lt = true; has_err = true; - (struct_span_err!(self.tcx().sess, lt.span, E0110, - "lifetime arguments are not allowed on this entity"), - lt.span, - "lifetime") + (lt.span, "lifetime") } hir::GenericArg::Type(ty) => { if err_for_ty { continue } err_for_ty = true; has_err = true; - (struct_span_err!(self.tcx().sess, ty.span, E0109, - "type arguments are not allowed on this entity"), - ty.span, - "type") + (ty.span, "type") } hir::GenericArg::Const(ct) => { if err_for_ct { continue } err_for_ct = true; - (struct_span_err!(self.tcx().sess, ct.span, E0111, - "const parameters are not allowed on this type"), - ct.span, - "const") + (ct.span, "const") } }; - span_err.span_label(span, format!("{} argument not allowed", kind)) - .emit(); + let mut err = struct_span_err!( + self.tcx().sess, + span, + E0109, + "{} arguments are not allowed for this type", + kind, + ); + err.span_label(span, format!("{} argument not allowed", kind)); + err.emit(); if err_for_lt && err_for_ty && err_for_ct { break; } |
