-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix PostBorrowckAnalysis
for old solver
#135899
base: master
Are you sure you want to change the base?
Fix PostBorrowckAnalysis
for old solver
#135899
Conversation
@@ -36,5 +36,21 @@ note: this opaque type is in the signature | |||
LL | type Bar = impl std::fmt::Display; | |||
| ^^^^^^^^^^^^^^^^^^^^^^ | |||
|
|||
error: aborting due to 3 previous errors | |||
error: the constant `N` is not of type `{type error}` |
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.
See the comment:
// FIXME: We should reveal the TAITs that end up in where clauses here, otherwise we
// will not be able to match param-env candidates in the old solver, since we don't
// have eq-modulo-normalization. This is less of a problem than it seems, since this
// only matters if we have TAITs in where where clauses, which isn't achievable with
// RPIT anyways.
@@ -6,5 +6,21 @@ LL | async fn test<const N: crate::Bar>() { | |||
| | |||
= note: the only supported types are integers, `bool`, and `char` | |||
|
|||
error: aborting due to 1 previous error | |||
error: the constant `N` is not of type `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.
See the comment:
// FIXME: We should reveal the TAITs that end up in where clauses here, otherwise we
// will not be able to match param-env candidates in the old solver, since we don't
// have eq-modulo-normalization. This is less of a problem than it seems, since this
// only matters if we have TAITs in where where clauses, which isn't achievable with
// RPIT anyways.
@@ -1,7 +1,5 @@ | |||
// ICE failed to resolve instance for ... | |||
// issue: rust-lang/rust#123145 | |||
//@ build-fail |
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 now cycles in check_opaque_well_formed
, since now we actually reveal impl Handler
when proving that it satisfies its own item bounds. This seems desirable to me.
let generic_ty = self.cx().type_of(data.def_id); | ||
let mut concrete_ty = generic_ty.instantiate(self.cx(), args); | ||
|
||
if concrete_ty == ty { |
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 recursiveness check sucks, but it prevents bad error messages.
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.
could we move this check to type_of_opaque
?
Ty::new_error_with_message(self.cx(), self.cause.span, "recursive opaque type"); | ||
} | ||
|
||
let concrete_ty = fold_regions(self.cx(), concrete_ty, |re, _dbi| match re.kind() { |
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 wonder if we should consolidate all of these "replace erasing with infer" so that we only need to change it in one place when we start using a real binder...
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.
yeah, we probably should 😁
This comment has been minimized.
This comment has been minimized.
💀 I guess I'll minimize that ^ |
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.
some nits, i'd like to see a crater run here after u've figured out the ci failure
☔ The latest upstream changes (presumably #134824) made this pull request unmergeable. Please resolve the merge conflicts. |
319fe69
to
9d23763
Compare
} | ||
|
||
let concrete_ty = fold_regions(self.cx(), concrete_ty, |re, _dbi| match re.kind() { | ||
ty::ReErased => self.selcx.infcx.next_region_var_in_universe( |
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.
:(((
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.
pub fn unpeek<'a, F: FnMut(&mut ()) + 'a>(mut peek: F) -> impl FnMut(&mut ()) {
move |i| peek(i)
}
pub fn test<P>(mut parser: P) -> impl FnMut(&mut ()) {
unpeek(move |input: &mut ()| {
let parser = &parser;
})
}
I'll write up an analysis later.
@bors try |
…lver, r=<try> Fix `PostBorrowckAnalysis` for old solver ~~branch name is typo'd~~ This "fixes" the `PostBorrowckAnalysis` mode for the old solver, and begins to use it in `check_opaque_well_formed` and `check_coroutine_obligations`. There are several curiosities here that result. r? lcnr
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
does increasing the recursion limit fix it, if so, we should go ahead with this change |
branch name is typo'dThis "fixes" the
PostBorrowckAnalysis
mode for the old solver, and begins to use it incheck_opaque_well_formed
andcheck_coroutine_obligations
.There are several curiosities here that result.
r? lcnr