-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Should improper_ctypes pierce through impl Trait? #60855
Comments
@rkruppe User-facing diagnostics should avoid the rust/src/librustc/traits/project.rs Lines 28 to 68 in 37ff5d3
|
I've been using In each recent PR, I've ensured that opaque types are prohibited (in the spirit of "FFI-safety of a type not relying on particular type behind an opaque type being FFI-safe") - with the exception of when a opaque type is used in a projection (#73287). Unless there are specific examples of behavior that still need to be changed as a result of this issue - should this issue be closed? |
My litmus test for closing this would be "all the normalizing done in improper_ctypes uses |
I've opened #73758 to fix the remaining two places that |
While reviewing #60300 I noticed for the first time that the improper_ctypes lint normalizes with the "reveal_all" mode. I don't have a nuanced understanding of what that means exactly but based on the general description in the rustc docs and experimentation (see below) I think that's probably the wrong choice for this lint, because it exposes details to the user that are normally hidden during type checking.
For example, in this program using existential types, the lint pierces through otherwise-opaque existentials to look at the underlying (hidden) type, thus it both
I can't quickly find an equivalent using only stable
impl Trait
, because we don't havetypeof(function)
, but if there's a way to write "Option of the return type of this function" in stable Rust, then that would presumably have the same issue.cc @eddyb for fact-checking my understanding that this is because of reveal_all
The text was updated successfully, but these errors were encountered: