TMI: Progress (and preservation)
Jan. 18th, 2013 09:15 pmIt's good to be able to go home on a Friday night having submitted two pull requests: one for #3979 and one for #3860.
I've been working on these two minor bugs for way too long. I guess #3979 isn't all *that* minor, though. It was an aspect of the interaction between default methods and supertraits that was left incomplete -- fixing it required some thought. I wasn't sure at first what was already implemented. It turned out supertraits weren't transitive, plus there was no way to figure out in the compiler what the impl is of a given trait for a given type. It was really easy to make the coherence checking pass spit out a table mapping trait IDs to tables mapping types to impls -- the rest wasn't too bad (except for a hairy bit of code in ty that computes the transitive supertraits for a given list of trait bounds).
I didn't spend as much time on #3860, which involved borrowck and trans having divergent notions of which nodes in the AST introduced new scopes. My first solution was to change trans to introduce a new scope for each statement, because that seemed easier. Unfortunately, this meant creating lots of extra basic blocks and it was a performance loss. So it looked like it would make more sense to change borrowck, which is a static analysis so that's not going to directly mess up performance. My fix is kind of awkward (and best understood by looking at the code), but it works.
I still have more time to make up by working over the weekend, so there's no rest for the weary.
I've been working on these two minor bugs for way too long. I guess #3979 isn't all *that* minor, though. It was an aspect of the interaction between default methods and supertraits that was left incomplete -- fixing it required some thought. I wasn't sure at first what was already implemented. It turned out supertraits weren't transitive, plus there was no way to figure out in the compiler what the impl is of a given trait for a given type. It was really easy to make the coherence checking pass spit out a table mapping trait IDs to tables mapping types to impls -- the rest wasn't too bad (except for a hairy bit of code in ty that computes the transitive supertraits for a given list of trait bounds).
I didn't spend as much time on #3860, which involved borrowck and trans having divergent notions of which nodes in the AST introduced new scopes. My first solution was to change trans to introduce a new scope for each statement, because that seemed easier. Unfortunately, this meant creating lots of extra basic blocks and it was a performance loss. So it looked like it would make more sense to change borrowck, which is a static analysis so that's not going to directly mess up performance. My fix is kind of awkward (and best understood by looking at the code), but it works.
I still have more time to make up by working over the weekend, so there's no rest for the weary.