```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
--> $DIR/attempted-access-non-fatal.rs:7:15
|
LL | let _ = 2.l;
| ^
|
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
|
LL - let _ = 2.l;
LL + let _ = 2.0f64;
|
```
126 lines
3.5 KiB
Plaintext
126 lines
3.5 KiB
Plaintext
error: function body cannot be `= expression;`
|
|
--> $DIR/fn-body-eq-expr-semi.rs:4:14
|
|
|
|
|
LL | fn foo() = 42;
|
|
| ^^^^^
|
|
|
|
|
help: surround the expression with `{` and `}` instead of `=` and `;`
|
|
|
|
|
LL - fn foo() = 42;
|
|
LL + fn foo() { 42 }
|
|
|
|
|
|
|
error: function body cannot be `= expression;`
|
|
--> $DIR/fn-body-eq-expr-semi.rs:5:20
|
|
|
|
|
LL | fn bar() -> u8 = 42;
|
|
| ^^^^^
|
|
|
|
|
help: surround the expression with `{` and `}` instead of `=` and `;`
|
|
|
|
|
LL - fn bar() -> u8 = 42;
|
|
LL + fn bar() -> u8 { 42 }
|
|
|
|
|
|
|
error: function body cannot be `= expression;`
|
|
--> $DIR/fn-body-eq-expr-semi.rs:9:14
|
|
|
|
|
LL | fn foo() = 42;
|
|
| ^^^^^
|
|
|
|
|
help: surround the expression with `{` and `}` instead of `=` and `;`
|
|
|
|
|
LL - fn foo() = 42;
|
|
LL + fn foo() { 42 }
|
|
|
|
|
|
|
error: function body cannot be `= expression;`
|
|
--> $DIR/fn-body-eq-expr-semi.rs:11:20
|
|
|
|
|
LL | fn bar() -> u8 = 42;
|
|
| ^^^^^
|
|
|
|
|
help: surround the expression with `{` and `}` instead of `=` and `;`
|
|
|
|
|
LL - fn bar() -> u8 = 42;
|
|
LL + fn bar() -> u8 { 42 }
|
|
|
|
|
|
|
error: function body cannot be `= expression;`
|
|
--> $DIR/fn-body-eq-expr-semi.rs:16:14
|
|
|
|
|
LL | fn foo() = 42;
|
|
| ^^^^^
|
|
|
|
|
help: surround the expression with `{` and `}` instead of `=` and `;`
|
|
|
|
|
LL - fn foo() = 42;
|
|
LL + fn foo() { 42 }
|
|
|
|
|
|
|
error: function body cannot be `= expression;`
|
|
--> $DIR/fn-body-eq-expr-semi.rs:17:20
|
|
|
|
|
LL | fn bar() -> u8 = 42;
|
|
| ^^^^^
|
|
|
|
|
help: surround the expression with `{` and `}` instead of `=` and `;`
|
|
|
|
|
LL - fn bar() -> u8 = 42;
|
|
LL + fn bar() -> u8 { 42 }
|
|
|
|
|
|
|
error: function body cannot be `= expression;`
|
|
--> $DIR/fn-body-eq-expr-semi.rs:21:14
|
|
|
|
|
LL | fn foo() = 42;
|
|
| ^^^^^
|
|
|
|
|
help: surround the expression with `{` and `}` instead of `=` and `;`
|
|
|
|
|
LL - fn foo() = 42;
|
|
LL + fn foo() { 42 }
|
|
|
|
|
|
|
error: function body cannot be `= expression;`
|
|
--> $DIR/fn-body-eq-expr-semi.rs:22:20
|
|
|
|
|
LL | fn bar() -> u8 = 42;
|
|
| ^^^^^
|
|
|
|
|
help: surround the expression with `{` and `}` instead of `=` and `;`
|
|
|
|
|
LL - fn bar() -> u8 = 42;
|
|
LL + fn bar() -> u8 { 42 }
|
|
|
|
|
|
|
error: incorrect function inside `extern` block
|
|
--> $DIR/fn-body-eq-expr-semi.rs:9:8
|
|
|
|
|
LL | extern "C" {
|
|
| ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
|
|
LL | fn foo() = 42;
|
|
| ^^^ ----- help: remove the invalid body: `;`
|
|
| |
|
|
| cannot have a body
|
|
|
|
|
= help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block
|
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
|
|
|
|
error: incorrect function inside `extern` block
|
|
--> $DIR/fn-body-eq-expr-semi.rs:11:8
|
|
|
|
|
LL | extern "C" {
|
|
| ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body
|
|
...
|
|
LL | fn bar() -> u8 = 42;
|
|
| ^^^ ----- help: remove the invalid body: `;`
|
|
| |
|
|
| cannot have a body
|
|
|
|
|
= help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block
|
|
= note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
|
|
|
|
error: aborting due to 10 previous errors
|
|
|