Jul. 25th, 2012

tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (working)
Today: a short day, since staying at work till 11 PM, then taking the bus home, resulted in waking up at 12:30 PM and various other silliness. Not feeling like I'm doing that well at being an adult at the moment.

Today, I was planning to work more on dependencies, but issue 3021 caught my eye. The fix was easy, or so it seemed: resolve was treating impl methods like a "normal function" (which may capture variables defined in its enclosing scope) rather than an "opaque function" (which may not). Closures are normal functions, while function items (declared with fn) are considered opaque. Impl methods should be treated the same way as function items. That was a one-line fix, and allowed this test case to pass. I realized the same fix should apply to class methods and trait methods, as well. The problem is that then, a ty param bound by a class (or impl or trait) gets considered an upvar, and then class methods can't refer to it. Which is to say, this code should be accepted: Read more... )

Profile

tim: Tim with short hair, smiling, wearing a black jacket over a white T-shirt (Default)
Tim Chevalier

November 2021

S M T W T F S
 123456
78 910111213
14151617181920
21222324252627
282930    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags