-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Converting integers to pointers using "as _" works, but produces error messages if a different error occurs #39273
Comments
No it is not. usize does not implicitly convert to a pointer, raw or not. |
It compiles. If it shouldn't, well, it shouldn't. |
What's your Rust version? The program does not compile on current stable, beta, or nightly playground. |
http://rust.godbolt.org has quick access to all versions since 1.0 and this code fails to compile on all of them. |
Sorry, I misrepresented the issue here. It's really got to do with conversion using |
Here's the example code fixed up. Uncomment
|
Closing in favor of #35772. |
This code is fine.
But when the following code fails to compile because of the unresolved
foo
, an additional error message is generated for the integer-pointer conversion.This makes it very annoying to debug a large program with lots of this kind of integer-pointer conversion that fails for some other reason, as an extra message is generated for every conversion.
The text was updated successfully, but these errors were encountered: