-
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
extend WithOptConstParam
docs, move rustdoc test
#78609
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
compiler/rustc_middle/src/ty/mod.rs
Outdated
/// | ||
/// We only care about the const argument once we know which paramter they instantiate. | ||
/// So instead of using `type_of(const_arg)` we can use `type_of(const_param)` which does | ||
/// not depend on `typeck`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typeck
of what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on any typeck
. type_of(const_param)
is fairly trivial as it is directly mentioned by the user.
We have const N: usize
and the type_of(N)
should return usize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot make sense of this sentence. Above, you use things like typeck(main)
.
You seem to assume that the reader knows the half a dozen queries involved in this and how they related, and maybe that's fair, but I know none of them.^^
If that makes me not part of the audience for these docs, that's okay; in that case just write something that you think make sense and do not wait for me to understand it all. :)
@lcnr this is waiting for you to resolve CI issues + the above review |
f7b9460
to
3c024b2
Compare
@RalfJung thought about it a bit more and hope that it at least doesn't look completely nonsensical to you anymore. It still requires some knowledge about how the type system works, but I prefer merging this PR without spending much additional time on this. |
Even if there are still some details I am fuzzy on, I think this PR is a definite improvement, so I am fine with landing it. |
28ea89d
to
4b23f40
Compare
@bors r+ |
📌 Commit 4b23f40 has been approved by |
☀️ Test successful - checks-actions |
This should hopefully make things a bit clearer, feel free to comment on anything which can still be improved.
cc @ecstatic-morse @nikomatsakis @RalfJung