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);
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";
}
_ => {}
}
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
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
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
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
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
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
|
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
|
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 `()`
| --- ^^^
| | |
| | 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`
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
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 `()`
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
|
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 `()`
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 `()`
| --- ^^^ - 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
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 `()`
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
|
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 `()`
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 `()`
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 `()`
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 `()`
| ^^^^^
| |
| 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}`
| ^^^^^^^^
| |
| 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}`
| ^^^^^
| |
| 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}`
| ^
| |
| 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}`
| ^
| |
| 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}`
| ^^^^
| |
| 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}`