These are chat archives for rust-lang/rust

Nov 2017
Nov 14 2017 06:01
@alteous I still don't understand it. foo goes from &x to <TypeOfX as Family>::Foo::default(). Type deduction assigns <TypeOfX as Family>::Foo type to the y binding. So what you really need is explicit type annotation for y?
Nov 14 2017 14:09
Is it ethical to offer small financial encouragements to PRs that you really want to see done? I wonder why noone did this
Nov 14 2017 14:11
@samoylovfp you mean in general ? I think there is e.g.
Nov 14 2017 14:12
Oh this looks exactly like what i was thinking about, thanks!
David McGillicuddy
Nov 14 2017 22:05
Hi, I'm having a little lifetime trouble/not really understanding move closures. I have a struct and I'd like to have a function that takes a reference to the function, and returns an optional reference to some member inside the struct. It works fine for the immutable case, but when I write get_mut I get an error advising me to use a move closure to take ownership of self. But I only have a mutable pointer to the variable self, how can I take ownership of it? I have a minimal case here:
Unless in that error message, one self is referring to the method variable self and the other self is referring to the closure itself or something...