-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Rustdoc should not show impls with a where
clause that is always false
#80481
Comments
I disagree. The Instead, I think we could display a note on any impl that can be proven to never apply. Also, this is not a blanket impl - it's a macro-generated impl for |
Sure, that seems reasonable to me. I think rust/src/librustdoc/clean/mod.rs Line 264 in 0edce6f
Oops, good catch, thanks. |
I was just reminded by this because another person was bitten by it. It would definitely be useful to add a note on impls that are always false, although it would of course be better doc-wise if we can somehow convince it to display I don't think this can be fixed in Right now, the only way to get the impl displayed properly in Tokio is to redo the unsafe code inside the macro, giving up the soundness guarantees of the macro. |
where
clause that is always falsewhere
clause that is always false
Isn't this undecidable in general? |
In general, yea, but we have a pretty good way of telling when an where clause is trivially false. |
pin_project_lite
generates code that looks like this:Full output of
cargo expand
Rustdoc in turn generates documentation like this:
This is really unfortunate, because
__Origin
does not in fact implementUnpin
. Rustdoc shouldn't show trait implementations that can never be applied.Originally posted by @jyn514 in tokio-rs/tokio#3330 (comment)
The text was updated successfully, but these errors were encountered: