]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/traits/on_unimplemented.rs
Rollup merge of #67501 - oli-obk:test-slice-patterns, r=RalfJung
[rust.git] / src / librustc / traits / on_unimplemented.rs
index 5d90018e80a389c4af7430aa60b373e65929c094..f1b830e43fc1d6a84c76909e663fb0d0c3d60cff 100644 (file)
@@ -1,14 +1,15 @@
 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};
 use syntax::attr;
-use syntax::symbol::{kw, sym, Symbol};
 
 use rustc_error_codes::*;
 
@@ -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);
                     }
                 },