{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/24518","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/24518/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/24518/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/24518/events","html_url":"https://github.com/rust-lang/rust/issues/24518","id":69063920,"number":24518,"title":"Make libsyntax compile with minimal amount of feature flags","user":{"login":"erickt","id":84711,"avatar_url":"https://avatars.githubusercontent.com/u/84711?v=3","gravatar_id":"","url":"https://api.github.com/users/erickt","html_url":"https://github.com/erickt","followers_url":"https://api.github.com/users/erickt/followers","following_url":"https://api.github.com/users/erickt/following{/other_user}","gists_url":"https://api.github.com/users/erickt/gists{/gist_id}","starred_url":"https://api.github.com/users/erickt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erickt/subscriptions","organizations_url":"https://api.github.com/users/erickt/orgs","repos_url":"https://api.github.com/users/erickt/repos","events_url":"https://api.github.com/users/erickt/events{/privacy}","received_events_url":"https://api.github.com/users/erickt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rust-lang/rust/labels/A-metadata","name":"A-metadata","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-17T05:09:27Z","updated_at":"2015-04-24T15:40:00Z","closed_at":null,"body":"This a meta-bug that's tracking getting libsyntax to compile with the smallest possible feature flag set so that I can use it as the foundation for [syntex](https://github.com/erickt/rust-syntex). I've done a bunch of the work in #24487, but here are some more longer term dependencies that need some planning:\r\n\r\n Here's what needs to be done:\r\n\r\n`#[feature(core)]`:\r\n- [x] `Int::zero()` in ast\r\n- [x] `ToPrimitive` in codemap\r\n- [x] `usize::to_u32()` in codemap\r\n- [x] `ptr::read_and_drop()` in fold\r\n- [x] `slice::ref_slice()` in parser\r\n\r\n`#[feature(collections)]`:\r\n- [ ] `std::collections::BitSet`\r\n- [x] `String::escape_default`\r\n\r\n`#[feature(libc)]`:\r\n- [x] `libc::c_uint` in codemap.rs\r\n- [ ] `libc::isatty(libc::STDERR_FILENO)` in diagnostic.rs\r\n\r\n`#[feature(unicode)]`:\r\n- [x] `char.width()` in diagnostic.rs\r\n- [x] `char.is_xid_start()` in lexer\r\n- [x] `char.is_xid_continue()` in lexer\r\n\r\n`#[feature(path_ext)]`:\r\n- [x] `Path::exists()` - easily replaced with call to metadata\r\n\r\n`#[feature(str_char)]`:\r\n- [x] `str::char_at()` - replace with `s.chars().take()`\r\n- [x] `str::slice_shift_char()`\r\n\r\n`#[feature(rustc_private)]`:\r\n- [ ] `arena`\r\n- [ ] `fmt_macros`\r\n- [ ] `term` - can use https://github.com/rust-lang/term"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/95970184","html_url":"https://github.com/rust-lang/rust/issues/24518#issuecomment-95970184","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/24518","id":95970184,"user":{"login":"erickt","id":84711,"avatar_url":"https://avatars.githubusercontent.com/u/84711?v=3","gravatar_id":"","url":"https://api.github.com/users/erickt","html_url":"https://github.com/erickt","followers_url":"https://api.github.com/users/erickt/followers","following_url":"https://api.github.com/users/erickt/following{/other_user}","gists_url":"https://api.github.com/users/erickt/gists{/gist_id}","starred_url":"https://api.github.com/users/erickt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erickt/subscriptions","organizations_url":"https://api.github.com/users/erickt/orgs","repos_url":"https://api.github.com/users/erickt/repos","events_url":"https://api.github.com/users/erickt/events{/privacy}","received_events_url":"https://api.github.com/users/erickt/received_events","type":"User","site_admin":false},"created_at":"2015-04-24T15:40:00Z","updated_at":"2015-04-24T15:40:00Z","body":"@alexcrichton: Regarding BitSet, it's only used in [attr.rs](https://github.com/rust-lang/rust/blob/master/src/libsyntax/attr.rs#L32) in order to speed up tracking if an attribute has been used or not. We got three options for syntex:\r\n\r\n1. Replace it in libsyntax with `HashSet` with the assumption that we don't actually have that many attributes, that the overhead of using a whole `usize` might not really impact memory usage.\r\n2. Pull `BitSet` library into an external crate and use it in syntex.\r\n3. Have a patch in syntex that swaps `attr.rs`'s use of `BitSet` with `HashSet`.\r\n\r\nWhat do you think is best?"}}