|
26 | 26 | #![feature(slice_extras)]
|
27 | 27 | #![feature(staged_api)]
|
28 | 28 |
|
29 |
| -#![macro_use] |
30 |
| - |
31 |
| -macro_rules! resolve_err { |
32 |
| - ($this:expr, $span:expr, $code:ident, $($rest:tt)*) => { |
33 |
| - if $this.emit_errors { |
34 |
| - span_err!($this.session, $span, $code, $($rest)*); |
35 |
| - } |
36 |
| - } |
37 |
| -} |
38 |
| - |
39 | 29 | #[macro_use] extern crate log;
|
40 | 30 | #[macro_use] extern crate syntax;
|
41 | 31 | #[macro_use] #[no_link] extern crate rustc_bitflags;
|
@@ -109,11 +99,18 @@ use std::usize;
|
109 | 99 | use resolve_imports::{Target, ImportDirective, ImportResolution};
|
110 | 100 | use resolve_imports::Shadowable;
|
111 | 101 |
|
112 |
| - |
113 | 102 | // NB: This module needs to be declared first so diagnostics are
|
114 | 103 | // registered before they are used.
|
115 | 104 | pub mod diagnostics;
|
116 | 105 |
|
| 106 | +macro_rules! resolve_err { |
| 107 | + ($this:expr, $span:expr, $code:ident, $($rest:tt)*) => { |
| 108 | + if $this.emit_errors { |
| 109 | + span_err!($this.session, $span, $code, $($rest)*); |
| 110 | + } |
| 111 | + } |
| 112 | +} |
| 113 | + |
117 | 114 | mod check_unused;
|
118 | 115 | mod record_exports;
|
119 | 116 | mod build_reduced_graph;
|
@@ -2253,10 +2250,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
2253 | 2250 | for (&key, &binding) in &map_i {
|
2254 | 2251 | if !map_0.contains_key(&key) {
|
2255 | 2252 | resolve_err!(self, binding.span, E0410,
|
2256 |
| - "variable `{}` from pattern {}{} is \ |
2257 |
| - not bound in pattern {}1", |
| 2253 | + "variable `{}` from pattern #{} is \ |
| 2254 | + not bound in pattern #1", |
2258 | 2255 | key,
|
2259 |
| - "#", i + 1, "#"); |
| 2256 | + i + 1); |
2260 | 2257 | }
|
2261 | 2258 | }
|
2262 | 2259 | }
|
@@ -2371,7 +2368,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
2371 | 2368 | path.segments[0].identifier.name == self_type_name;
|
2372 | 2369 | if is_invalid_self_type_name {
|
2373 | 2370 | resolve_err!(self, ty.span, E0411,
|
2374 |
| - "{}", |
2375 | 2371 | "use of `Self` outside of an impl or trait");
|
2376 | 2372 | } else {
|
2377 | 2373 | resolve_err!(self, ty.span, E0412,
|
@@ -3093,12 +3089,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
3093 | 3089 | rs
|
3094 | 3090 | }
|
3095 | 3091 |
|
3096 |
| - fn resolve_error(&self, span: Span, s: &str) { |
3097 |
| - if self.emit_errors { |
3098 |
| - self.session.span_err(span, s); |
3099 |
| - } |
3100 |
| - } |
3101 |
| - |
3102 | 3092 | fn find_fallback_in_self_type(&mut self, name: Name) -> FallbackSuggestion {
|
3103 | 3093 | fn extract_path_and_node_id(t: &Ty, allow: FallbackChecks)
|
3104 | 3094 | -> Option<(Path, NodeId, FallbackChecks)> {
|
|
0 commit comments