Add E0102 error explanation
This commit is contained in:
parent
050b8d370b
commit
028aba38ff
1 changed files with 30 additions and 1 deletions
|
|
@ -1118,6 +1118,36 @@ fn main() {
|
|||
```
|
||||
"##,
|
||||
|
||||
E0102: r##"
|
||||
You hit this error because the compiler the compiler lacks information
|
||||
to determine a type for this variable. Erroneous code example:
|
||||
|
||||
```
|
||||
fn main() {
|
||||
let x: &_; // error: cannot determine a type for this local variable
|
||||
}
|
||||
```
|
||||
|
||||
You have two possibilities to solve this situation:
|
||||
* Give an explicit definition of the variable
|
||||
* Infer the variable
|
||||
|
||||
Examples:
|
||||
|
||||
```
|
||||
fn some_func(x: u32) {
|
||||
// some code
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = 0u32; // ok!
|
||||
// or:
|
||||
let x = 0;
|
||||
some_func(x);
|
||||
}
|
||||
```
|
||||
"##,
|
||||
|
||||
E0106: r##"
|
||||
This error indicates that a lifetime is missing from a type. If it is an error
|
||||
inside a function signature, the problem may be with failing to adhere to the
|
||||
|
|
@ -2303,7 +2333,6 @@ register_diagnostics! {
|
|||
E0085,
|
||||
E0086,
|
||||
E0090,
|
||||
E0102,
|
||||
E0103,
|
||||
E0104,
|
||||
E0118,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue