-
Notifications
You must be signed in to change notification settings - Fork 13.3k
fix broken type parameter indexing logic in wfcheck #36119
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
Conversation
} | ||
|
||
impl From<ty::EarlyBoundRegion> for Parameter { | ||
fn from(param: ty::EarlyBoundRegion) -> Self { Parameter(param.index) } | ||
} |
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.
Are these entirely needed? Seems to me like it's less work to just use the index from wherever it first is available.
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 had enough index mixups.
@bors r=eddyb |
📌 Commit ac345bc has been approved by |
@@ -141,13 +146,14 @@ pub fn setup_constraining_predicates<'tcx>(predicates: &mut [ty::Predicate<'tcx> | |||
// * <U as Iterator>::Item = T | |||
// * T: Debug | |||
// * U: Iterator | |||
debug!("setup_constraining_predicates: predicates={:?} impl_trait_ref={:?} input_parameters={:?}", |
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.
This and the other debug!
below are > 100 columns, fails tidy.
@bors r- tidy failed |
@bors r=eddyb |
📌 Commit dd72b6b has been approved by |
pub enum Parameter { | ||
Type(ty::ParamTy), | ||
Region(ty::EarlyBoundRegion), | ||
pub struct Parameter(pub u32); |
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.
Can you please leave a comment explaining what this field is?
Also, I think the field should be private, and you should write fn from_index(usize) -> Parameter
; it's always a shame when the public API doesn't expose usize
, I think.
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.
But ParamTy
has this as a u32
.
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.
Well, that's an internal conversion anyway...but I'd argue that's a problem with ParamTy
. :)
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.
Anyway whatever. I don't care that much.
Left some nits. I won't stop bors since this fixes a regression, but @arielb1 if you get a chance to address them it'd be nice. |
⌛ Testing commit dd72b6b with merge 6212e92... |
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
@bors: retry |
r? @eddyb
Fixes #36075