Skip to content

Commit

Permalink
Adjust some error messages to start with a lowercase letter and not f…
Browse files Browse the repository at this point in the history
…inish with a full stop
  • Loading branch information
ftxqxd committed Nov 30, 2014
1 parent dbbb722 commit 432adc6
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 68 deletions.
8 changes: 4 additions & 4 deletions src/librustc/middle/resolve.rs
Expand Up @@ -3239,7 +3239,7 @@ impl<'a> Resolver<'a> {
segment_name),
}
} else {
format!("Could not find `{}` in `{}`.",
format!("Could not find `{}` in `{}`",
segment_name,
module_name)
};
Expand Down Expand Up @@ -4744,7 +4744,7 @@ impl<'a> Resolver<'a> {
Some(&DefMod(_)) => {
self.resolve_error(path.span, "inherent implementations are not \
allowed for types not defined in \
the current module.");
the current module");
}
_ => {}
}
Expand Down Expand Up @@ -5843,12 +5843,12 @@ impl<'a> Resolver<'a> {
};

if msg.len() > 0 {
msg = format!(" Did you mean {}?", msg)
msg = format!(". Did you mean {}?", msg)
}

self.resolve_error(
expr.span,
format!("unresolved name `{}`.{}",
format!("unresolved name `{}`{}",
wrong_name,
msg).as_slice());
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/collect.rs
Expand Up @@ -184,7 +184,7 @@ impl<'a, 'tcx> AstConv<'tcx> for CrateCtxt<'a, 'tcx> {

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

Expand Down Expand Up @@ -1715,7 +1715,7 @@ fn add_unsized_bound<'tcx,AC>(this: &AC,
the given bound is not \
a default. \
Only `Sized?` is \
supported.",
supported",
desc).as_slice());
ty::try_add_builtin_trait(this.tcx(),
kind_id,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/infer/error_reporting.rs
Expand Up @@ -1648,15 +1648,15 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
self.tcx.sess.span_note(
span,
format!("...so that the type `{}` \
will meet the declared lifetime bounds.",
will meet the declared lifetime bounds",
self.ty_to_string(t)).as_slice());
}
infer::RelateDefaultParamBound(span, t) => {
self.tcx.sess.span_note(
span,
format!("...so that type parameter \
instantiated with `{}`, \
will meet its declared lifetime bounds.",
will meet its declared lifetime bounds",
self.ty_to_string(t)).as_slice());
}
infer::RelateRegionParamBound(span) => {
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ext/asm.rs
Expand Up @@ -64,7 +64,7 @@ pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
match state {
Asm => {
let (s, style) = match expr_to_string(cx, p.parse_expr(),
"inline assembly must be a string literal.") {
"inline assembly must be a string literal") {
Some((s, st)) => (s, st),
// let compilation continue
None => return DummyResult::expr(sp),
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/parse/attr.rs
Expand Up @@ -99,7 +99,7 @@ impl<'a> ParserAttr for Parser<'a> {

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

Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/parse/lexer/mod.rs
Expand Up @@ -809,7 +809,7 @@ impl<'a> StringReader<'a> {
self.span_diagnostic.span_help(
sp,
"this is an isolated carriage return; consider checking \
your editor and version control settings.")
your editor and version control settings")
}
false
}
Expand Down
Expand Up @@ -20,5 +20,5 @@ extern crate macro_crate_test;
fn main() {
macro_crate_test::foo();
//~^ ERROR failed to resolve. Use of undeclared module `macro_crate_test`
//~^^ ERROR unresolved name `macro_crate_test::foo`.
//~^^ ERROR unresolved name `macro_crate_test::foo`
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/does-nothing.rs
Expand Up @@ -8,5 +8,5 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// error-pattern: unresolved name `this_does_nothing_what_the`.
// error-pattern: unresolved name `this_does_nothing_what_the`
fn main() { println!("doing"); this_does_nothing_what_the; println!("boing"); }
2 changes: 1 addition & 1 deletion src/test/compile-fail/import2.rs
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

use baz::zed::bar;
//~^ ERROR unresolved import `baz::zed::bar`. Could not find `zed` in `baz`.
//~^ ERROR unresolved import `baz::zed::bar`. Could not find `zed` in `baz`


mod baz {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-1476.rs
Expand Up @@ -9,5 +9,5 @@
// except according to those terms.

fn main() {
println!("{}", x); //~ ERROR unresolved name `x`.
println!("{}", x); //~ ERROR unresolved name `x`
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-2281-part1.rs
Expand Up @@ -8,6 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// error-pattern: unresolved name `foobar`.
// error-pattern: unresolved name `foobar`

fn main() { println!("{}", foobar); }
6 changes: 3 additions & 3 deletions src/test/compile-fail/issue-2356.rs
Expand Up @@ -25,7 +25,7 @@ impl MaybeDog {
fn bark() {
// If this provides a suggestion, it's a bug as MaybeDog doesn't impl Groom
shave();
//~^ ERROR: unresolved name `shave`.
//~^ ERROR: unresolved name `shave`
}
}

Expand Down Expand Up @@ -67,7 +67,7 @@ impl cat {
grow_older();
//~^ ERROR: unresolved name `grow_older`. Did you mean to call `cat::grow_older`
shave();
//~^ ERROR: unresolved name `shave`.
//~^ ERROR: unresolved name `shave`
}

fn burn_whiskers(&mut self) {
Expand All @@ -85,6 +85,6 @@ impl cat {

fn main() {
self += 1;
//~^ ERROR: unresolved name `self`.
//~^ ERROR: unresolved name `self`
// it's a bug if this suggests a missing `self` as we're not in a method
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-3021-b.rs
Expand Up @@ -17,7 +17,7 @@ fn siphash(k0 : u64) {
impl siphash {
pub fn reset(&mut self) {
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
//~^ ERROR unresolved name `k0`.
//~^ ERROR unresolved name `k0`
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/issue-3021-d.rs
Expand Up @@ -29,9 +29,9 @@ fn siphash(k0 : u64, k1 : u64) -> siphash {
impl siphash for SipState {
fn reset(&self) {
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
//~^ ERROR unresolved name `k0`.
//~^ ERROR unresolved name `k0`
self.v1 = k1 ^ 0x646f72616e646f6d; //~ ERROR can't capture dynamic environment
//~^ ERROR unresolved name `k1`.
//~^ ERROR unresolved name `k1`
}
fn result(&self) -> u64 { return mk_result(self); }
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-3021.rs
Expand Up @@ -20,7 +20,7 @@ fn siphash(k0 : u64) -> SipHash {
impl SipHash for SipState {
fn reset(&self) {
self.v0 = k0 ^ 0x736f6d6570736575; //~ ERROR can't capture dynamic environment
//~^ ERROR unresolved name `k0`.
//~^ ERROR unresolved name `k0`
}
}
panic!();
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-7607-1.rs
Expand Up @@ -14,7 +14,7 @@ struct Foo {
x: int
}

impl Fo { //~ERROR inherent implementations are not allowed for types not defined in the current module.
impl Fo { //~ERROR inherent implementations are not allowed for types not defined in the current module
fn foo() {}
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/issue-8767.rs
Expand Up @@ -10,7 +10,7 @@

// ignore-tidy-linelength

impl B { //~ERROR inherent implementations are not allowed for types not defined in the current module.
impl B { //~ERROR inherent implementations are not allowed for types not defined in the current module
}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/match-join.rs
Expand Up @@ -16,6 +16,6 @@ fn my_panic() -> ! { panic!(); }
fn main() {
match true { false => { my_panic(); } true => { } }

println!("{}", x); //~ ERROR unresolved name `x`.
println!("{}", x); //~ ERROR unresolved name `x`
let x: int;
}
4 changes: 2 additions & 2 deletions src/test/compile-fail/privacy-ns1.rs
Expand Up @@ -28,7 +28,7 @@ pub mod foo1 {
fn test_glob1() {
use foo1::*;

Bar(); //~ ERROR unresolved name `Bar`.
Bar(); //~ ERROR unresolved name `Bar`
}

// private type, public value
Expand Down Expand Up @@ -58,7 +58,7 @@ pub mod foo3 {
fn test_glob3() {
use foo3::*;

Bar(); //~ ERROR unresolved name `Bar`.
Bar(); //~ ERROR unresolved name `Bar`
let _x: Box<Bar>; //~ ERROR use of undeclared type name `Bar`
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/test-cfg.rs
Expand Up @@ -14,5 +14,5 @@
fn foo() {}

fn main() {
foo(); //~ ERROR unresolved name `foo`.
foo(); //~ ERROR unresolved name `foo`
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/trait-or-new-type-instead.rs
Expand Up @@ -10,7 +10,7 @@

// ignore-tidy-linelength

impl<T> Option<T> { //~ERROR inherent implementations are not allowed for types not defined in the current module.
impl<T> Option<T> { //~ERROR inherent implementations are not allowed for types not defined in the current module
pub fn foo(&self) { }
}

Expand Down
68 changes: 34 additions & 34 deletions src/test/compile-fail/typeck_type_placeholder_item.rs
Expand Up @@ -12,108 +12,108 @@
// inference by using the `_` type placeholder.

fn test() -> _ { 5 }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn test2() -> (_, _) { (5u, 5u) }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures

static TEST3: _ = "test";
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

static TEST4: _ = 145u16;
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

static TEST5: (_, _) = (1, 2);
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn test6(_: _) { }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn test7(x: _) { let _x: uint = x; }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn test8(_f: fn() -> _) { }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

struct Test9;

impl Test9 {
fn test9(&self) -> _ { () }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn test10(&self, _x : _) { }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
}

impl Clone for Test9 {
fn clone(&self) -> _ { Test9 }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn clone_from(&mut self, other: _) { *self = Test9; }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
}

struct Test10 {
a: _,
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
b: (_, _),
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures
}

pub fn main() {
fn fn_test() -> _ { 5 }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn fn_test2() -> (_, _) { (5u, 5u) }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures

static FN_TEST3: _ = "test";
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

static FN_TEST4: _ = 145u16;
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

static FN_TEST5: (_, _) = (1, 2);
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn fn_test6(_: _) { }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn fn_test7(x: _) { let _x: uint = x; }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn fn_test8(_f: fn() -> _) { }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

struct FnTest9;

impl FnTest9 {
fn fn_test9(&self) -> _ { () }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn fn_test10(&self, _x : _) { }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
}

impl Clone for FnTest9 {
fn clone(&self) -> _ { FnTest9 }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures

fn clone_from(&mut self, other: _) { *self = FnTest9; }
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
}

struct FnTest10 {
a: _,
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
b: (_, _),
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures.
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~^^ ERROR the type placeholder `_` is not allowed within types on item signatures
}

}

5 comments on commit 432adc6

@bors
Copy link
Contributor

@bors bors commented on 432adc6 Nov 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at ftxqxd@432adc6

@bors
Copy link
Contributor

@bors bors commented on 432adc6 Nov 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging P1start/rust/error-message-fixes = 432adc6 into auto

@bors
Copy link
Contributor

@bors bors commented on 432adc6 Nov 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1start/rust/error-message-fixes = 432adc6 merged ok, testing candidate = acad03a

@bors
Copy link
Contributor

@bors bors commented on 432adc6 Nov 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 432adc6 Nov 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = acad03a

Please sign in to comment.