{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/32274","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/32274/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/32274/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/32274/events","html_url":"https://github.com/rust-lang/rust/pull/32274","id":141119457,"number":32274,"title":"resolve: Bind primitive types to items in libcore","user":{"login":"petrochenkov","id":5751617,"avatar_url":"https://avatars.githubusercontent.com/u/5751617?v=3","gravatar_id":"","url":"https://api.github.com/users/petrochenkov","html_url":"https://github.com/petrochenkov","followers_url":"https://api.github.com/users/petrochenkov/followers","following_url":"https://api.github.com/users/petrochenkov/following{/other_user}","gists_url":"https://api.github.com/users/petrochenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/petrochenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrochenkov/subscriptions","organizations_url":"https://api.github.com/users/petrochenkov/orgs","repos_url":"https://api.github.com/users/petrochenkov/repos","events_url":"https://api.github.com/users/petrochenkov/events{/privacy}","received_events_url":"https://api.github.com/users/petrochenkov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/needs-crater","name":"needs-crater","color":"207de5"}],"state":"closed","locked":false,"assignee":{"login":"eddyb","id":77424,"avatar_url":"https://avatars.githubusercontent.com/u/77424?v=3","gravatar_id":"","url":"https://api.github.com/users/eddyb","html_url":"https://github.com/eddyb","followers_url":"https://api.github.com/users/eddyb/followers","following_url":"https://api.github.com/users/eddyb/following{/other_user}","gists_url":"https://api.github.com/users/eddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/eddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddyb/subscriptions","organizations_url":"https://api.github.com/users/eddyb/orgs","repos_url":"https://api.github.com/users/eddyb/repos","events_url":"https://api.github.com/users/eddyb/events{/privacy}","received_events_url":"https://api.github.com/users/eddyb/received_events","type":"User","site_admin":false},"milestone":null,"comments":20,"created_at":"2016-03-15T22:41:26Z","updated_at":"2016-03-24T22:49:22Z","closed_at":"2016-03-24T22:49:22Z","pull_request":{"url":"https://api.github.com/repos/rust-lang/rust/pulls/32274","html_url":"https://github.com/rust-lang/rust/pull/32274","diff_url":"https://github.com/rust-lang/rust/pull/32274.diff","patch_url":"https://github.com/rust-lang/rust/pull/32274.patch"},"body":"This is a more radical alternative to https://github.com/rust-lang/rust/pull/32131\r\nA new attribute `#[primitive_type]` is introduced. If path used in type position resolves to a `#[primitive_type]` item, the definition of a primitive type with the same name is used instead of this item.\r\nA path cannot resolve to a primitive type in any other way. Several different `#[primitive_type]` items can be resolved to one primitive type.\r\nMost of primitive types are bound to modules (`core::u8`, `core::str` etc.) for backward compatibility.\r\nAll the primitive type items are added to the prelude.\r\n\r\nPros:\r\nThis makes primitive types appear to be less special and more similar to lang items - they are defined in `libcore` (and also `libcollections`, `librustc_unicode` and `libstd`), shadowed by other items (including modules) and need to be imported before use (but prelude does it for you).\r\n\r\nCons:\r\nIt doesn't makes name resolution simpler internally, primitive types are still a hardcoded limited set of `Def::PrimTy`s known to the compiler.\r\nIt puts the burden of defining/importing primitive types on `#[no_core]` and `#[no_implicit_prelude]` code. [The alternative PR](https://github.com/rust-lang/rust/pull/32131) presents them as the second small prelude which is hardcoded and has lower priority, so the primitive types are always available.\r\n\r\n[breaking-change]\r\nNeeds crater before proceeding.\r\n\r\ncc https://github.com/rust-lang/rust/pull/32131#issuecomment-196566397\r\ncc @jseyfried \r\nr? @eddyb "},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/201062826","html_url":"https://github.com/rust-lang/rust/pull/32274#issuecomment-201062826","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/32274","id":201062826,"user":{"login":"petrochenkov","id":5751617,"avatar_url":"https://avatars.githubusercontent.com/u/5751617?v=3","gravatar_id":"","url":"https://api.github.com/users/petrochenkov","html_url":"https://github.com/petrochenkov","followers_url":"https://api.github.com/users/petrochenkov/followers","following_url":"https://api.github.com/users/petrochenkov/following{/other_user}","gists_url":"https://api.github.com/users/petrochenkov/gists{/gist_id}","starred_url":"https://api.github.com/users/petrochenkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrochenkov/subscriptions","organizations_url":"https://api.github.com/users/petrochenkov/orgs","repos_url":"https://api.github.com/users/petrochenkov/repos","events_url":"https://api.github.com/users/petrochenkov/events{/privacy}","received_events_url":"https://api.github.com/users/petrochenkov/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T22:49:22Z","updated_at":"2016-03-24T22:49:22Z","body":"Closing as per https://github.com/rust-lang/rust/pull/32131#issuecomment-201029200"}}