From 432adc675e2955cbc639cbecf318dc23e053e7e2 Mon Sep 17 00:00:00 2001 From: P1start Date: Fri, 28 Nov 2014 19:01:41 +1300 Subject: [PATCH] Adjust some error messages to start with a lowercase letter and not finish with a full stop --- src/librustc/middle/resolve.rs | 8 +-- src/librustc/middle/typeck/collect.rs | 4 +- .../middle/typeck/infer/error_reporting.rs | 4 +- src/libsyntax/ext/asm.rs | 2 +- src/libsyntax/parse/attr.rs | 2 +- src/libsyntax/parse/lexer/mod.rs | 2 +- .../phase-syntax-doesnt-resolve.rs | 2 +- src/test/compile-fail/does-nothing.rs | 2 +- src/test/compile-fail/import2.rs | 2 +- src/test/compile-fail/issue-1476.rs | 2 +- src/test/compile-fail/issue-2281-part1.rs | 2 +- src/test/compile-fail/issue-2356.rs | 6 +- src/test/compile-fail/issue-3021-b.rs | 2 +- src/test/compile-fail/issue-3021-d.rs | 4 +- src/test/compile-fail/issue-3021.rs | 2 +- src/test/compile-fail/issue-7607-1.rs | 2 +- src/test/compile-fail/issue-8767.rs | 2 +- src/test/compile-fail/match-join.rs | 2 +- src/test/compile-fail/privacy-ns1.rs | 4 +- src/test/compile-fail/test-cfg.rs | 2 +- .../compile-fail/trait-or-new-type-instead.rs | 2 +- .../typeck_type_placeholder_item.rs | 68 +++++++++---------- src/test/compile-fail/utf8_idents.rs | 8 +-- 23 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs index ae32a10f3140b..7cfe66cdc3338 100644 --- a/src/librustc/middle/resolve.rs +++ b/src/librustc/middle/resolve.rs @@ -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) }; @@ -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"); } _ => {} } @@ -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()); } diff --git a/src/librustc/middle/typeck/collect.rs b/src/librustc/middle/typeck/collect.rs index 3a62978ed007a..2bb6f4ad61927 100644 --- a/src/librustc/middle/typeck/collect.rs +++ b/src/librustc/middle/typeck/collect.rs @@ -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() } @@ -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, diff --git a/src/librustc/middle/typeck/infer/error_reporting.rs b/src/librustc/middle/typeck/infer/error_reporting.rs index b171fdc7092c1..0607ccdc595a2 100644 --- a/src/librustc/middle/typeck/infer/error_reporting.rs +++ b/src/librustc/middle/typeck/infer/error_reporting.rs @@ -1648,7 +1648,7 @@ 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) => { @@ -1656,7 +1656,7 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> { 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) => { diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs index d04144ef26e59..f56cdd4a12264 100644 --- a/src/libsyntax/ext/asm.rs +++ b/src/libsyntax/ext/asm.rs @@ -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), diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index 0c919daa8ed11..db7bc6c323f89 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -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; } diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index b5358e7d4859d..57983a6dee6be 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -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 } diff --git a/src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs b/src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs index 3814656282585..3972d01850e63 100644 --- a/src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs +++ b/src/test/compile-fail-fulldeps/phase-syntax-doesnt-resolve.rs @@ -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` } diff --git a/src/test/compile-fail/does-nothing.rs b/src/test/compile-fail/does-nothing.rs index 9b82ead042859..c0cd406f062b3 100644 --- a/src/test/compile-fail/does-nothing.rs +++ b/src/test/compile-fail/does-nothing.rs @@ -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"); } diff --git a/src/test/compile-fail/import2.rs b/src/test/compile-fail/import2.rs index f674d19ca5c9a..6533bd5ddc610 100644 --- a/src/test/compile-fail/import2.rs +++ b/src/test/compile-fail/import2.rs @@ -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 {} diff --git a/src/test/compile-fail/issue-1476.rs b/src/test/compile-fail/issue-1476.rs index 01683d001ac16..73a0e0c0775ee 100644 --- a/src/test/compile-fail/issue-1476.rs +++ b/src/test/compile-fail/issue-1476.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - println!("{}", x); //~ ERROR unresolved name `x`. + println!("{}", x); //~ ERROR unresolved name `x` } diff --git a/src/test/compile-fail/issue-2281-part1.rs b/src/test/compile-fail/issue-2281-part1.rs index 14096ca7bca18..f59252dd3154b 100644 --- a/src/test/compile-fail/issue-2281-part1.rs +++ b/src/test/compile-fail/issue-2281-part1.rs @@ -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); } diff --git a/src/test/compile-fail/issue-2356.rs b/src/test/compile-fail/issue-2356.rs index 4d9e56a21f804..850edd05781a2 100644 --- a/src/test/compile-fail/issue-2356.rs +++ b/src/test/compile-fail/issue-2356.rs @@ -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` } } @@ -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) { @@ -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 } diff --git a/src/test/compile-fail/issue-3021-b.rs b/src/test/compile-fail/issue-3021-b.rs index daef77f63141e..5c539cd739cef 100644 --- a/src/test/compile-fail/issue-3021-b.rs +++ b/src/test/compile-fail/issue-3021-b.rs @@ -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` } } } diff --git a/src/test/compile-fail/issue-3021-d.rs b/src/test/compile-fail/issue-3021-d.rs index ddb33f1e61a81..594f68e1812af 100644 --- a/src/test/compile-fail/issue-3021-d.rs +++ b/src/test/compile-fail/issue-3021-d.rs @@ -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); } } diff --git a/src/test/compile-fail/issue-3021.rs b/src/test/compile-fail/issue-3021.rs index 578f100eba40b..719eef1b63d5d 100644 --- a/src/test/compile-fail/issue-3021.rs +++ b/src/test/compile-fail/issue-3021.rs @@ -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!(); diff --git a/src/test/compile-fail/issue-7607-1.rs b/src/test/compile-fail/issue-7607-1.rs index 37878084f0353..9bf1bd2e011bb 100644 --- a/src/test/compile-fail/issue-7607-1.rs +++ b/src/test/compile-fail/issue-7607-1.rs @@ -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() {} } diff --git a/src/test/compile-fail/issue-8767.rs b/src/test/compile-fail/issue-8767.rs index c6bb460382c88..6c5bac5e0cb34 100644 --- a/src/test/compile-fail/issue-8767.rs +++ b/src/test/compile-fail/issue-8767.rs @@ -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() { diff --git a/src/test/compile-fail/match-join.rs b/src/test/compile-fail/match-join.rs index 8064ef0e427a3..e78561b9fdb68 100644 --- a/src/test/compile-fail/match-join.rs +++ b/src/test/compile-fail/match-join.rs @@ -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; } diff --git a/src/test/compile-fail/privacy-ns1.rs b/src/test/compile-fail/privacy-ns1.rs index b7eee206b4074..2862268b55257 100644 --- a/src/test/compile-fail/privacy-ns1.rs +++ b/src/test/compile-fail/privacy-ns1.rs @@ -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 @@ -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; //~ ERROR use of undeclared type name `Bar` } diff --git a/src/test/compile-fail/test-cfg.rs b/src/test/compile-fail/test-cfg.rs index 8be1c35ae5cca..0709d9095124e 100644 --- a/src/test/compile-fail/test-cfg.rs +++ b/src/test/compile-fail/test-cfg.rs @@ -14,5 +14,5 @@ fn foo() {} fn main() { - foo(); //~ ERROR unresolved name `foo`. + foo(); //~ ERROR unresolved name `foo` } diff --git a/src/test/compile-fail/trait-or-new-type-instead.rs b/src/test/compile-fail/trait-or-new-type-instead.rs index c4b4d19728362..e621d77a65c8d 100644 --- a/src/test/compile-fail/trait-or-new-type-instead.rs +++ b/src/test/compile-fail/trait-or-new-type-instead.rs @@ -10,7 +10,7 @@ // ignore-tidy-linelength -impl Option { //~ERROR inherent implementations are not allowed for types not defined in the current module. +impl Option { //~ERROR inherent implementations are not allowed for types not defined in the current module pub fn foo(&self) { } } diff --git a/src/test/compile-fail/typeck_type_placeholder_item.rs b/src/test/compile-fail/typeck_type_placeholder_item.rs index 67300f9bb9be4..723c5fda3a7d3 100644 --- a/src/test/compile-fail/typeck_type_placeholder_item.rs +++ b/src/test/compile-fail/typeck_type_placeholder_item.rs @@ -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 } } diff --git a/src/test/compile-fail/utf8_idents.rs b/src/test/compile-fail/utf8_idents.rs index 0c3c11ccd07b3..9bd14305b9a40 100644 --- a/src/test/compile-fail/utf8_idents.rs +++ b/src/test/compile-fail/utf8_idents.rs @@ -11,14 +11,14 @@ // ignore-lexer-test FIXME #15679 fn foo< - 'β, //~ ERROR non-ascii idents are not fully supported. - γ //~ ERROR non-ascii idents are not fully supported. + 'β, //~ ERROR non-ascii idents are not fully supported + γ //~ ERROR non-ascii idents are not fully supported >() {} struct X { - δ: uint //~ ERROR non-ascii idents are not fully supported. + δ: uint //~ ERROR non-ascii idents are not fully supported } pub fn main() { - let α = 0.00001f64; //~ ERROR non-ascii idents are not fully supported. + let α = 0.00001f64; //~ ERROR non-ascii idents are not fully supported }