{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/29048","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/29048/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/29048/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/29048/events","html_url":"https://github.com/rust-lang/rust/issues/29048","id":111425346,"number":29048,"title":"Nightly regression: Incorrect \"parameter type may not live long enough\" warning","user":{"login":"eefriedman","id":12769964,"avatar_url":"https://avatars.githubusercontent.com/u/12769964?v=3","gravatar_id":"","url":"https://api.github.com/users/eefriedman","html_url":"https://github.com/eefriedman","followers_url":"https://api.github.com/users/eefriedman/followers","following_url":"https://api.github.com/users/eefriedman/following{/other_user}","gists_url":"https://api.github.com/users/eefriedman/gists{/gist_id}","starred_url":"https://api.github.com/users/eefriedman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eefriedman/subscriptions","organizations_url":"https://api.github.com/users/eefriedman/orgs","repos_url":"https://api.github.com/users/eefriedman/repos","events_url":"https://api.github.com/users/eefriedman/events{/privacy}","received_events_url":"https://api.github.com/users/eefriedman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-lifetimes","name":"A-lifetimes","color":"d7e102"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/I-nominated","name":"I-nominated","color":"e10c02"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/regression-from-stable-to-nightly","name":"regression-from-stable-to-nightly","color":"FF309F"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/T-compiler","name":"T-compiler","color":"bfd4f2"},{"url":"https://api.github.com/repos/rust-lang/rust/labels/T-lang","name":"T-lang","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-14T15:38:52Z","updated_at":"2015-10-15T20:12:15Z","closed_at":null,"body":"Testcase:\r\n\r\n```rust\r\nuse std::marker::PhantomData;\r\npub struct WebDriverHttpApi<U> {\r\n    _routes: PhantomData<U>,\r\n}\r\nimpl <U> WebDriverHttpApi<U> {\r\n    pub fn new(extension_routes:Vec<(&str, U)>) -> WebDriverHttpApi<U> {\r\n        for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n        unimplemented!()\r\n    }\r\n}\r\nfn main(){}\r\n```\r\n\r\n```\r\n<anon>:7:67: 7:73 warning: the parameter type `U` may not live long enough [E0311]\r\n<anon>:7         for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n                                                                           ^~~~~~\r\n<anon>:7:67: 7:73 help: consider adding an explicit lifetime bound for `U`\r\n<anon>:6:72: 9:6 note: the parameter type `U` must be valid for the anonymous lifetime #1 defined on the block at 6:71...\r\n<anon>:6     pub fn new(extension_routes:Vec<(&str, U)>) -> WebDriverHttpApi<U> {\r\n<anon>:7         for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n<anon>:8         unimplemented!()\r\n<anon>:9     }\r\n<anon>:7:67: 7:73 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.\r\n<anon>:7         for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n                                                                           ^~~~~~\r\n<anon>:7:67: 7:73 note: ...so that the reference type `&collections::vec::Vec<(&str, U)>` does not outlive the data it points at\r\n<anon>:7         for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n                                                                           ^~~~~~\r\n<anon>:7:67: 7:73 warning: the parameter type `U` may not live long enough [E0311]\r\n<anon>:7         for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n                                                                           ^~~~~~\r\n<anon>:7:67: 7:73 help: consider adding an explicit lifetime bound for `U`\r\n<anon>:6:72: 9:6 note: the parameter type `U` must be valid for the anonymous lifetime #1 defined on the block at 6:71...\r\n<anon>:6     pub fn new(extension_routes:Vec<(&str, U)>) -> WebDriverHttpApi<U> {\r\n<anon>:7         for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n<anon>:8         unimplemented!()\r\n<anon>:9     }\r\n<anon>:7:67: 7:73 note: this warning results from recent bug fixes and clarifications; it will become a HARD ERROR in the next release. See RFC 1214 for details.\r\n<anon>:7         for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n                                                                           ^~~~~~\r\n<anon>:7:67: 7:73 note: ...so that the reference type `&[(&str, U)]` does not outlive the data it points at\r\n<anon>:7         for &(ref _url, ref _extension_route) in extension_routes.iter() {}\r\n                                                                           ^~~~~~\r\n```\r\n\r\nThis gives no warnings on beta or stable."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/148507540","html_url":"https://github.com/rust-lang/rust/issues/29048#issuecomment-148507540","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/29048","id":148507540,"user":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars.githubusercontent.com/u/155238?v=3","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T20:12:15Z","updated_at":"2015-10-15T20:12:15Z","body":"triage: P-high\r\n\r\nAssigning to myself. The problem has to do with a lifetime parameter being created as part of the autoderef loop during method probing. Best fix might be to isolate probing, if we can, but there are other workarounds we could put in place. Improving region compilation would be good too. Not sure what I think is the preferred fix just now."}}