{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/25017","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/25017/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/25017/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/25017/events","html_url":"https://github.com/rust-lang/rust/issues/25017","id":72318370,"number":25017,"title":"Associated consts from traits not always resolved in match patterns","user":{"login":"quantheory","id":1740206,"avatar_url":"https://avatars.githubusercontent.com/u/1740206?v=3","gravatar_id":"","url":"https://api.github.com/users/quantheory","html_url":"https://github.com/quantheory","followers_url":"https://api.github.com/users/quantheory/followers","following_url":"https://api.github.com/users/quantheory/following{/other_user}","gists_url":"https://api.github.com/users/quantheory/gists{/gist_id}","starred_url":"https://api.github.com/users/quantheory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantheory/subscriptions","organizations_url":"https://api.github.com/users/quantheory/orgs","repos_url":"https://api.github.com/users/quantheory/repos","events_url":"https://api.github.com/users/quantheory/events{/privacy}","received_events_url":"https://api.github.com/users/quantheory/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-associated-items","name":"A-associated-items","color":"d7e102"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-01T00:24:41Z","updated_at":"2015-05-14T07:08:16Z","closed_at":"2015-05-14T07:08:16Z","body":"Note that the following addition to the `associated-const-match-patterns` test would fail:\r\n```rust\r\nassert!(match Bar::Var1 {\r\n    Foo::THEBAR => true,\r\n    _ => false,\r\n});\r\n```\r\nHowever, the existing test uses `<Foo>::THEBAR` and passes, even though the two syntaxes should be equivalent. There is no particularly deep issue here, I just seem to have been misunderstanding UFCS on the day when I wrote the `resolve` code involved, and as a result only inherent impls are picked up unless you use angle brackets. I plan to have a PR to fix this and a few other easy issues this weekend.\r\n\r\nFor future reference, this *should* be the case for associated constants:\r\n```\r\nType::CONST // Equivalent to `<Type>::CONST`\r\n<Type>::CONST // Resolves to `CONST` in an inherent impl if there is one, else a trait impl if not ambiguous.\r\nTrait::CONST // Meaningless; there is absolutely no way to resolve this.\r\n<Trait>::CONST // Currently meaningless, but may be useful if we add constants to the vtable for  trait objects in the future.\r\n<Type as Trait>::CONST // Resolves to the particular impl of `Trait for Type`.\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/101948616","html_url":"https://github.com/rust-lang/rust/issues/25017#issuecomment-101948616","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/25017","id":101948616,"user":{"login":"quantheory","id":1740206,"avatar_url":"https://avatars.githubusercontent.com/u/1740206?v=3","gravatar_id":"","url":"https://api.github.com/users/quantheory","html_url":"https://github.com/quantheory","followers_url":"https://api.github.com/users/quantheory/followers","following_url":"https://api.github.com/users/quantheory/following{/other_user}","gists_url":"https://api.github.com/users/quantheory/gists{/gist_id}","starred_url":"https://api.github.com/users/quantheory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quantheory/subscriptions","organizations_url":"https://api.github.com/users/quantheory/orgs","repos_url":"https://api.github.com/users/quantheory/repos","events_url":"https://api.github.com/users/quantheory/events{/privacy}","received_events_url":"https://api.github.com/users/quantheory/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T07:08:16Z","updated_at":"2015-05-14T07:08:16Z","body":"Closing due to merge of #25065."}}