Skip to content

Commit

Permalink
review comments: typo and rewording
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Aug 8, 2019
1 parent 8756311 commit 68aff3f
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3711,8 +3711,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
if let Some(fn_span) = fn_span {
err.span_label(
fn_span,
"this function implicitly returns `()` as its body has no tail \
or `return` expression",
"implicitly returns `()` as its body has no tail or `return` \
expression",
);
}
}, false);
Expand Down Expand Up @@ -3880,10 +3880,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
sugg_call = fields.iter().map(|_| "_").collect::<Vec<_>>().join(", ");
match hir.as_local_hir_id(def_id).and_then(|hir_id| hir.def_kind(hir_id)) {
Some(hir::def::DefKind::Ctor(hir::def::CtorOf::Variant, _)) => {
msg = "instatiate this tuple variant";
msg = "instantiate this tuple variant";
}
Some(hir::def::DefKind::Ctor(hir::def::CtorOf::Struct, _)) => {
msg = "instatiate this tuple struct";
msg = "instantiate this tuple struct";
}
_ => {}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/block-result/consider-removing-last-semi.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn f() -> String {
| - ^^^^^^ expected struct `std::string::String`, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
LL | 0u8;
LL | "bla".to_string();
| - help: consider removing this semicolon
Expand All @@ -18,7 +18,7 @@ error[E0308]: mismatched types
LL | fn g() -> String {
| - ^^^^^^ expected struct `std::string::String`, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
LL | "this won't work".to_string();
LL | "removeme".to_string();
| - help: consider removing this semicolon
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/block-result/issue-11714.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn blah() -> i32 {
| ---- ^^^ expected i32, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
...
LL | ;
| - help: consider removing this semicolon
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/block-result/issue-13428.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn foo() -> String {
| --- ^^^^^^ expected struct `std::string::String`, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
...
LL | ;
| - help: consider removing this semicolon
Expand All @@ -18,7 +18,7 @@ error[E0308]: mismatched types
LL | fn bar() -> String {
| --- ^^^^^^ expected struct `std::string::String`, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
LL | "foobar".to_string()
LL | ;
| - help: consider removing this semicolon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn plus_one(x: i32) -> i32 {
| -------- ^^^ expected i32, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
LL | x + 1;
| - help: consider removing this semicolon
|
Expand All @@ -17,7 +17,7 @@ error[E0308]: mismatched types
LL | fn foo() -> Result<u8, u64> {
| --- ^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
LL | Ok(1);
| - help: consider removing this semicolon
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-32323.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {}
| - ^^^^^^^^^^^^^^^^^^ expected associated type, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `<T as Tr<'a>>::Out`
found type `()`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-35241.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | fn test() -> Foo { Foo }
| --- ^^^
| | |
| | expected struct `Foo`, found fn item
| | help: use parentheses to instatiate this tuple struct: `Foo(_)`
| | help: use parentheses to instantiate this tuple struct: `Foo(_)`
| expected `Foo` because of return type
|
= note: expected type `Foo`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-43162.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error[E0308]: mismatched types
LL | fn foo() -> bool {
| --- ^^^^ expected bool, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
LL |
LL | break true;
| - help: consider removing this semicolon
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-44023.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn საჭმელად_გემრიელი_სადილი ( ) -> isize {
| ------------------------ ^^^^^ expected isize, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `isize`
found type `()`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-6458-4.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn foo(b: bool) -> Result<bool,String> {
| --- ^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
LL | Err("bar".to_string());
| - help: consider removing this semicolon
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/liveness/liveness-forgot-ret.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; }
| - ^^^^^ expected isize, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `isize`
found type `()`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/liveness/liveness-missing-ret2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn f() -> isize {
| - ^^^^^ expected isize, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `isize`
found type `()`
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
| --- ^^^ - help: consider removing this semicolon
| | |
| | expected i32, found ()
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
...
LL | test!();
| -------- in this macro invocation
Expand All @@ -19,7 +19,7 @@ error[E0308]: mismatched types
LL | fn no_return() -> i32 {}
| --------- ^^^ expected i32, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `i32`
found type `()`
Expand All @@ -30,7 +30,7 @@ error[E0308]: mismatched types
LL | fn bar(x: u32) -> u32 {
| --- ^^^ expected u32, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
LL | x * 2;
| - help: consider removing this semicolon
|
Expand All @@ -43,7 +43,7 @@ error[E0308]: mismatched types
LL | fn baz(x: u64) -> u32 {
| --- ^^^ expected u32, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `u32`
found type `()`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/missing/missing-return.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn f() -> isize { }
| - ^^^^^ expected isize, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `isize`
found type `()`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/parser/issue-62881.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ error[E0308]: mismatched types
LL | fn f() -> isize { fn f() -> isize {} pub f<
| - ^^^^^ expected isize, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `isize`
found type `()`
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/parser/issue-62895.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ error[E0308]: mismatched types
LL | fn v() -> isize {
| - ^^^^^ expected isize, found ()
| |
| this function implicitly returns `()` as its body has no tail or `return` expression
| implicitly returns `()` as its body has no tail or `return` expression
|
= note: expected type `isize`
found type `()`
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/resolve/privacy-enum-ctor.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ LL | let _: Z = Z::Fn;
| ^^^^^
| |
| expected enum `m::n::Z`, found fn item
| help: use parentheses to instatiate this tuple variant: `Z::Fn(_)`
| help: use parentheses to instantiate this tuple variant: `Z::Fn(_)`
|
= note: expected type `m::n::Z`
found type `fn(u8) -> m::n::Z {m::n::Z::Fn}`
Expand Down Expand Up @@ -232,7 +232,7 @@ LL | let _: E = m::E::Fn;
| ^^^^^^^^
| |
| expected enum `m::E`, found fn item
| help: use parentheses to instatiate this tuple variant: `m::E::Fn(_)`
| help: use parentheses to instantiate this tuple variant: `m::E::Fn(_)`
|
= note: expected type `m::E`
found type `fn(u8) -> m::E {m::E::Fn}`
Expand Down Expand Up @@ -262,7 +262,7 @@ LL | let _: E = E::Fn;
| ^^^^^
| |
| expected enum `m::E`, found fn item
| help: use parentheses to instatiate this tuple variant: `E::Fn(_)`
| help: use parentheses to instantiate this tuple variant: `E::Fn(_)`
|
= note: expected type `m::E`
found type `fn(u8) -> m::E {m::E::Fn}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ LL | let _: S = S;
| ^
| |
| expected struct `S`, found fn item
| help: use parentheses to instatiate this tuple struct: `S(_, _)`
| help: use parentheses to instantiate this tuple struct: `S(_, _)`
|
= note: expected type `S`
found type `fn(usize, usize) -> S {S}`
Expand Down Expand Up @@ -62,7 +62,7 @@ LL | let _: V = V;
| ^
| |
| expected struct `V`, found fn item
| help: use parentheses to instatiate this tuple struct: `V()`
| help: use parentheses to instantiate this tuple struct: `V()`
|
= note: expected type `V`
found type `fn() -> V {V}`
Expand Down Expand Up @@ -107,7 +107,7 @@ LL | let _: E = E::A;
| ^^^^
| |
| expected enum `E`, found fn item
| help: use parentheses to instatiate this tuple variant: `E::A(_)`
| help: use parentheses to instantiate this tuple variant: `E::A(_)`
|
= note: expected type `E`
found type `fn(usize) -> E {E::A}`
Expand Down

0 comments on commit 68aff3f

Please sign in to comment.