Skip to content

Commit bb5ffdc

Browse files
committed
resolve: Avoid sentence breaks in diagnostics
1 parent 1e7305b commit bb5ffdc

File tree

89 files changed

+187
-187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+187
-187
lines changed

src/librustc_resolve/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ Erroneous code example:
12531253
12541254
```compile_fail,E0433
12551255
let map = HashMap::new();
1256-
// error: failed to resolve. Use of undeclared type or module `HashMap`
1256+
// error: failed to resolve: use of undeclared type or module `HashMap`
12571257
```
12581258
12591259
Please verify you didn't misspell the type/module's name or that you didn't

src/librustc_resolve/error_reporting.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
5252
/// ```
5353
/// |
5454
/// LL | use foo::Bar;
55-
/// | ^^^ Did you mean `self::foo`?
55+
/// | ^^^ did you mean `self::foo`?
5656
/// ```
5757
fn make_missing_self_suggestion(
5858
&mut self,
@@ -76,7 +76,7 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
7676
/// ```
7777
/// |
7878
/// LL | use foo::Bar;
79-
/// | ^^^ Did you mean `crate::foo`?
79+
/// | ^^^ did you mean `crate::foo`?
8080
/// ```
8181
fn make_missing_crate_suggestion(
8282
&mut self,
@@ -107,7 +107,7 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
107107
/// ```
108108
/// |
109109
/// LL | use foo::Bar;
110-
/// | ^^^ Did you mean `super::foo`?
110+
/// | ^^^ did you mean `super::foo`?
111111
/// ```
112112
fn make_missing_super_suggestion(
113113
&mut self,
@@ -131,7 +131,7 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
131131
/// ```
132132
/// |
133133
/// LL | use foobar::Baz;
134-
/// | ^^^^^^ Did you mean `baz::foobar`?
134+
/// | ^^^^^^ did you mean `baz::foobar`?
135135
/// ```
136136
///
137137
/// Used when importing a submodule of an external crate but missing that crate's

src/librustc_resolve/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ fn resolve_struct_error<'sess, 'a>(resolver: &'sess Resolver,
386386
}
387387
ResolutionError::FailedToResolve(msg) => {
388388
let mut err = struct_span_err!(resolver.session, span, E0433,
389-
"failed to resolve. {}", msg);
389+
"failed to resolve: {}", msg);
390390
err.span_label(span, msg);
391391
err
392392
}
@@ -3663,7 +3663,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
36633663
continue;
36643664
}
36653665
}
3666-
let msg = "There are too many initial `super`s.".to_string();
3666+
let msg = "there are too many initial `super`s.".to_string();
36673667
return PathResult::Failed(ident.span, msg, false);
36683668
}
36693669
if i == 0 {
@@ -3755,7 +3755,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
37553755
));
37563756
} else {
37573757
return PathResult::Failed(ident.span,
3758-
format!("Not a module `{}`", ident),
3758+
format!("not a module `{}`", ident),
37593759
is_last);
37603760
}
37613761
}
@@ -3780,14 +3780,14 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
37803780
(c.path.segments.len(), c.path.to_string())
37813781
});
37823782
if let Some(candidate) = candidates.get(0) {
3783-
format!("Did you mean `{}`?", candidate.path)
3783+
format!("did you mean `{}`?", candidate.path)
37843784
} else {
3785-
format!("Maybe a missing `extern crate {};`?", ident)
3785+
format!("maybe a missing `extern crate {};`?", ident)
37863786
}
37873787
} else if i == 0 {
3788-
format!("Use of undeclared type or module `{}`", ident)
3788+
format!("use of undeclared type or module `{}`", ident)
37893789
} else {
3790-
format!("Could not find `{}` in `{}`", ident, path[i - 1])
3790+
format!("could not find `{}` in `{}`", ident, path[i - 1])
37913791
};
37923792
return PathResult::Failed(ident.span, msg, is_last);
37933793
}

src/librustc_resolve/resolve_imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
855855
) {
856856
Some((
857857
span,
858-
format!("Did you mean `{}`?", names_to_string(&suggested_path[..])),
858+
format!("did you mean `{}`?", names_to_string(&suggested_path[..])),
859859
note,
860860
))
861861
} else {

src/test/ui/absolute-paths-in-nested-use-groups.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
error[E0433]: failed to resolve. crate root in paths can only be used in start position
1+
error[E0433]: failed to resolve: crate root in paths can only be used in start position
22
--> $DIR/absolute-paths-in-nested-use-groups.rs:16:5
33
|
44
LL | ::bar, //~ ERROR crate root in paths can only be used in start position
55
| ^ crate root in paths can only be used in start position
66

7-
error[E0433]: failed to resolve. `super` in paths can only be used in start position
7+
error[E0433]: failed to resolve: `super` in paths can only be used in start position
88
--> $DIR/absolute-paths-in-nested-use-groups.rs:17:5
99
|
1010
LL | super::bar, //~ ERROR `super` in paths can only be used in start position
1111
| ^^^^^ `super` in paths can only be used in start position
1212

13-
error[E0433]: failed to resolve. `self` in paths can only be used in start position
13+
error[E0433]: failed to resolve: `self` in paths can only be used in start position
1414
--> $DIR/absolute-paths-in-nested-use-groups.rs:18:5
1515
|
1616
LL | self::bar, //~ ERROR `self` in paths can only be used in start position

src/test/ui/bad/bad-module.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
fn main() {
1212
let foo = thing::len(Vec::new());
13-
//~^ ERROR failed to resolve. Use of undeclared type or module `thing`
13+
//~^ ERROR failed to resolve: use of undeclared type or module `thing`
1414

1515
let foo = foo::bar::baz();
16-
//~^ ERROR failed to resolve. Use of undeclared type or module `foo`
16+
//~^ ERROR failed to resolve: use of undeclared type or module `foo`
1717
}

src/test/ui/bad/bad-module.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
error[E0433]: failed to resolve. Use of undeclared type or module `thing`
1+
error[E0433]: failed to resolve: use of undeclared type or module `thing`
22
--> $DIR/bad-module.rs:12:15
33
|
44
LL | let foo = thing::len(Vec::new());
5-
| ^^^^^ Use of undeclared type or module `thing`
5+
| ^^^^^ use of undeclared type or module `thing`
66

7-
error[E0433]: failed to resolve. Use of undeclared type or module `foo`
7+
error[E0433]: failed to resolve: use of undeclared type or module `foo`
88
--> $DIR/bad-module.rs:15:15
99
|
1010
LL | let foo = foo::bar::baz();
11-
| ^^^ Use of undeclared type or module `foo`
11+
| ^^^ use of undeclared type or module `foo`
1212

1313
error: aborting due to 2 previous errors
1414

src/test/ui/custom-attribute-multisegment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
mod existent {}
1616

17-
#[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent`
17+
#[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent`
1818
fn main() {}

src/test/ui/custom-attribute-multisegment.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0433]: failed to resolve. Could not find `nonexistent` in `existent`
1+
error[E0433]: failed to resolve: could not find `nonexistent` in `existent`
22
--> $DIR/custom-attribute-multisegment.rs:17:13
33
|
4-
LL | #[existent::nonexistent] //~ ERROR failed to resolve. Could not find `nonexistent` in `existent`
5-
| ^^^^^^^^^^^ Could not find `nonexistent` in `existent`
4+
LL | #[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent`
5+
| ^^^^^^^^^^^ could not find `nonexistent` in `existent`
66

77
error: aborting due to previous error
88

src/test/ui/derived-errors/issue-31997-1.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0433]: failed to resolve. Use of undeclared type or module `HashMap`
1+
error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
22
--> $DIR/issue-31997-1.rs:30:19
33
|
44
LL | let mut map = HashMap::new();
5-
| ^^^^^^^ Use of undeclared type or module `HashMap`
5+
| ^^^^^^^ use of undeclared type or module `HashMap`
66

77
error: aborting due to previous error
88

src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0433]: failed to resolve. `$crate` in paths can only be used in start position
1+
error[E0433]: failed to resolve: `$crate` in paths can only be used in start position
22
--> $DIR/dollar-crate-is-keyword-2.rs:16:16
33
|
44
LL | use a::$crate::b; //~ ERROR `$crate` in paths can only be used in start position
@@ -16,7 +16,7 @@ LL | use a::$crate; //~ ERROR unresolved import `a::$crate`
1616
LL | m!();
1717
| ----- in this macro invocation
1818

19-
error[E0433]: failed to resolve. `$crate` in paths can only be used in start position
19+
error[E0433]: failed to resolve: `$crate` in paths can only be used in start position
2020
--> $DIR/dollar-crate-is-keyword-2.rs:17:21
2121
|
2222
LL | type A = a::$crate; //~ ERROR `$crate` in paths can only be used in start position

src/test/ui/dyn-trait-compatibility.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
type A0 = dyn;
1212
//~^ ERROR cannot find type `dyn` in this scope
1313
type A1 = dyn::dyn;
14-
//~^ ERROR Use of undeclared type or module `dyn`
14+
//~^ ERROR use of undeclared type or module `dyn`
1515
type A2 = dyn<dyn, dyn>;
1616
//~^ ERROR cannot find type `dyn` in this scope
1717
//~| ERROR cannot find type `dyn` in this scope
1818
//~| ERROR cannot find type `dyn` in this scope
1919
type A3 = dyn<<dyn as dyn>::dyn>;
2020
//~^ ERROR cannot find type `dyn` in this scope
2121
//~| ERROR cannot find type `dyn` in this scope
22-
//~| ERROR Use of undeclared type or module `dyn`
22+
//~| ERROR use of undeclared type or module `dyn`
2323

2424
fn main() {}

src/test/ui/dyn-trait-compatibility.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
error[E0433]: failed to resolve. Use of undeclared type or module `dyn`
1+
error[E0433]: failed to resolve: use of undeclared type or module `dyn`
22
--> $DIR/dyn-trait-compatibility.rs:13:11
33
|
44
LL | type A1 = dyn::dyn;
5-
| ^^^ Use of undeclared type or module `dyn`
5+
| ^^^ use of undeclared type or module `dyn`
66

7-
error[E0433]: failed to resolve. Use of undeclared type or module `dyn`
7+
error[E0433]: failed to resolve: use of undeclared type or module `dyn`
88
--> $DIR/dyn-trait-compatibility.rs:19:23
99
|
1010
LL | type A3 = dyn<<dyn as dyn>::dyn>;
11-
| ^^^ Use of undeclared type or module `dyn`
11+
| ^^^ use of undeclared type or module `dyn`
1212

1313
error[E0412]: cannot find type `dyn` in this scope
1414
--> $DIR/dyn-trait-compatibility.rs:11:11

src/test/ui/error-codes/E0432.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `something`
22
--> $DIR/E0432.rs:11:5
33
|
44
LL | use something::Foo; //~ ERROR E0432
5-
| ^^^^^^^^^ Maybe a missing `extern crate something;`?
5+
| ^^^^^^^^^ maybe a missing `extern crate something;`?
66

77
error: aborting due to previous error
88

src/test/ui/error-codes/E0433.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0433]: failed to resolve. Use of undeclared type or module `HashMap`
1+
error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
22
--> $DIR/E0433.rs:12:15
33
|
44
LL | let map = HashMap::new(); //~ ERROR E0433
5-
| ^^^^^^^ Use of undeclared type or module `HashMap`
5+
| ^^^^^^^ use of undeclared type or module `HashMap`
66

77
error: aborting due to previous error
88

src/test/ui/export-fully-qualified.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// want to change eventually.
1414

1515
mod foo {
16-
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve. Use of undeclared type or module `foo`
16+
pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared type or module `foo`
1717

1818
fn baz() { }
1919
}

src/test/ui/export-fully-qualified.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0433]: failed to resolve. Use of undeclared type or module `foo`
1+
error[E0433]: failed to resolve: use of undeclared type or module `foo`
22
--> $DIR/export-fully-qualified.rs:16:20
33
|
4-
LL | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve. Use of undeclared type or module `foo`
5-
| ^^^ Use of undeclared type or module `foo`
4+
LL | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of undeclared type or module `foo`
5+
| ^^^ use of undeclared type or module `foo`
66

77
error: aborting due to previous error
88

src/test/ui/export2.rs

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

1111
mod foo {
12-
pub fn x() { bar::x(); } //~ ERROR failed to resolve. Use of undeclared type or module `bar`
12+
pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared type or module `bar`
1313
}
1414

1515
mod bar {

src/test/ui/export2.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0433]: failed to resolve. Use of undeclared type or module `bar`
1+
error[E0433]: failed to resolve: use of undeclared type or module `bar`
22
--> $DIR/export2.rs:12:18
33
|
4-
LL | pub fn x() { bar::x(); } //~ ERROR failed to resolve. Use of undeclared type or module `bar`
5-
| ^^^ Use of undeclared type or module `bar`
4+
LL | pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared type or module `bar`
5+
| ^^^ use of undeclared type or module `bar`
66

77
error: aborting due to previous error
88

src/test/ui/extern/extern-macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
fn main() {
1414
enum Foo {}
15-
let _ = Foo::bar!(); //~ ERROR failed to resolve. partially resolved path in a macro
15+
let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro
1616
}

src/test/ui/extern/extern-macro.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
error[E0433]: failed to resolve. partially resolved path in a macro
1+
error[E0433]: failed to resolve: partially resolved path in a macro
22
--> $DIR/extern-macro.rs:15:13
33
|
4-
LL | let _ = Foo::bar!(); //~ ERROR failed to resolve. partially resolved path in a macro
4+
LL | let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro
55
| ^^^^^^^^ partially resolved path in a macro
66

77
error: aborting due to previous error

src/test/ui/feature-gates/feature-gate-extern_absolute_paths.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ error[E0432]: unresolved import `core`
22
--> $DIR/feature-gate-extern_absolute_paths.rs:11:5
33
|
44
LL | use core::default; //~ ERROR unresolved import `core`
5-
| ^^^^ Maybe a missing `extern crate core;`?
5+
| ^^^^ maybe a missing `extern crate core;`?
66

7-
error[E0433]: failed to resolve. Maybe a missing `extern crate core;`?
7+
error[E0433]: failed to resolve: maybe a missing `extern crate core;`?
88
--> $DIR/feature-gate-extern_absolute_paths.rs:14:19
99
|
1010
LL | let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve
11-
| ^^^^ Maybe a missing `extern crate core;`?
11+
| ^^^^ maybe a missing `extern crate core;`?
1212

1313
error: aborting due to 2 previous errors
1414

src/test/ui/hygiene/no_implicit_prelude.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error[E0433]: failed to resolve. Use of undeclared type or module `Vec`
1+
error[E0433]: failed to resolve: use of undeclared type or module `Vec`
22
--> $DIR/no_implicit_prelude.rs:21:9
33
|
44
LL | fn f() { ::bar::m!(); }
55
| ------------ in this macro invocation
66
...
77
LL | Vec::new(); //~ ERROR failed to resolve
8-
| ^^^ Use of undeclared type or module `Vec`
8+
| ^^^ use of undeclared type or module `Vec`
99

1010
error[E0599]: no method named `clone` found for type `()` in the current scope
1111
--> $DIR/no_implicit_prelude.rs:22:12

src/test/ui/import2.rs

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

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

1414
mod baz {}
1515
mod zed {

src/test/ui/import2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `baz::zed`
22
--> $DIR/import2.rs:11:10
33
|
44
LL | use baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432]
5-
| ^^^ Could not find `zed` in `baz`
5+
| ^^^ could not find `zed` in `baz`
66

77
error: aborting due to previous error
88

src/test/ui/import3.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0432]: unresolved import `main`
22
--> $DIR/import3.rs:12:5
33
|
44
LL | use main::bar;
5-
| ^^^^ Maybe a missing `extern crate main;`?
5+
| ^^^^ maybe a missing `extern crate main;`?
66

77
error: aborting due to previous error
88

src/test/ui/imports/extern-prelude-extern-crate-fail.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mod n {
77

88
mod m {
99
fn check() {
10-
two_macros::m!(); //~ ERROR failed to resolve. Use of undeclared type or module `two_macros`
10+
two_macros::m!(); //~ ERROR failed to resolve: use of undeclared type or module `two_macros`
1111
}
1212
}
1313

src/test/ui/imports/extern-prelude-extern-crate-fail.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ LL | extern crate std as non_existent;
77
LL | define_std_as_non_existent!();
88
| ------------------------------ in this macro invocation
99

10-
error[E0433]: failed to resolve. Use of undeclared type or module `two_macros`
10+
error[E0433]: failed to resolve: use of undeclared type or module `two_macros`
1111
--> $DIR/extern-prelude-extern-crate-fail.rs:10:9
1212
|
13-
LL | two_macros::m!(); //~ ERROR failed to resolve. Use of undeclared type or module `two_macros`
14-
| ^^^^^^^^^^ Use of undeclared type or module `two_macros`
13+
LL | two_macros::m!(); //~ ERROR failed to resolve: use of undeclared type or module `two_macros`
14+
| ^^^^^^^^^^ use of undeclared type or module `two_macros`
1515

1616
error: aborting due to 2 previous errors
1717

0 commit comments

Comments
 (0)