Closed
Description
Given the following code: link
fn main() {
let x: i32 = 5;
let ptr: *const i32 = &x;
let dptr: **const i32 = &ptr;
}
The current output is:
Compiling playground v0.0.1 (/playground)
error: expected mut or const in raw pointer type
--> src/main.rs:4:15
|
4 | let dptr: **const i32 = &ptr;
| ^ expected mut or const in raw pointer type
|
= help: use `*mut T` or `*const T` as appropriate
error: could not compile `playground` due to previous error
Ideally the output should suggest correct ways to specify a double pointer type (e.g. *const *const T
)(May be able to extend for more levels of indirection if wanted), instead of a generic single pointer suggestion, which may not be what the user wants.