Skip to content

Instantly share code, notes, and snippets.

@aturon
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aturon/da49a6d00099fdb0e861 to your computer and use it in GitHub Desktop.
Save aturon/da49a6d00099fdb0e861 to your computer and use it in GitHub Desktop.
What do we gain with new elision rules for libstd
First Column: (F) Function (I) Impl (U) Unused
Second Column: Number In / Number Out
Third Column: Lifetimes elidable with proposed rules.
SUMMARY
169 currently annotated
147 elidable with proposed rules
22 still annotated under proposed rules
===
87% of *current* annotations are elidable (not counting already-elided cases)
F 1I/1O √ c_vec.rs:103: pub fn as_slice<'a>(&'a self) -> &'a [T] {
F 1I/1O √ c_vec.rs:110: pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T] {
F 1I/1O √ c_vec.rs:128: pub fn get_mut<'a>(&'a mut self, ofs: uint) -> Option<&'a mut T> {
F 1I/1O √ c_vec.rs:118: pub fn get<'a>(&'a self, ofs: uint) -> Option<&'a T> {
F 2I/1O X comm/select.rs:117: pub fn handle<'a, T: Send>(&'a self, rx: &'a Receiver<T>) -> Handle<'a, T> {
F 1I/2O √ comm/sync.rs:164: fn lock<'a>(&'a self) -> (LockGuard<'a>, &'a mut State<T>) {
F 1I/1O √ comm/mod.rs:398: fn inner_unsafe<'a>(&'a self) -> &'a Unsafe<Flavor<T>>;
F 1I/1O √ comm/mod.rs:399: unsafe fn mut_inner<'a>(&'a self) -> &'a mut Flavor<T> {
F 1I/1O √ comm/mod.rs:402: unsafe fn inner<'a>(&'a self) -> &'a Flavor<T> {
F 1I/1O √ comm/mod.rs:407: fn inner_unsafe<'a>(&'a self) -> &'a Unsafe<Flavor<T>> {
F 1I/1O √ comm/mod.rs:412: fn inner_unsafe<'a>(&'a self) -> &'a Unsafe<Flavor<T>> {
F 1I/1O √ comm/mod.rs:877: pub fn iter<'a>(&'a self) -> Messages<'a, T> {
I 1I/0O √ comm/mod.rs:969:impl<'a, T: Send> Iterator<T> for Messages<'a, T> {
F 1I/1O √ io/tempfile.rs:77: pub fn path<'a>(&'a self) -> &'a Path {
F 1I/1O √ io/process.rs:148: pub fn arg<'a, T:ToCStr>(&'a mut self, arg: T) -> &'a mut Command {
F 2I/1O √ io/process.rs:154: pub fn args<'a, T:ToCStr>(&'a mut self, args: &[T]) -> &'a mut Command {
F 2I/1O √ io/process.rs:169: pub fn env<'a, T:ToCStr>(&'a mut self, env: &[(T,T)]) -> &'a mut Command {
F 2I/1O √ io/process.rs:177: pub fn cwd<'a>(&'a mut self, dir: &Path) -> &'a mut Command {
F 1I/1O √ io/process.rs:184: pub fn stdin<'a>(&'a mut self, cfg: StdioContainer) -> &'a mut Command {
F 1I/1O √ io/process.rs:191: pub fn stdout<'a>(&'a mut self, cfg: StdioContainer) -> &'a mut Command {
F 1I/1O √ io/process.rs:198: pub fn stderr<'a>(&'a mut self, cfg: StdioContainer) -> &'a mut Command {
F 1I/1O √ io/process.rs:206: pub fn extra_io<'a>(&'a mut self, cfg: StdioContainer) -> &'a mut Command {
F 1I/1O √ io/process.rs:215: pub fn uid<'a>(&'a mut self, id: uint) -> &'a mut Command {
F 1I/1O √ io/process.rs:222: pub fn gid<'a>(&'a mut self, id: uint) -> &'a mut Command {
F 1I/1O √ io/process.rs:229: pub fn detached<'a>(&'a mut self) -> &'a mut Command {
I 1I/0O X io/net/ip.rs:80:impl<'a> Parser<'a> {
F 1I/1O X io/net/ip.rs:81: fn new(s: &'a str) -> Parser<'a> {
F 1I/1O √ io/fs.rs:192: pub fn path<'a>(&'a self) -> &'a Path {
F 1I/1O √ io/fs.rs:813: fn path<'a>(&'a self) -> &'a Path {
F 1I/1O √ io/buffered.rs:80: pub fn get_ref<'a>(&'a self) -> &'a R { &self.inner }
F 1I/1O √ io/buffered.rs:89: fn fill_buf<'a>(&'a mut self) -> IoResult<&'a [u8]> {
F 1I/1O √ io/buffered.rs:175: pub fn get_ref<'a>(&'a self) -> &'a W { self.inner.get_ref() }
F 1I/1O √ io/buffered.rs:239: pub fn get_ref<'a>(&'a self) -> &'a W { self.inner.get_ref() }
F 1I/1O √ io/buffered.rs:266: fn get_mut_ref<'a>(&'a mut self) -> &'a mut BufferedWriter<W> {
F 1I/1O √ io/buffered.rs:332: pub fn get_ref<'a>(&'a self) -> &'a S {
F 1I/1O √ io/buffered.rs:348: fn fill_buf<'a>(&'a mut self) -> IoResult<&'a [u8]> { self.inner.fill_buf() }
F 1I/1O √ io/mem.rs:76: pub fn get_ref<'a>(&'a self) -> &'a [u8] { self.buf.as_slice() }
F 1I/1O √ io/mem.rs:160: pub fn get_ref<'a>(&'a self) -> &'a [u8] { self.buf.as_slice() }
F 1I/1O √ io/mem.rs:194: fn fill_buf<'a>(&'a mut self) -> IoResult<&'a [u8]> {
F 1I/0O √ io/mem.rs:227:impl<'a> BufWriter<'a> {
F 1I/1O √ io/mem.rs:230: pub fn new<'a>(buf: &'a mut [u8]) -> BufWriter<'a> {
I 1I/0O √ io/mem.rs:238:impl<'a> Writer for BufWriter<'a> {
I 1I/0O √ io/mem.rs:256:impl<'a> Seek for BufWriter<'a> {
I 1I/0O X io/mem.rs:283:impl<'a> BufReader<'a> {
F 1I/1O X io/mem.rs:285: pub fn new<'a>(buf: &'a [u8]) -> BufReader<'a> {
I 1I/0O √ io/mem.rs:298:impl<'a> Reader for BufReader<'a> {
I 1I/0O √ io/mem.rs:316:impl<'a> Seek for BufReader<'a> {
I 1I/0O √ io/mem.rs:325:impl<'a> Buffer for BufReader<'a> {
F 1I/1O √ io/mem.rs:326: fn fill_buf<'a>(&'a mut self) -> IoResult<&'a [u8]> {
F 1I/1O √ io/util.rs:59: fn fill_buf<'a>(&'a mut self) -> io::IoResult<&'a [u8]> {
F 1I/1O √ io/util.rs:96: fn fill_buf<'a>(&'a mut self) -> io::IoResult<&'a [u8]> {
F 1I/1O √ io/util.rs:114: fn fill_buf<'a>(&'a mut self) -> io::IoResult<&'a [u8]> {
F 1I/1O √ io/mod.rs:903: fn by_ref<'a>(&'a mut self) -> RefReader<'a, Self> {
I 1I/0O √ io/mod.rs:912:impl<'a> Reader for &'a mut Reader {
F 1I/1O √ io/mod.rs:927:unsafe fn slice_vec_capacity<'a, T>(v: &'a mut Vec<T>, start: uint, end: uint) -> &'a mut [T] {
I 1I/0O √ io/mod.rs:968:impl<'a, R: Reader> Reader for RefReader<'a, R> {
I 1I/0O √ io/mod.rs:972:impl<'a, R: Buffer> Buffer for RefReader<'a, R> {
F 1I/1O √ io/mod.rs:973: fn fill_buf<'a>(&'a mut self) -> IoResult<&'a [u8]> { self.inner.fill_buf() }
I 1I/0O √ io/mod.rs:1027: impl<'a, T: Writer> fmt::FormatWriter for Adaptor<'a, T> {
F 1I/1O √ io/mod.rs:1208: fn by_ref<'a>(&'a mut self) -> RefWriter<'a, Self> {
I 1I/0O √ io/mod.rs:1218:impl<'a> Writer for &'a mut Writer {
I 1I/0O √ io/mod.rs:1252:impl<'a, W: Writer> Writer for RefWriter<'a, W> {
F 1I/1O √ io/mod.rs:1336: fn fill_buf<'a>(&'a mut self) -> IoResult<&'a [u8]>;
I 1I/0O √ io/mod.rs:1548:impl<'a, T, A: Acceptor<T>> Iterator<IoResult<T>> for IncomingConnections<'a, A> {
I 0I/1O X rand/mod.rs:132:impl<'a> SeedableRng<&'a [uint]> for StdRng {
F 2I/0O X rand/mod.rs:133: fn reseed(&mut self, seed: &'a [uint]) {
F 1I/0O X rand/mod.rs:139: fn from_seed(seed: &'a [uint]) -> StdRng {
I 1I/0O √ fmt.rs:546:impl<'a> Writer for Formatter<'a> {
U ascii.rs:171:impl<'a> fmt::Show for Ascii {
I 1I/1O X ascii.rs:203:impl<'a> AsciiCast<&'a[Ascii]> for &'a [u8] {
F 1I/1O X ascii.rs:205: unsafe fn to_ascii_nocheck(&self) -> &'a[Ascii] {
I 1I/1O X ascii.rs:218:impl<'a> AsciiCast<&'a [Ascii]> for &'a str {
F 1I/1O X ascii.rs:220: unsafe fn to_ascii_nocheck(&self) -> &'a [Ascii] {
F 1I/1O √ ascii.rs:322: fn as_str_ascii<'a>(&'a self) -> &'a str;
I 1I/0O √ ascii.rs:334:impl<'a> AsciiStr for &'a [Ascii] {
F 1I/1O √ ascii.rs:336: fn as_str_ascii<'a>(&'a self) -> &'a str {
I 1I/0O √ ascii.rs:417:impl<'a> StrAsciiExt for &'a str {
F 1I/1O √ sync/deque.rs:202: pub fn pool<'a>(&'a self) -> &'a BufferPool<T> {
F 1I/1O √ sync/deque.rs:216: pub fn pool<'a>(&'a self) -> &'a BufferPool<T> {
F 1I/1O √ sync/spsc_queue.rs:201: pub fn peek<'a>(&'a self) -> Option<&'a mut T> {
F 1I/2O √ collections/hashmap.rs:294: pub fn read<'a>(&'a self, index: &FullIndex) -> (&'a K, &'a V) {
F 1I/2O √ collections/hashmap.rs:306: pub fn read_mut<'a>(&'a mut self, index: &FullIndex) -> (&'a K, &'a mut V) {
F 1I/5O √ collections/hashmap.rs:317: pub fn read_all_mut<'a>(&'a mut self, index: &FullIndex)
collections/hashmap.rs:318: -> (&'a mut SafeHash, &'a mut K, &'a mut V) {
collections/hashmap.rs:324: &'a mut *self.keys.offset(idx),
collections/hashmap.rs:325: &'a mut *self.vals.offset(idx))
F 1I/1O √ collections/hashmap.rs:387: pub fn iter<'a>(&'a self) -> Entries<'a, K, V> {
F 1I/1O √ collections/hashmap.rs:391: pub fn mut_iter<'a>(&'a mut self) -> MutEntries<'a, K, V> {
I 1I/2O X collections/hashmap.rs:434: impl<'a, K, V> Iterator<(&'a K, &'a V)> for Entries<'a, K, V> {
F 1I/2O X collections/hashmap.rs:435: fn next(&mut self) -> Option<(&'a K, &'a V)> {
I 1I/2O X collections/hashmap.rs:458: impl<'a, K, V> Iterator<(&'a K, &'a mut V)> for MutEntries<'a, K, V> {
F 1I/2O X collections/hashmap.rs:459: fn next(&mut self) -> Option<(&'a K, &'a mut V)> {
F 2I/1O √ collections/hashmap.rs:955: fn find<'a>(&'a self, k: &K) -> Option<&'a V> {
F 2I/1O √ collections/hashmap.rs:968: fn find_mut<'a>(&'a mut self, k: &K) -> Option<&'a mut V> {
F 1I/1O √ collections/hashmap.rs:1186: fn insert_hashed_nocheck<'a>(
collections/hashmap.rs:1187: &'a mut self, hash: table::SafeHash, k: K, v: V) -> &'a mut V {
F 1I/1O √ collections/hashmap.rs:1238: fn insert_hashed<'a>(&'a mut self, hash: table::SafeHash, k: K, v: V) -> &'a mut V {
F 1I/1O √ collections/hashmap.rs:1246: pub fn find_or_insert<'a>(&'a mut self, k: K, v: V) -> &'a mut V {
F 1I/1O √ collections/hashmap.rs:1252: pub fn find_or_insert_with<'a>(&'a mut self, k: K, f: |&K| -> V)
collections/hashmap.rs:1253: -> &'a mut V {
F 1I/1O √ collections/hashmap.rs:1260: pub fn insert_or_update_with<'a>(
collections/hashmap.rs:1261: &'a mut self,
collections/hashmap.rs:1265: -> &'a mut V {
F 1I/1O √ collections/hashmap.rs:1311: pub fn find_with_or_insert_with<'a, A>(&'a mut self,
collections/hashmap.rs:1316: -> &'a mut V {
F 1I/1O √ collections/hashmap.rs:1332: pub fn get<'a>(&'a self, k: &K) -> &'a V {
F 2I/1O √ collections/hashmap.rs:1340: pub fn get_mut<'a>(&'a mut self, k: &K) -> &'a mut V {
F 2I/1O √ collections/hashmap.rs:1355: pub fn find_equiv<'a, Q: Hash<S> + Equiv<K>>(&'a self, k: &Q) -> Option<&'a V> {
F 1I/1O √ collections/hashmap.rs:1367: pub fn keys<'a>(&'a self) -> Keys<'a, K, V> {
F 1I/1O √ collections/hashmap.rs:1373: pub fn values<'a>(&'a self) -> Values<'a, K, V> {
F 1I/1O √ collections/hashmap.rs:1379: pub fn iter<'a>(&'a self) -> Entries<'a, K, V> {
F 1I/1O √ collections/hashmap.rs:1386: pub fn mut_iter<'a>(&'a mut self) -> MutEntries<'a, K, V> {
F 1I/1O √ collections/hashmap.rs:1578: pub fn iter<'a>(&'a self) -> SetItems<'a, T> {
F 2I/1O X collections/hashmap.rs:1590: pub fn difference<'a>(&'a self, other: &'a HashSet<T, H>) -> SetAlgebraItems<'a, T, H> {
F 2I/2O X collections/hashmap.rs:1598: pub fn symmetric_difference<'a>(&'a self, other: &'a HashSet<T, H>)
collections/hashmap.rs:1599: -> Chain<SetAlgebraItems<'a, T, H>, SetAlgebraItems<'a, T, H>> {
F 2I/1O X collections/hashmap.rs:1604: pub fn intersection<'a>(&'a self, other: &'a HashSet<T, H>)
collections/hashmap.rs:1605: -> SetAlgebraItems<'a, T, H> {
F 2I/1O X collections/hashmap.rs:1613: pub fn union<'a>(&'a self, other: &'a HashSet<T, H>)
collections/hashmap.rs:1614: -> Chain<SetItems<'a, T>, SetAlgebraItems<'a, T, H>> {
F 2I/1O √ collections/lru_cache.rs:140: pub fn get<'a>(&'a mut self, k: &K) -> Option<&'a V> {
I 1I/0O √ path/windows.rs:118:impl<'a> ToCStr for &'a Path {
F 1I/1O √ path/windows.rs:146: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/windows.rs:154: fn container_as_str<'a>(&'a self) -> Option<&'a str> {
I 1I/0O √ path/windows.rs:161:impl<'a> BytesContainer for &'a Path {
F 1I/1O √ path/windows.rs:163: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/windows.rs:167: fn container_as_str<'a>(&'a self) -> Option<&'a str> {
F 1I/0O √ path/windows.rs:171: fn is_str(_: Option<&'a Path>) -> bool { true }
F 1I/1O √ path/windows.rs:344: fn as_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/windows.rs:349: fn as_vec<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/windows.rs:359: fn dirname<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/windows.rs:365: fn dirname_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/windows.rs:388: fn filename<'a>(&'a self) -> Option<&'a [u8]> {
F 1I/1O √ path/windows.rs:394: fn filename_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/windows.rs:408: fn filestem_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/windows.rs:414: fn extension_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/windows.rs:636: pub fn str_components<'a>(&'a self) -> StrComponents<'a> {
F 1I/1O √ path/windows.rs:654: pub fn components<'a>(&'a self) -> Components<'a> {
F 1I/1O √ path/windows.rs:655: fn convert<'a>(x: Option<&'a str>) -> &'a [u8] {
F 1I/0O √ path/windows.rs:976:fn parse_prefix<'a>(mut path: &'a str) -> Option<PathPrefix> {
F 1I/0O √ path/windows.rs:1026: fn parse_two_comps<'a>(mut path: &'a str, f: |char| -> bool)
F 1I/1O √ path/windows.rs:1039:fn normalize_helper<'a>(s: &'a str, prefix: Option<PathPrefix>) -> (bool, Option<Vec<&'a str>>) {
I 1I/0O √ path/posix.rs:97:impl<'a> ToCStr for &'a Path {
F 1I/1O √ path/posix.rs:118: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
I 1I/0O √ path/posix.rs:127:impl<'a> BytesContainer for &'a Path {
F 1I/1O √ path/posix.rs:129: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/posix.rs:195: fn as_vec<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/posix.rs:203: fn dirname<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/posix.rs:213: fn filename<'a>(&'a self) -> Option<&'a [u8]> {
F 1I/1O √ path/posix.rs:400: pub fn components<'a>(&'a self) -> Components<'a> {
F 1I/1O √ path/posix.rs:414: pub fn str_components<'a>(&'a self) -> StrComponents<'a> {
F 1I/1O √ path/posix.rs:420:fn normalize_helper<'a>(v: &'a [u8], is_abs: bool) -> Option<Vec<&'a [u8]>> {
F 1I/1O √ path/mod.rs:170: fn as_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/mod.rs:175: fn as_vec<'a>(&'a self) -> &'a [u8];
F 1I/1O √ path/mod.rs:183: fn display<'a>(&'a self) -> Display<'a, Self> {
F 1I/1O √ path/mod.rs:191: fn filename_display<'a>(&'a self) -> Display<'a, Self> {
F 1I/1O √ path/mod.rs:197: fn dirname<'a>(&'a self) -> &'a [u8];
F 1I/1O √ path/mod.rs:201: fn dirname_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/mod.rs:207: fn filename<'a>(&'a self) -> Option<&'a [u8]>;
F 1I/1O √ path/mod.rs:211: fn filename_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/mod.rs:217: fn filestem<'a>(&'a self) -> Option<&'a [u8]> {
F 1I/1O √ path/mod.rs:233: fn filestem_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/mod.rs:240: fn extension<'a>(&'a self) -> Option<&'a [u8]> {
F 1I/1O √ path/mod.rs:256: fn extension_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/mod.rs:434: fn container_as_bytes<'a>(&'a self) -> &'a [u8];
F 1I/1O √ path/mod.rs:442: fn container_as_str<'a>(&'a self) -> Option<&'a str> {
I 1I/0O √ path/mod.rs:473:impl<'a, P: GenericPath> fmt::Show for Display<'a, P> {
I 1I/0O X path/mod.rs:479:impl<'a, P: GenericPath> Display<'a, P> {
F 1I/1O X path/mod.rs:485: pub fn as_maybe_owned(&self) -> MaybeOwned<'a> {
I 1I/0O √ path/mod.rs:497:impl<'a> BytesContainer for &'a str {
F 1I/1O √ path/mod.rs:499: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/mod.rs:503: fn container_as_str<'a>(&'a self) -> Option<&'a str> {
F 1I/0O √ path/mod.rs:507: fn is_str(_: Option<&'a str>) -> bool { true }
F 1I/1O √ path/mod.rs:512: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/mod.rs:516: fn container_as_str<'a>(&'a self) -> Option<&'a str> {
F 1I/1O √ path/mod.rs:523:impl<'a> BytesContainer for &'a [u8] {
F 1I/1O √ path/mod.rs:525: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/mod.rs:532: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/mod.rs:539: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
F 1I/1O √ path/mod.rs:550: fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
I 1I/0O √ path/mod.rs:555:impl<'a> BytesContainer for str::MaybeOwned<'a> {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment