From f1b231dd714cb0edb0a632a5bd804b53423b3d4c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 13 Jul 2015 00:40:54 +0200 Subject: [PATCH] Remove unused method --- src/librustc_resolve/lib.rs | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index c0e42f269ee..b0cff1406c5 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -26,16 +26,6 @@ #![feature(slice_extras)] #![feature(staged_api)] -#![macro_use] - -macro_rules! resolve_err { - ($this:expr, $span:expr, $code:ident, $($rest:tt)*) => { - if $this.emit_errors { - span_err!($this.session, $span, $code, $($rest)*); - } - } -} - #[macro_use] extern crate log; #[macro_use] extern crate syntax; #[macro_use] #[no_link] extern crate rustc_bitflags; @@ -109,11 +99,18 @@ macro_rules! resolve_err { use resolve_imports::{Target, ImportDirective, ImportResolution}; use resolve_imports::Shadowable; - // NB: This module needs to be declared first so diagnostics are // registered before they are used. pub mod diagnostics; +macro_rules! resolve_err { + ($this:expr, $span:expr, $code:ident, $($rest:tt)*) => { + if $this.emit_errors { + span_err!($this.session, $span, $code, $($rest)*); + } + } +} + mod check_unused; mod record_exports; mod build_reduced_graph; @@ -2253,10 +2250,10 @@ fn check_consistent_bindings(&mut self, arm: &Arm) { for (&key, &binding) in &map_i { if !map_0.contains_key(&key) { resolve_err!(self, binding.span, E0410, - "variable `{}` from pattern {}{} is \ - not bound in pattern {}1", + "variable `{}` from pattern #{} is \ + not bound in pattern #1", key, - "#", i + 1, "#"); + i + 1); } } } @@ -2371,7 +2368,6 @@ fn resolve_type(&mut self, ty: &Ty) { path.segments[0].identifier.name == self_type_name; if is_invalid_self_type_name { resolve_err!(self, ty.span, E0411, - "{}", "use of `Self` outside of an impl or trait"); } else { resolve_err!(self, ty.span, E0412, @@ -3093,12 +3089,6 @@ fn with_no_errors(&mut self, f: F) -> T where rs } - fn resolve_error(&self, span: Span, s: &str) { - if self.emit_errors { - self.session.span_err(span, s); - } - } - fn find_fallback_in_self_type(&mut self, name: Name) -> FallbackSuggestion { fn extract_path_and_node_id(t: &Ty, allow: FallbackChecks) -> Option<(Path, NodeId, FallbackChecks)> { -- 2.44.0