{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/1311","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1311/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1311/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1311/events","html_url":"https://github.com/rust-lang/rfcs/issues/1311","id":110358370,"number":1311,"title":"use some::Trait as _;","user":{"login":"arcnmx","id":13426784,"avatar_url":"https://avatars.githubusercontent.com/u/13426784?v=3","gravatar_id":"","url":"https://api.github.com/users/arcnmx","html_url":"https://github.com/arcnmx","followers_url":"https://api.github.com/users/arcnmx/followers","following_url":"https://api.github.com/users/arcnmx/following{/other_user}","gists_url":"https://api.github.com/users/arcnmx/gists{/gist_id}","starred_url":"https://api.github.com/users/arcnmx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arcnmx/subscriptions","organizations_url":"https://api.github.com/users/arcnmx/orgs","repos_url":"https://api.github.com/users/arcnmx/repos","events_url":"https://api.github.com/users/arcnmx/events{/privacy}","received_events_url":"https://api.github.com/users/arcnmx/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":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-10-08T02:15:59Z","updated_at":"2016-08-22T21:05:02Z","closed_at":null,"body":"# mini/pre RFC\r\n\r\n`use some::Trait as _;`\r\n\r\nThis would allow importing a trait into scope for resolution reasons, without being able to reference it by ident directly.\r\n\r\n## Motivation\r\n\r\nI've found a need for `use some::Trait as __Trait;` in order to avoid conflicts with another type in scope. It tends to come up when dealing with abstractions and wrappers that have similar type names.\r\n\r\n## Alternatives\r\n\r\n- Some other syntax? I feel like this choice meshes well with Rust in general.\r\n- Not doing this at all. Is it necessary/useful enough to warrant the minor language change?\r\n- Workarounds in current rust:\r\n    - `use some::Trait as __Trait;`\r\n    - UFCS: `use some; some::Trait::method(etc);`\r\n    - Using names like `TraitImp` for your concrete types instead.\r\n\r\n## Unresolved Questions\r\n\r\nWildcard version? `use some::* as _` could work well for importing preludes.\r\n\r\nAllow use with `pub` to make them available for constructing preludes?\r\n\r\nActual design? A simple approach might be to simply implement this as sugar for mangling the trait name in some way (ideally with the full path of the module to accomodate for `pub` exporting). A real implementation would make them truly hidden as identifiers, but otherwise usable for deciding whether a trait is applicable.\r\n\r\nWould this be valid for non-trait types such as structures, type aliases, etc? I'd imagine the wildcard case would simply ignore them, but the explicit syntax would be weird and useless."},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/241550040","html_url":"https://github.com/rust-lang/rfcs/issues/1311#issuecomment-241550040","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1311","id":241550040,"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},"created_at":"2016-08-22T21:05:02Z","updated_at":"2016-08-22T21:05:02Z","body":"+1, this would be nice to have.\r\n\r\ncc @jseyfried, @petrochenkov, @nikomatsakis "}}
{"actor":{"display_login":"nrc"}}