X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Ftraits%2Fon_unimplemented.rs;h=f1b830e43fc1d6a84c76909e663fb0d0c3d60cff;hb=e180d36d49ef7a14196bddd9b8741eb36d689277;hp=f1a04da188ba0ad376d1e924462c04ac374a17ca;hpb=005d9d5b6e1dd6ccdfa40c1dfce5517622c92018;p=rust.git diff --git a/src/librustc/traits/on_unimplemented.rs b/src/librustc/traits/on_unimplemented.rs index f1a04da188b..f1b830e43fc 100644 --- a/src/librustc/traits/on_unimplemented.rs +++ b/src/librustc/traits/on_unimplemented.rs @@ -1,10 +1,11 @@ use fmt_macros::{Parser, Piece, Position}; -use crate::hir::def_id::DefId; use crate::ty::{self, GenericParamDefKind, TyCtxt}; use crate::util::common::ErrorReported; +use errors::struct_span_err; use rustc_data_structures::fx::FxHashMap; +use rustc_hir::def_id::DefId; use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::Span; use syntax::ast::{MetaItem, NestedMetaItem}; @@ -293,26 +294,28 @@ fn verify( match generics.params.iter().find(|param| param.name == s) { Some(_) => (), None => { - span_err!( + struct_span_err!( tcx.sess, span, E0230, "there is no parameter `{}` on trait `{}`", s, name - ); + ) + .emit(); result = Err(ErrorReported); } } } // `{:1}` and `{}` are not to be used Position::ArgumentIs(_) | Position::ArgumentImplicitlyIs(_) => { - span_err!( + struct_span_err!( tcx.sess, span, E0231, "only named substitution parameters are allowed" - ); + ) + .emit(); result = Err(ErrorReported); } },