{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/54296","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/54296/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/54296/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/54296/events","html_url":"https://github.com/rust-lang/rust/issues/54296","id":360909474,"node_id":"MDU6SXNzdWUzNjA5MDk0NzQ=","number":54296,"title":"Trait resolution in associated types depends on ordering of traits in bounds.","user":{"login":"Lymia","id":483849,"node_id":"MDQ6VXNlcjQ4Mzg0OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/483849?v=4","gravatar_id":"","url":"https://api.github.com/users/Lymia","html_url":"https://github.com/Lymia","followers_url":"https://api.github.com/users/Lymia/followers","following_url":"https://api.github.com/users/Lymia/following{/other_user}","gists_url":"https://api.github.com/users/Lymia/gists{/gist_id}","starred_url":"https://api.github.com/users/Lymia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lymia/subscriptions","organizations_url":"https://api.github.com/users/Lymia/orgs","repos_url":"https://api.github.com/users/Lymia/repos","events_url":"https://api.github.com/users/Lymia/events{/privacy}","received_events_url":"https://api.github.com/users/Lymia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-17T14:57:28Z","updated_at":"2018-09-17T14:57:28Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"[The following code](https://play.rust-lang.org/?gist=accaf19c611e4c88c0fb590161e66cb5&version=stable&mode=debug&edition=2015) fails to compile:\r\n\r\n```rust\r\nuse std::ops::*;\r\npub trait Trait {\r\n    type Num: Sized + Shl<usize, Output = Self::Num> + Shl<u32, Output = Self::Num>;\r\n}\r\npub fn function<T: Trait>(t: T::Num, b: usize) -> T::Num {\r\n  t << b\r\n}\r\n```\r\n\r\nIt gives this error:\r\n\r\n```\r\nerror[E0308]: mismatched types\r\n --> src/lib.rs:6:8\r\n  |\r\n6 |   t << b\r\n  |        ^ expected u32, found usize\r\n\r\nerror: aborting due to previous error\r\n```\r\n\r\nThis error is cleared if the order if the two `Shl` bounds is reversed, as in [the following code](https://play.rust-lang.org/?gist=bf2dc4b7a4870ecb618bf8c6360ac651&version=stable&mode=debug&edition=2015):\r\n\r\n```rust\r\nuse std::ops::*;\r\npub trait Trait {\r\n    type Num: Sized + Shl<u32, Output = Self::Num> + Shl<usize, Output = Self::Num>;\r\n}\r\npub fn function<T: Trait>(t: T::Num, b: usize) -> T::Num {\r\n  t << b\r\n}\r\n```"}}
{"actor":{"display_login":"Lymia"}}