{"push_id":889952815,"size":1,"distinct_size":1,"ref":"refs/heads/reuse-racer-session","head":"b6c19ce0aac777bd3569a60e8ab6744a12310f35","before":"1297d485abe14c53a1a1389eaa926d554a7d0bec","commits":[{"sha":"b6c19ce0aac777bd3569a60e8ab6744a12310f35","author":{"email":"16a9a54ddf4259952e3c118c763138e83693d7fd@jwilm.com","name":"Joe Wilm"},"message":"Fix Racer instance sharing\n\nMethods on the ::racer::core::Session object hand out lifetimes tied to\nthe Session itself. Methods on a struct holding the Session need to have\na concrete &self lifetime which matches the struct's lifetime in order\nto use the Session. This becomes problematic when implementing methods\nfor a trait object that do not contain such a lifetime in the method\nprototype. The solution, as seen in librustc/middle/ty/context.rs's\n`struct ctxt`, is to store a reference to such an object which has the\nlifetime constrained to the lifetime of the holder. In the case of\nlibrustc, the owned object is allocated on the stack, and a reference is\nprovided for the life of the consumer. In our case, since we can't just\npass something in from the stack, we Box a session and take\nresponsibility of its allocation. This requires a small bit of unsafe\ncode. I expect there is a nicer solution that doesn't require the unsafe\ncode, but it has escaped me for a long time. As they say, \"the show must\ngo on.\" Suggestions would be very much appreciated.\n\nThe query_src parameters passed to racer methods were reinstated since\nthey are actually used.","distinct":true,"url":"https://api.github.com/repos/jwilm/racerd/commits/b6c19ce0aac777bd3569a60e8ab6744a12310f35"}]}