Skip to content

Commit acad03a

Browse files
committed
auto merge of #19415 : P1start/rust/error-message-fixes, r=alexcrichton
This is the style followed by most other error messages.
2 parents 3ee471c + 432adc6 commit acad03a

23 files changed

+68
-68
lines changed

src/librustc/middle/resolve.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,7 +3239,7 @@ impl<'a> Resolver<'a> {
32393239
segment_name),
32403240
}
32413241
} else {
3242-
format!("Could not find `{}` in `{}`.",
3242+
format!("Could not find `{}` in `{}`",
32433243
segment_name,
32443244
module_name)
32453245
};
@@ -4744,7 +4744,7 @@ impl<'a> Resolver<'a> {
47444744
Some(&DefMod(_)) => {
47454745
self.resolve_error(path.span, "inherent implementations are not \
47464746
allowed for types not defined in \
4747-
the current module.");
4747+
the current module");
47484748
}
47494749
_ => {}
47504750
}
@@ -5843,12 +5843,12 @@ impl<'a> Resolver<'a> {
58435843
};
58445844

58455845
if msg.len() > 0 {
5846-
msg = format!(" Did you mean {}?", msg)
5846+
msg = format!(". Did you mean {}?", msg)
58475847
}
58485848

58495849
self.resolve_error(
58505850
expr.span,
5851-
format!("unresolved name `{}`.{}",
5851+
format!("unresolved name `{}`{}",
58525852
wrong_name,
58535853
msg).as_slice());
58545854
}

src/librustc/middle/typeck/collect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<'a, 'tcx> AstConv<'tcx> for CrateCtxt<'a, 'tcx> {
184184

185185
fn ty_infer(&self, span: Span) -> Ty<'tcx> {
186186
span_err!(self.tcx.sess, span, E0121,
187-
"the type placeholder `_` is not allowed within types on item signatures.");
187+
"the type placeholder `_` is not allowed within types on item signatures");
188188
ty::mk_err()
189189
}
190190

@@ -1715,7 +1715,7 @@ fn add_unsized_bound<'tcx,AC>(this: &AC,
17151715
the given bound is not \
17161716
a default. \
17171717
Only `Sized?` is \
1718-
supported.",
1718+
supported",
17191719
desc).as_slice());
17201720
ty::try_add_builtin_trait(this.tcx(),
17211721
kind_id,

src/librustc/middle/typeck/infer/error_reporting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,15 +1648,15 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
16481648
self.tcx.sess.span_note(
16491649
span,
16501650
format!("...so that the type `{}` \
1651-
will meet the declared lifetime bounds.",
1651+
will meet the declared lifetime bounds",
16521652
self.ty_to_string(t)).as_slice());
16531653
}
16541654
infer::RelateDefaultParamBound(span, t) => {
16551655
self.tcx.sess.span_note(
16561656
span,
16571657
format!("...so that type parameter \
16581658
instantiated with `{}`, \
1659-
will meet its declared lifetime bounds.",
1659+
will meet its declared lifetime bounds",
16601660
self.ty_to_string(t)).as_slice());
16611661
}
16621662
infer::RelateRegionParamBound(span) => {

src/libsyntax/ext/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
6464
match state {
6565
Asm => {
6666
let (s, style) = match expr_to_string(cx, p.parse_expr(),
67-
"inline assembly must be a string literal.") {
67+
"inline assembly must be a string literal") {
6868
Some((s, st)) => (s, st),
6969
// let compilation continue
7070
None => return DummyResult::expr(sp),

src/libsyntax/parse/attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'a> ParserAttr for Parser<'a> {
9999

100100
if permit_inner && self.eat(&token::Semi) {
101101
self.span_warn(span, "this inner attribute syntax is deprecated. \
102-
The new syntax is `#![foo]`, with a bang and no semicolon.");
102+
The new syntax is `#![foo]`, with a bang and no semicolon");
103103
style = ast::AttrInner;
104104
}
105105

src/libsyntax/parse/lexer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ impl<'a> StringReader<'a> {
809809
self.span_diagnostic.span_help(
810810
sp,
811811
"this is an isolated carriage return; consider checking \
812-
your editor and version control settings.")
812+
your editor and version control settings")
813813
}
814814
false
815815
}

src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ extern crate macro_crate_test;
2020
fn main() {
2121
macro_crate_test::foo();
2222
//~^ ERROR failed to resolve. Use of undeclared module `macro_crate_test`
23-
//~^^ ERROR unresolved name `macro_crate_test::foo`.
23+
//~^^ ERROR unresolved name `macro_crate_test::foo`
2424
}

src/test/compile-fail/does-nothing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: unresolved name `this_does_nothing_what_the`.
11+
// error-pattern: unresolved name `this_does_nothing_what_the`
1212
fn main() { println!("doing"); this_does_nothing_what_the; println!("boing"); }

src/test/compile-fail/import2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use baz::zed::bar;
12-
//~^ ERROR unresolved import `baz::zed::bar`. Could not find `zed` in `baz`.
12+
//~^ ERROR unresolved import `baz::zed::bar`. Could not find `zed` in `baz`
1313

1414

1515
mod baz {}

src/test/compile-fail/issue-1476.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
println!("{}", x); //~ ERROR unresolved name `x`.
12+
println!("{}", x); //~ ERROR unresolved name `x`
1313
}

0 commit comments

Comments
 (0)