4

Prevent caching normalization results with a cycle

 3 years ago
source link: https://github.com/rust-lang/rust/pull/80246
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Contributor

matthewjasper commented 13 days ago

When normalizing a projection which results in a cycle, we would cache the result of project_type without the nested obligations (because they're not needed for inference). This would result in the nested obligations only being handled once in fulfill, which would avoid the cycle error. get_paranoid_cache_value_obligation used to add an obligation that resulted in a cycle in this case previously, but was removed by #73905.

This PR makes the projection cache not cache the value of a projection if it was ever normalized in a cycle (except in a snapshot that's rolled back).

Fixes #79714.

r? @nikomatsakis


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK