Skip to content

Commit 68aff3f

Browse files
committed
review comments: typo and rewording
1 parent 8756311 commit 68aff3f

18 files changed

+31
-31
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,8 +3711,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
37113711
if let Some(fn_span) = fn_span {
37123712
err.span_label(
37133713
fn_span,
3714-
"this function implicitly returns `()` as its body has no tail \
3715-
or `return` expression",
3714+
"implicitly returns `()` as its body has no tail or `return` \
3715+
expression",
37163716
);
37173717
}
37183718
}, false);
@@ -3880,10 +3880,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
38803880
sugg_call = fields.iter().map(|_| "_").collect::<Vec<_>>().join(", ");
38813881
match hir.as_local_hir_id(def_id).and_then(|hir_id| hir.def_kind(hir_id)) {
38823882
Some(hir::def::DefKind::Ctor(hir::def::CtorOf::Variant, _)) => {
3883-
msg = "instatiate this tuple variant";
3883+
msg = "instantiate this tuple variant";
38843884
}
38853885
Some(hir::def::DefKind::Ctor(hir::def::CtorOf::Struct, _)) => {
3886-
msg = "instatiate this tuple struct";
3886+
msg = "instantiate this tuple struct";
38873887
}
38883888
_ => {}
38893889
}

src/test/ui/block-result/consider-removing-last-semi.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn f() -> String {
55
| - ^^^^^^ expected struct `std::string::String`, found ()
66
| |
7-
| this function implicitly returns `()` as its body has no tail or `return` expression
7+
| implicitly returns `()` as its body has no tail or `return` expression
88
LL | 0u8;
99
LL | "bla".to_string();
1010
| - help: consider removing this semicolon
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
1818
LL | fn g() -> String {
1919
| - ^^^^^^ expected struct `std::string::String`, found ()
2020
| |
21-
| this function implicitly returns `()` as its body has no tail or `return` expression
21+
| implicitly returns `()` as its body has no tail or `return` expression
2222
LL | "this won't work".to_string();
2323
LL | "removeme".to_string();
2424
| - help: consider removing this semicolon

src/test/ui/block-result/issue-11714.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn blah() -> i32 {
55
| ---- ^^^ expected i32, found ()
66
| |
7-
| this function implicitly returns `()` as its body has no tail or `return` expression
7+
| implicitly returns `()` as its body has no tail or `return` expression
88
...
99
LL | ;
1010
| - help: consider removing this semicolon

src/test/ui/block-result/issue-13428.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn foo() -> String {
55
| --- ^^^^^^ expected struct `std::string::String`, found ()
66
| |
7-
| this function implicitly returns `()` as its body has no tail or `return` expression
7+
| implicitly returns `()` as its body has no tail or `return` expression
88
...
99
LL | ;
1010
| - help: consider removing this semicolon
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
1818
LL | fn bar() -> String {
1919
| --- ^^^^^^ expected struct `std::string::String`, found ()
2020
| |
21-
| this function implicitly returns `()` as its body has no tail or `return` expression
21+
| implicitly returns `()` as its body has no tail or `return` expression
2222
LL | "foobar".to_string()
2323
LL | ;
2424
| - help: consider removing this semicolon

src/test/ui/coercion/coercion-missing-tail-expected-type.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn plus_one(x: i32) -> i32 {
55
| -------- ^^^ expected i32, found ()
66
| |
7-
| this function implicitly returns `()` as its body has no tail or `return` expression
7+
| implicitly returns `()` as its body has no tail or `return` expression
88
LL | x + 1;
99
| - help: consider removing this semicolon
1010
|
@@ -17,7 +17,7 @@ error[E0308]: mismatched types
1717
LL | fn foo() -> Result<u8, u64> {
1818
| --- ^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
1919
| |
20-
| this function implicitly returns `()` as its body has no tail or `return` expression
20+
| implicitly returns `()` as its body has no tail or `return` expression
2121
LL | Ok(1);
2222
| - help: consider removing this semicolon
2323
|

src/test/ui/issues/issue-32323.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {}
55
| - ^^^^^^^^^^^^^^^^^^ expected associated type, found ()
66
| |
7-
| this function implicitly returns `()` as its body has no tail or `return` expression
7+
| implicitly returns `()` as its body has no tail or `return` expression
88
|
99
= note: expected type `<T as Tr<'a>>::Out`
1010
found type `()`

src/test/ui/issues/issue-35241.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | fn test() -> Foo { Foo }
88
| --- ^^^
99
| | |
1010
| | expected struct `Foo`, found fn item
11-
| | help: use parentheses to instatiate this tuple struct: `Foo(_)`
11+
| | help: use parentheses to instantiate this tuple struct: `Foo(_)`
1212
| expected `Foo` because of return type
1313
|
1414
= note: expected type `Foo`

src/test/ui/issues/issue-43162.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ error[E0308]: mismatched types
1616
LL | fn foo() -> bool {
1717
| --- ^^^^ expected bool, found ()
1818
| |
19-
| this function implicitly returns `()` as its body has no tail or `return` expression
19+
| implicitly returns `()` as its body has no tail or `return` expression
2020
LL |
2121
LL | break true;
2222
| - help: consider removing this semicolon

src/test/ui/issues/issue-44023.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn საჭმელად_გემრიელი_სადილი ( ) -> isize {
55
| ------------------------ ^^^^^ expected isize, found ()
66
| |
7-
| this function implicitly returns `()` as its body has no tail or `return` expression
7+
| implicitly returns `()` as its body has no tail or `return` expression
88
|
99
= note: expected type `isize`
1010
found type `()`

src/test/ui/issues/issue-6458-4.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn foo(b: bool) -> Result<bool,String> {
55
| --- ^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
66
| |
7-
| this function implicitly returns `()` as its body has no tail or `return` expression
7+
| implicitly returns `()` as its body has no tail or `return` expression
88
LL | Err("bar".to_string());
99
| - help: consider removing this semicolon
1010
|

0 commit comments

Comments
 (0)