Skip to content

Conversation

@jonas-schievink
Copy link
Contributor

Fixes #10386

(the salsa bug persists, but this lets us avoid it by fixing the underlying bug)

This reimplements the rustc logic in https://github.com/rust-lang/rust/blob/b27661eb33c74cb514dba059b47d86b6582ac1c2/compiler/rustc_typeck/src/collect.rs#L556: When resolving an associated type T::Item, we've previously lowered all predicates that could affect T, but we actually have to look only at those predicates whose traits define an associated type of the right name.

@jonas-schievink jonas-schievink changed the title Avoid cycle when lowering predicates for associated item lookup fix: Avoid cycle when lowering predicates for associated item lookup Oct 4, 2021
@flodiebold
Copy link
Member

Oh, it looks like that logic was added more recently than our associated type selection code 😅

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 4, 2021

@bors bors bot merged commit 5bdae82 into rust-lang:master Oct 4, 2021
@jonas-schievink jonas-schievink deleted the fix-assoc-shorthand-pred-cycle branch October 4, 2021 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'called Option::unwrap() on a None value' when editing KAS GUI applications

2 participants