-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve pretty printing of const raw pointers #65349
Comments
…mertj Better pretty printing for const raw pointers closes rust-lang#65349, hopefully.
…mertj Better pretty printing for const raw pointers closes rust-lang#65349, hopefully.
Woah people use raw pointers as const generic arguments and then feed them integers cast to raw pointers? That is so scary.^^ |
No-one's using pointers with const generics right now (I hope): but it does work, and diagnostics are something we would want to improve if we ever did consider stabilising this feature. It's more of a reminder. |
Would it be possible to have a counter for whenever a const pointer is accessed, so that the above message would look something like:
(numbers chosen arbitrarily here) At least as a temporary solution. A future solution would hopefully add "note: {pointer#4} points to `15: usize`" and "note: {pointer#89} points to `10: usize`" (or whatever integer type it thinks of) |
This should not be an issue with |
#64986 changed the pretty-printing of const raw pointers to
{pointer}
. This can cause confusing diagnostics due to the lack of detail the printing of raw pointers provides, like the following:The text was updated successfully, but these errors were encountered: