Created
November 3, 2017 21:46
-
-
Save nikomatsakis/4f15f08035608c7660c3c23418040c97 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mut current_predicates = map(); | |
for each struct/enum S { | |
current_predicates[S] = explicit_predicates(S); | |
} | |
let mut changed = true; | |
while changed { | |
changed = false; | |
for each struct/enum S { | |
for each field F in S { | |
// Key point is that `requirements(F.type)` will wind up reading | |
// from `current_predicates`. | |
let r = requirements(F.type); | |
let old_len = current_predicates[S]; | |
current_predicates[S].extend(r); | |
changed = changed | currrent_predicates[S].len() != old_len; // something new was added | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment