Skip to content

Commit 696fbc0

Browse files
committed
resolve: Avoid sentence breaks in diagnostics
1 parent 738d27f commit 696fbc0

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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

0 commit comments

Comments
 (0)