Skip to content

Commit 4fc3c13

Browse files
committed
resolve: Avoid sentence breaks in diagnostics
1 parent f492e94 commit 4fc3c13

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
}
@@ -3738,7 +3738,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
37383738
continue;
37393739
}
37403740
}
3741-
let msg = "There are too many initial `super`s.".to_string();
3741+
let msg = "there are too many initial `super`s.".to_string();
37423742
return PathResult::Failed(ident.span, msg, false);
37433743
}
37443744
if i == 0 {
@@ -3832,7 +3832,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
38323832
));
38333833
} else {
38343834
return PathResult::Failed(ident.span,
3835-
format!("Not a module `{}`", ident),
3835+
format!("not a module `{}`", ident),
38363836
is_last);
38373837
}
38383838
}
@@ -3857,14 +3857,14 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
38573857
(c.path.segments.len(), c.path.to_string())
38583858
});
38593859
if let Some(candidate) = candidates.get(0) {
3860-
format!("Did you mean `{}`?", candidate.path)
3860+
format!("did you mean `{}`?", candidate.path)
38613861
} else {
3862-
format!("Maybe a missing `extern crate {};`?", ident)
3862+
format!("maybe a missing `extern crate {};`?", ident)
38633863
}
38643864
} else if i == 0 {
3865-
format!("Use of undeclared type or module `{}`", ident)
3865+
format!("use of undeclared type or module `{}`", ident)
38663866
} else {
3867-
format!("Could not find `{}` in `{}`", ident, path[i - 1].ident)
3867+
format!("could not find `{}` in `{}`", ident, path[i - 1].ident)
38683868
};
38693869
return PathResult::Failed(ident.span, msg, is_last);
38703870
}

src/librustc_resolve/resolve_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
857857
) {
858858
Some((
859859
span,
860-
format!("Did you mean `{}`?", Segment::names_to_string(&suggested_path)),
860+
format!("did you mean `{}`?", Segment::names_to_string(&suggested_path)),
861861
note,
862862
))
863863
} 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)