{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/55498","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/55498/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/55498/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/55498/events","html_url":"https://github.com/rust-lang/rust/issues/55498","id":375332700,"node_id":"MDU6SXNzdWUzNzUzMzI3MDA=","number":55498,"title":"Regression: Not well-formed HRTB doesn't compile","user":{"login":"mashedcode","id":20372249,"node_id":"MDQ6VXNlcjIwMzcyMjQ5","avatar_url":"https://avatars2.githubusercontent.com/u/20372249?v=4","gravatar_id":"","url":"https://api.github.com/users/mashedcode","html_url":"https://github.com/mashedcode","followers_url":"https://api.github.com/users/mashedcode/followers","following_url":"https://api.github.com/users/mashedcode/following{/other_user}","gists_url":"https://api.github.com/users/mashedcode/gists{/gist_id}","starred_url":"https://api.github.com/users/mashedcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mashedcode/subscriptions","organizations_url":"https://api.github.com/users/mashedcode/orgs","repos_url":"https://api.github.com/users/mashedcode/repos","events_url":"https://api.github.com/users/mashedcode/events{/privacy}","received_events_url":"https://api.github.com/users/mashedcode/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-30T05:58:32Z","updated_at":"2018-10-30T05:58:32Z","closed_at":null,"author_association":"NONE","body":"The code below doesn't compile anymore since nightly-2018-10-05:\r\n\r\n```rust\r\nuse std::marker::PhantomData;\r\n\r\npub trait FooTypeHack: for<'a, 'b> FooType<'a, 'b> {}\r\nimpl<T: for<'a, 'b> FooType<'a, 'b>> FooTypeHack for T {}\r\n\r\npub trait FooType<'a, 'b: 'a> {\r\n    type Foo: Foo<'a, 'b>;\r\n}\r\n\r\npub trait Foo<'a, 'b: 'a> {}\r\n\r\npub struct FooStruct<T>\r\nwhere\r\n    T: FooTypeHack,\r\n{\r\n    _t: PhantomData<T>,\r\n}\r\n\r\nimpl<T> FooStruct<T>\r\nwhere\r\n    T: FooTypeHack,\r\n{\r\n    fn new() -> Self {\r\n        Self { _t: PhantomData }\r\n    }\r\n}\r\n\r\npub struct FooTypeImpl {}\r\nimpl<'a, 'b: 'a> FooType<'a, 'b> for FooTypeImpl {\r\n    type Foo = FooImpl<'a, 'b>;\r\n}\r\n\r\npub struct FooImpl<'a, 'b: 'a> {\r\n    _a: &'a PhantomData<&'b String>,\r\n}\r\n\r\nimpl<'a, 'b> Foo<'a, 'b> for FooImpl<'a, 'b> {}\r\n\r\nfn main() {\r\n    FooStruct::<FooTypeImpl>::new();\r\n}\r\n\r\n```\r\n\r\n([Playground](?version=nightly&mode=debug&edition=2015&gist=9721f016caca3717143b100878896068))\r\n\r\nOne would expect this to compile since it compiles on stable. Instead it throws:\r\n\r\n```\r\nerror[E0279]: the requirement `for<'b, 'a> 'b : 'a` is not satisfied (`expected bound lifetime parameter 'a, found concrete lifetime`)\r\n  --> src/main.rs:40:5\r\n```\r\n\r\nAFAIK `for<'b, 'a> 'b: 'a` can currently not be satisfied in rust therefore this should compile."}}
{"actor":{"display_login":"mashedcode"}}