Jul. 25th, 2012

tim: Tim wearing a flat cap and a gray/black suit (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 wearing a flat cap and a gray/black suit (Default)
Tim Chevalier

June 2013

S M T W T F S
      1
23 45 6 78
910 1112 13 1415
16 17 18 19202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags