-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.