]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_plugin/build.rs
Auto merge of #30641 - tsion:match-range, r=eddyb
[rust.git] / src / librustc_plugin / build.rs
index 00f58c6af91554d8e63e6b1234e40be39413db70..5adde4304f57c9541b56f76523f0be4655863cb1 100644 (file)
@@ -13,7 +13,7 @@
 use syntax::ast;
 use syntax::attr;
 use syntax::codemap::Span;
-use syntax::diagnostic;
+use syntax::errors;
 use rustc_front::intravisit::Visitor;
 use rustc_front::hir;
 
@@ -33,7 +33,7 @@ fn visit_item(&mut self, item: &hir::Item) {
 }
 
 /// Find the function marked with `#[plugin_registrar]`, if any.
-pub fn find_plugin_registrar(diagnostic: &diagnostic::SpanHandler,
+pub fn find_plugin_registrar(diagnostic: &errors::Handler,
                              krate: &hir::Crate)
                              -> Option<ast::NodeId> {
     let mut finder = RegistrarFinder { registrars: Vec::new() };
@@ -46,11 +46,12 @@ pub fn find_plugin_registrar(diagnostic: &diagnostic::SpanHandler,
             Some(node_id)
         },
         _ => {
-            diagnostic.handler().err("multiple plugin registration functions found");
+            let mut e = diagnostic.struct_err("multiple plugin registration functions found");
             for &(_, span) in &finder.registrars {
-                diagnostic.span_note(span, "one is here");
+                e.span_note(span, "one is here");
             }
-            diagnostic.handler().abort_if_errors();
+            e.emit();
+            diagnostic.abort_if_errors();
             unreachable!();
         }
     }