]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0614.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0614.md
1 Attempted to dereference a variable which cannot be dereferenced.
2
3 Erroneous code example:
4
5 ```compile_fail,E0614
6 let y = 0u32;
7 *y; // error: type `u32` cannot be dereferenced
8 ```
9
10 Only types implementing `std::ops::Deref` can be dereferenced (such as `&T`).
11 Example:
12
13 ```
14 let y = 0u32;
15 let x = &y;
16 // So here, `x` is a `&u32`, so we can dereference it:
17 *x; // ok!
18 ```