]> 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 f1a04da188ba0ad376d1e924462c04ac374a17ca..f1b830e43fc1d6a84c76909e663fb0d0c3d60cff 100644 (file)
@@ -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);
                     }
                 },