Skip to content

Commit eed98d5

Browse files
committed
Various tweaks
1 parent 8749250 commit eed98d5

File tree

12 files changed

+42
-49
lines changed

12 files changed

+42
-49
lines changed

src/librustc/middle/entry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fn configure_main(this: &mut EntryContext) {
170170
defined at the crate level. Either move the definition or \
171171
attach the `#[main]` attribute to override this behavior.");
172172
for &(_, span) in &this.non_main_fns {
173-
err.span_label(span, "here is a function named 'main'");
173+
err.span_note(span, "here is a function named 'main'");
174174
}
175175
err.emit();
176176
this.session.abort_if_errors();

src/librustc_const_eval/check_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,8 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
402402
);
403403
// if we had a catchall pattern, hint at that
404404
if let Some(catchall) = catchall {
405-
err.span_label(pat.span, "this is an unreachable pattern");
406-
err.span_label(catchall, "this pattern matches any value");
405+
err.span_label(pat.span, "unreachable pattern");
406+
err.span_label(catchall, "matches any value");
407407
}
408408
err.emit();
409409
},

src/librustc_resolve/build_reduced_graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<'a> Resolver<'a> {
220220
ResolutionError::SelfImportCanOnlyAppearOnceInTheList);
221221

222222
for other_span in self_spans.iter().skip(1) {
223-
e.span_note(*other_span, "another `self` import appears here");
223+
e.span_label(*other_span, "another `self` import appears here");
224224
}
225225

226226
e.emit();

src/librustc_resolve/lib.rs

+20-22
Original file line numberDiff line numberDiff line change
@@ -290,17 +290,17 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
290290
"`self` imports are only allowed within a { } list")
291291
}
292292
ResolutionError::SelfImportCanOnlyAppearOnceInTheList => {
293-
struct_span_err!(resolver.session,
294-
span,
295-
E0430,
296-
"`self` import can only appear once in the list")
293+
let mut err = struct_span_err!(resolver.session, span, E0430,
294+
"`self` import can only appear once in an import list");
295+
err.span_label(span, "can only appear once in an import list");
296+
err
297297
}
298298
ResolutionError::SelfImportOnlyInImportListWithNonEmptyPrefix => {
299-
struct_span_err!(resolver.session,
300-
span,
301-
E0431,
302-
"`self` import can only appear in an import list with a \
303-
non-empty prefix")
299+
let mut err = struct_span_err!(resolver.session, span, E0431,
300+
"`self` import can only appear in an import list with \
301+
a non-empty prefix");
302+
err.span_label(span, "can only appear in an import list with a non-empty prefix");
303+
err
304304
}
305305
ResolutionError::UnresolvedImport(name) => {
306306
let (span, msg) = match name {
@@ -320,18 +320,17 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
320320
err
321321
}
322322
ResolutionError::CannotCaptureDynamicEnvironmentInFnItem => {
323-
struct_span_err!(resolver.session,
324-
span,
325-
E0434,
326-
"{}",
327-
"can't capture dynamic environment in a fn item; use the || { ... } \
328-
closure form instead")
323+
let mut err = struct_span_err!(resolver.session,
324+
span,
325+
E0434,
326+
"{}",
327+
"can't capture dynamic environment in a fn item");
328+
err.help("use the `|| { ... }` closure form instead");
329+
err
329330
}
330331
ResolutionError::AttemptToUseNonConstantValueInConstant => {
331-
let mut err = struct_span_err!(resolver.session,
332-
span,
333-
E0435,
334-
"attempt to use a non-constant value in a constant");
332+
let mut err = struct_span_err!(resolver.session, span, E0435,
333+
"attempt to use a non-constant value in a constant");
335334
err.span_label(span, "non-constant value");
336335
err
337336
}
@@ -351,8 +350,7 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
351350
let mut err = struct_span_err!(resolver.session, span, E0128,
352351
"type parameters with a default cannot use \
353352
forward declared identifiers");
354-
err.span_label(span, format!("defaulted type parameters \
355-
cannot be forward declared"));
353+
err.span_label(span, format!("defaulted type parameters cannot be forward declared"));
356354
err
357355
}
358356
}
@@ -3941,7 +3939,7 @@ impl<'a> Resolver<'a> {
39413939

39423940
feature_err(&self.session.parse_sess, feature,
39433941
attr.span, GateIssue::Language, msg)
3944-
.span_note(binding.span(), "procedural macro imported here")
3942+
.span_label(binding.span(), "procedural macro imported here")
39453943
.emit();
39463944
}
39473945
}

src/test/compile-fail/bad-env-capture.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: can't capture dynamic environment in a fn item;
11+
// error-pattern: can't capture dynamic environment in a fn item
1212
fn foo() {
1313
let x: isize;
1414
fn bar() { log(debug, x); }

src/test/compile-fail/bad-env-capture2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: can't capture dynamic environment in a fn item;
11+
// error-pattern: can't capture dynamic environment in a fn item
1212
fn foo(x: isize) {
1313
fn bar() { log(debug, x); }
1414
}

src/test/compile-fail/bad-env-capture3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: can't capture dynamic environment in a fn item;
11+
// error-pattern: can't capture dynamic environment in a fn item
1212
fn foo(x: isize) {
1313
fn mth() {
1414
fn bar() { log(debug, x); }

src/test/compile-fail/capture1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111

12-
// error-pattern: can't capture dynamic environment in a fn item;
12+
// error-pattern: can't capture dynamic environment in a fn item
1313

1414
fn main() {
1515
let bar: isize = 5;

src/test/ui/issue-30302.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ error: unreachable pattern
1010
--> $DIR/issue-30302.rs:25:9
1111
|
1212
23 | Nil => true,
13-
| --- this pattern matches any value
13+
| --- matches any value
1414
24 | //~^ WARN pattern binding `Nil` is named the same as one of the variants of the type `Stack`
1515
25 | _ => false
16-
| ^ this is an unreachable pattern
16+
| ^ unreachable pattern
1717
|
1818
note: lint level defined here
1919
--> $DIR/issue-30302.rs:14:9

src/test/ui/issue-31221.stderr

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ error: unreachable pattern
22
--> $DIR/issue-31221.rs:28:9
33
|
44
27 | Var3 => (),
5-
| ---- this pattern matches any value
5+
| ---- matches any value
66
28 | Var2 => (),
7-
| ^^^^ this is an unreachable pattern
7+
| ^^^^ unreachable pattern
88
|
99
note: lint level defined here
1010
--> $DIR/issue-31221.rs:14:9
@@ -16,19 +16,17 @@ error: unreachable pattern
1616
--> $DIR/issue-31221.rs:34:9
1717
|
1818
33 | &Var3 => (),
19-
| ----- this pattern matches any value
19+
| ----- matches any value
2020
34 | &Var2 => (),
21-
| ^^^^^ this is an unreachable pattern
22-
|
21+
| ^^^^^ unreachable pattern
2322

2423
error: unreachable pattern
2524
--> $DIR/issue-31221.rs:41:9
2625
|
2726
40 | (c, d) => (),
28-
| ------ this pattern matches any value
27+
| ------ matches any value
2928
41 | anything => ()
30-
| ^^^^^^^^ this is an unreachable pattern
31-
|
29+
| ^^^^^^^^ unreachable pattern
3230

3331
error: aborting due to 3 previous errors
3432

src/test/ui/use-mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use foo::bar::{
1212
self,
13-
//~^ ERROR `self` import can only appear once in the list
13+
//~^ ERROR `self` import can only appear once in an import list
1414
Bar,
1515
self
1616
//~^ ERROR the name `bar` is defined multiple times

src/test/ui/use-mod.stderr

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
error[E0430]: `self` import can only appear once in the list
1+
error[E0430]: `self` import can only appear once in an import list
22
--> $DIR/use-mod.rs:12:5
33
|
44
12 | self,
5-
| ^^^^
6-
|
7-
note: another `self` import appears here
8-
--> $DIR/use-mod.rs:15:5
9-
|
5+
| ^^^^ can only appear once in an import list
6+
...
107
15 | self
11-
| ^^^^
8+
| ---- another `self` import appears here
129

1310
error[E0431]: `self` import can only appear in an import list with a non-empty prefix
1411
--> $DIR/use-mod.rs:19:6
1512
|
1613
19 | use {self};
17-
| ^^^^
14+
| ^^^^ can only appear in an import list with a non-empty prefix
1815

1916
error[E0252]: the name `bar` is defined multiple times
2017
--> $DIR/use-mod.rs:15:5

0 commit comments

Comments
 (0)