X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Ftraits%2Fon_unimplemented.rs;h=f1b830e43fc1d6a84c76909e663fb0d0c3d60cff;hb=e180d36d49ef7a14196bddd9b8741eb36d689277;hp=92984b48ae938479f823424d5371465624f5de67;hpb=f48e576756cd0c360e5522974fc8d5867b439092;p=rust.git diff --git a/src/librustc/traits/on_unimplemented.rs b/src/librustc/traits/on_unimplemented.rs index 92984b48ae9..f1b830e43fc 100644 --- a/src/librustc/traits/on_unimplemented.rs +++ b/src/librustc/traits/on_unimplemented.rs @@ -2,6 +2,8 @@ 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}; @@ -292,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); } },