-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Fudge infer vars in the cause code of Obligation intentionally
#149299
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
0e810ef to
c9e720d
Compare
This comment has been minimized.
This comment has been minimized.
c9e720d to
a8e9638
Compare
| try_borrowing(cause.derived.parent_trait_pred, &[]) | ||
| // Parent trait predicate may contain regions that's already popped since `cause` | ||
| // in `Obligation` is ignored by folders/visitors. | ||
| // We can erase them since evaluation later doesn't care about regions anyway. |
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.
is that because the BestObligation folder happens inside of a fudge? and would eagerly fudging the cause there as well also avoid this ICE?
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.
It's because of the definition of Obligation. So the region vars in cause is ignored in fudge_inference_if_ok.
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.
yes, but the fudge when computing the best obligation could take (Predicate, Cause) as the return type instead of a full obligation to properly fudge the cause there
a8e9638 to
073e537
Compare
Obligation intentionally
|
@rustbot ready |
|
This fixes #142866 as well 👍 |
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
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.
hm, can you move both tests to traits/error-reporting?
also, can you add a fixme to Obligation that we shouldn't ignore the cause but instead change teh affected visitors to only visit predicates manually :>
111d965 to
b111aed
Compare
|
@bors r+ rollup |
Rollup of 9 pull requests Successful merges: - #148690 (Implement `clamp_magnitude` method for primitive floats & signed integers) - #149102 (stabilize maybe_uninit_slice) - #149269 (cmse: do not calculate the layout of a type with infer types) - #149299 (Fudge infer vars in the cause code of `Obligation` intentionally) - #149344 (Don't suggest unwrap for Result in const) - #149358 (fix(parse): Limit frontmatter fences to 255 dashes ) - #149445 (make assoc fn inherit const stability from inherent `const impl` blocks) - #149479 (Fix indent in E0591.md) - #149496 (Fix #148889: Add label rib when visiting delegation body) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #149299 - adwinwhite:next-245-ice, r=lcnr Fudge infer vars in the cause code of `Obligation` intentionally Fixes the ICE variant in rust-lang/trait-system-refactor-initiative#245. Fixes #142866. The detailed cause is in the test comments. r? `@lcnr`
Fixes the ICE variant in rust-lang/trait-system-refactor-initiative#245.
Fixes #142866.
The detailed cause is in the test comments.
r? @lcnr