GitHub PushEvent at 2014-04-15 21:16:55
Repository: rust
Actor: bors
Payload: {"shas":[["79d1e5df2190e4cfdd1814af95837b21ef046745","1de44bb216b4f0b7f3e864dd9d3b6104a9b142ec@gmail.com","Support lifetime suggestion for method\n\nThis includes a change to the way lifetime names are generated. Say we\nfigure that `[#0, 'a, 'b]` have to be the same lifetimes, then instead\nof just generating a new lifetime `'c` like before to replace them, we\nwould reuse `'a`. This is done so that when the lifetime name comes\nfrom an impl, we don't give something that's completely off, and we\ndon't have to do much work to figure out where the name came from. For\nexample, for the following code snippet:\n\n```rust\nstruct Baz<'x> {\n    bar: &'x int\n}\n\nimpl<'x> Baz<'x> {\n    fn baz1(&self) -> &int {\n        self.bar\n    }\n}\n```\n\n`[#1, 'x]` (where `#1` is BrAnon(1) and refers to lifetime of `&int`)\nhave to be marked the same lifetime. With the old method, we would\ngenerate a new lifetime `'a` and suggest `fn baz1(&self) -> &'a int`\nor `fn baz1<'a>(&self) -> &'a int`, both of which are wrong.","Kiet Tran",true],["10f94e3fe5859fe7fc001cf26f4fa401d9a2ee2e","3a2c29237f73c7cf88424b80e427b1884f346b35@rust-lang.org","auto merge of #13164 : ktt3ja/rust/lifetime-suggestion-method, r=nmatsakis\n\nThis includes a change to the way lifetime names are generated. Say we\r\nfigure that `[#0, 'a, 'b]` have to be the same lifetimes, then instead\r\nof just generating a new lifetime `'c` like before to replace them, we\r\nwould reuse `'a`. This is done so that when the lifetime name comes\r\nfrom an impl, we don't give something that's completely off, and we\r\ndon't have to do much work to figure out where the name came from. For\r\nexample, for the following code snippet:\r\n\r\n```rust\r\nstruct Baz<'x> {\r\n    bar: &'x int\r\n}\r\n\r\nimpl<'x> Baz<'x> {\r\n    fn baz1(&self) -> &int {\r\n        self.bar\r\n    }\r\n}\r\n```\r\n\r\n`[#1, 'x]` (where `#1` is BrAnon(1) and refers to lifetime of `&int`)\r\nhave to be marked the same lifetime. With the old method, we would\r\ngenerate a new lifetime `'a` and suggest `fn baz1(&self) -> &'a int`\r\nor `fn baz1<'a>(&self) -> &'a int`, both of which are wrong.","bors",true]],"size":2,"ref":"refs/heads/auto","head":"10f94e3fe5859fe7fc001cf26f4fa401d9a2ee2e"}