X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Ftraits%2Fon_unimplemented.rs;h=f1b830e43fc1d6a84c76909e663fb0d0c3d60cff;hb=e180d36d49ef7a14196bddd9b8741eb36d689277;hp=9097cbf0c221a54946ae0a8873c643690d81465b;hpb=a86a18907b881e9e144e7420f7e9d568353c0f4f;p=rust.git diff --git a/src/librustc/traits/on_unimplemented.rs b/src/librustc/traits/on_unimplemented.rs index 9097cbf0c22..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 crate::util::nodemap::FxHashMap; +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); } },