{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/1560","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1560/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1560/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1560/events","html_url":"https://github.com/rust-lang/rfcs/pull/1560","id":144165483,"number":1560,"title":"Changes to name resolution","user":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rfcs/labels/T-lang","name":"T-lang","color":"bfd4f2"}],"state":"open","locked":false,"assignee":{"login":"nrc","id":762626,"avatar_url":"https://avatars.githubusercontent.com/u/762626?v=3","gravatar_id":"","url":"https://api.github.com/users/nrc","html_url":"https://github.com/nrc","followers_url":"https://api.github.com/users/nrc/followers","following_url":"https://api.github.com/users/nrc/following{/other_user}","gists_url":"https://api.github.com/users/nrc/gists{/gist_id}","starred_url":"https://api.github.com/users/nrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nrc/subscriptions","organizations_url":"https://api.github.com/users/nrc/orgs","repos_url":"https://api.github.com/users/nrc/repos","events_url":"https://api.github.com/users/nrc/events{/privacy}","received_events_url":"https://api.github.com/users/nrc/received_events","type":"User","site_admin":false},"milestone":null,"comments":17,"created_at":"2016-03-29T06:04:23Z","updated_at":"2016-04-12T21:29:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1560","html_url":"https://github.com/rust-lang/rfcs/pull/1560","diff_url":"https://github.com/rust-lang/rfcs/pull/1560.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/1560.patch"},"body":"Some internal and language-level changes to name resolution.\r\n\r\nInternally, name resolution will be split into two parts - import resolution and\r\nname lookup. Import resolution is moved forward in time to happen in the same\r\nphase as parsing and macro expansion. Name lookup remains where name resolution\r\ncurrently takes place (that may change in the future, but is outside the scope\r\nof this RFC). However, name lookup can be done earlier if required (importantly\r\nit can be done during macro expansion to allow using the module system for\r\nmacros, also outside the scope of this RFC). Import resolution will use a new\r\nalgorithm.\r\n\r\nThe observable effects of this RFC (i.e., language changes) are some increased\r\nflexibility in the name resolution rules, especially around globs and shadowing.\r\n\r\n[rendered](https://github.com/nrc/rfcs/blob/aac02932e3c3b5749d1c15b83813ca1c3ef00281/text/0000-name-resolution.md)"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/209110244","html_url":"https://github.com/rust-lang/rfcs/pull/1560#issuecomment-209110244","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1560","id":209110244,"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":"2016-04-12T21:29:02Z","updated_at":"2016-04-12T21:29:02Z","body":"I'm finding it hard to reason about the precise model proposed here, I admit. I wonder if there is a way to make the write up a bit more declarative.\r\n\r\nIn any case, I **think** the only change here that I found problematic when working on my [name resolution prototype](https://github.com/nikomatsakis/rust-name-resolution-algorithm) was this one:\r\n\r\n> Note that shadowing is namespace specific. I believe this is consistent with our general approach to name spaces.\r\n\r\nI think the problem had to do with the possibility that, in some round, we would bring in a name from a glob that would later have to be shadowed, but we didn't know at the time whether it ought to be shadowed or not. I'll try to see if I can come up with a precise example."}}