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

+4-4
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

+2-2
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

+1-1
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

+2-2
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

+2-2
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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
|

src/test/ui/liveness/liveness-forgot-ret.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; }
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/liveness/liveness-missing-ret2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn f() -> 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/liveness/liveness-return-last-stmt-semi.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
55
| --- ^^^ - help: consider removing this semicolon
66
| | |
77
| | expected i32, found ()
8-
| this function implicitly returns `()` as its body has no tail or `return` expression
8+
| implicitly returns `()` as its body has no tail or `return` expression
99
...
1010
LL | test!();
1111
| -------- in this macro invocation
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
1919
LL | fn no_return() -> i32 {}
2020
| --------- ^^^ expected i32, found ()
2121
| |
22-
| this function implicitly returns `()` as its body has no tail or `return` expression
22+
| implicitly returns `()` as its body has no tail or `return` expression
2323
|
2424
= note: expected type `i32`
2525
found type `()`
@@ -30,7 +30,7 @@ error[E0308]: mismatched types
3030
LL | fn bar(x: u32) -> u32 {
3131
| --- ^^^ expected u32, found ()
3232
| |
33-
| this function implicitly returns `()` as its body has no tail or `return` expression
33+
| implicitly returns `()` as its body has no tail or `return` expression
3434
LL | x * 2;
3535
| - help: consider removing this semicolon
3636
|
@@ -43,7 +43,7 @@ error[E0308]: mismatched types
4343
LL | fn baz(x: u64) -> u32 {
4444
| --- ^^^ expected u32, found ()
4545
| |
46-
| this function implicitly returns `()` as its body has no tail or `return` expression
46+
| implicitly returns `()` as its body has no tail or `return` expression
4747
|
4848
= note: expected type `u32`
4949
found type `()`

src/test/ui/missing/missing-return.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
44
LL | fn f() -> 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/parser/issue-62881.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ error[E0308]: mismatched types
1919
LL | fn f() -> isize { fn f() -> isize {} pub f<
2020
| - ^^^^^ expected isize, found ()
2121
| |
22-
| this function implicitly returns `()` as its body has no tail or `return` expression
22+
| implicitly returns `()` as its body has no tail or `return` expression
2323
|
2424
= note: expected type `isize`
2525
found type `()`

src/test/ui/parser/issue-62895.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ error[E0308]: mismatched types
3838
LL | fn v() -> isize {
3939
| - ^^^^^ expected isize, found ()
4040
| |
41-
| this function implicitly returns `()` as its body has no tail or `return` expression
41+
| implicitly returns `()` as its body has no tail or `return` expression
4242
|
4343
= note: expected type `isize`
4444
found type `()`

src/test/ui/resolve/privacy-enum-ctor.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ LL | let _: Z = Z::Fn;
202202
| ^^^^^
203203
| |
204204
| expected enum `m::n::Z`, found fn item
205-
| help: use parentheses to instatiate this tuple variant: `Z::Fn(_)`
205+
| help: use parentheses to instantiate this tuple variant: `Z::Fn(_)`
206206
|
207207
= note: expected type `m::n::Z`
208208
found type `fn(u8) -> m::n::Z {m::n::Z::Fn}`
@@ -232,7 +232,7 @@ LL | let _: E = m::E::Fn;
232232
| ^^^^^^^^
233233
| |
234234
| expected enum `m::E`, found fn item
235-
| help: use parentheses to instatiate this tuple variant: `m::E::Fn(_)`
235+
| help: use parentheses to instantiate this tuple variant: `m::E::Fn(_)`
236236
|
237237
= note: expected type `m::E`
238238
found type `fn(u8) -> m::E {m::E::Fn}`
@@ -262,7 +262,7 @@ LL | let _: E = E::Fn;
262262
| ^^^^^
263263
| |
264264
| expected enum `m::E`, found fn item
265-
| help: use parentheses to instatiate this tuple variant: `E::Fn(_)`
265+
| help: use parentheses to instantiate this tuple variant: `E::Fn(_)`
266266
|
267267
= note: expected type `m::E`
268268
found type `fn(u8) -> m::E {m::E::Fn}`

src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ LL | let _: S = S;
3232
| ^
3333
| |
3434
| expected struct `S`, found fn item
35-
| help: use parentheses to instatiate this tuple struct: `S(_, _)`
35+
| help: use parentheses to instantiate this tuple struct: `S(_, _)`
3636
|
3737
= note: expected type `S`
3838
found type `fn(usize, usize) -> S {S}`
@@ -62,7 +62,7 @@ LL | let _: V = V;
6262
| ^
6363
| |
6464
| expected struct `V`, found fn item
65-
| help: use parentheses to instatiate this tuple struct: `V()`
65+
| help: use parentheses to instantiate this tuple struct: `V()`
6666
|
6767
= note: expected type `V`
6868
found type `fn() -> V {V}`
@@ -107,7 +107,7 @@ LL | let _: E = E::A;
107107
| ^^^^
108108
| |
109109
| expected enum `E`, found fn item
110-
| help: use parentheses to instatiate this tuple variant: `E::A(_)`
110+
| help: use parentheses to instantiate this tuple variant: `E::A(_)`
111111
|
112112
= note: expected type `E`
113113
found type `fn(usize) -> E {E::A}`

0 commit comments

Comments
 (0)