Skip to content

Commit 8b752f6

Browse files
---
yaml --- r: 235455 b: refs/heads/stable c: 8b731a5 h: refs/heads/master i: 235453: d961456 235451: 458334a 235447: deeb16f 235439: 40ccdb8 235423: 3625908 235391: 768beb2 v: v3
1 parent f327b1a commit 8b752f6

File tree

5 files changed

+114
-217
lines changed

5 files changed

+114
-217
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: afae2ff723393b3ab4ccffef6ac7c6d1809e2da0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: f859507de8c410b648d934d8f5ec1c52daac971d
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 2e00b3177001dd8281038930f4a5d0f214420bc4
32+
refs/heads/stable: 8b731a5cac22f37d3709c889e4de342ca851e3ff
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/librustc_resolve/build_reduced_graph.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
208208
// Return an error here by looking up the namespace that
209209
// had the duplicate.
210210
let ns = ns.unwrap();
211-
self.resolve_error(sp,
212-
&format!("duplicate definition of {} `{}`",
213-
namespace_error_to_string(duplicate_type),
214-
token::get_name(name)));
211+
resolve_err!(self, sp, E0428,
212+
"duplicate definition of {} `{}`",
213+
namespace_error_to_string(duplicate_type),
214+
token::get_name(name));
215215
{
216216
let r = child.span_for_namespace(ns);
217217
if let Some(sp) = r {
@@ -304,8 +304,9 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
304304
full_path.segments.last().unwrap().identifier.name;
305305
if &token::get_name(source_name)[..] == "mod" ||
306306
&token::get_name(source_name)[..] == "self" {
307-
self.resolve_error(view_path.span,
308-
"`self` imports are only allowed within a { } list");
307+
resolve_err!(self, view_path.span, E0429,
308+
"{}",
309+
"`self` imports are only allowed within a { } list");
309310
}
310311

311312
let subclass = SingleImport(binding.name,
@@ -325,8 +326,9 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
325326
_ => None
326327
}).collect::<Vec<Span>>();
327328
if mod_spans.len() > 1 {
328-
self.resolve_error(mod_spans[0],
329-
"`self` import can only appear once in the list");
329+
resolve_err!(self, mod_spans[0], E0430,
330+
"{}",
331+
"`self` import can only appear once in the list");
330332
for other_span in mod_spans.iter().skip(1) {
331333
self.session.span_note(*other_span,
332334
"another `self` import appears here");
@@ -341,7 +343,8 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
341343
let name = match module_path.last() {
342344
Some(name) => *name,
343345
None => {
344-
self.resolve_error(source_item.span,
346+
resolve_err!(self, source_item.span, E0431,
347+
"{}",
345348
"`self` import can only appear in an import list \
346349
with a non-empty prefix");
347350
continue;

branches/stable/src/librustc_resolve/diagnostics.rs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,45 @@ register_diagnostics! {
209209
E0257,
210210
E0258,
211211
E0364, // item is private
212-
E0365 // item is private
212+
E0365, // item is private
213+
E0397, // failed to resolve
214+
E0398, // unresolved import
215+
E0399, // can't capture dynamic environment in a fn item
216+
E0400, // attempt to use a non-constant value in a constant
217+
E0401, // can't use type parameters from outer function
218+
E0402, // cannot use an outer type parameter in this context
219+
E0403, // the name `{}` is already used
220+
E0404, // is not a trait
221+
E0405, // use of undeclared trait name
222+
E0406, // undeclared associated type
223+
E0407, // method is not a member of trait
224+
E0408, // variable from pattern #1 is not bound in pattern #
225+
E0409, // variable is bound with different mode in pattern # than in
226+
// pattern #1
227+
E0410, // variable from pattern is not bound in pattern 1
228+
E0411, // use of `Self` outside of an impl or trait
229+
E0412, // use of undeclared
230+
E0413, // declaration of shadows an enum variant or unit-like struct in
231+
// scope
232+
E0414, // only irrefutable patterns allowed here
233+
E0415, // identifier is bound more than once in this parameter list
234+
E0416, // identifier is bound more than once in the same pattern
235+
E0417, // static variables cannot be referenced in a pattern, use a
236+
// `const` instead
237+
E0418, // is not an enum variant, struct or const
238+
E0419, // unresolved enum variant, struct or const
239+
E0420, // is not an associated const
240+
E0421, // unresolved associated const
241+
E0422, // does not name a structure
242+
E0423, // is a struct variant name, but this expression uses it like a
243+
// function name
244+
E0424, // `self` is not available in a static method.
245+
E0425, // unresolved name
246+
E0426, // use of undeclared label
247+
E0427, // cannot use `ref` binding mode with ...
248+
E0428, // duplicate definition of ...
249+
E0429, // `self` imports are only allowed within a { } list
250+
E0430, // `self` import can only appear once in the list
251+
E0431 // `self` import can only appear in an import list with a non-empty
252+
// prefix
213253
}

0 commit comments

Comments
 (0)