1. 19 10月, 2016 33 次提交
  2. 18 10月, 2016 7 次提交
    • F
    • B
      Auto merge of #37120 - srinivasreddy:librand, r=nrc · 16eeeac7
      bors 提交于
      run rustfmt on librand
      16eeeac7
    • N
      Optimize `Substs::super_fold_with`. · 1e4241ab
      Nicholas Nethercote 提交于
      This speeds up several rustc-benchmarks by 1--4%.
      1e4241ab
    • B
      Auto merge of #37083 - nnethercote:uleb128, r=eddyb · 753ea763
      bors 提交于
      Inline read_{un,}signed_leb128 and opaque::Decoder functions.
      
      `read_unsigned_leb128` is hot within rustc because it's heavily used
      during the reading of crate metadata. This commit tweaks its signature
      (and that of `read_signed_leb128`, for consistency) so it can increment
      the buffer index directly instead of maintaining its own copy, the
      change in which is then used by the caller to advance the index.
      
      This reduces the instruction count (as measured by Cachegrind) for some
      benchmarks a bit, e.g. hyper-0.5.0 by 0.7%.
      753ea763
    • B
      Auto merge of #36969 - nnethercote:rename-Parser-fields, r=eddyb · 3543a0f6
      bors 提交于
      Clarify the positions of the lexer and parser
      
      The lexer and parser use unclear names to indicate their positions in the
      source code. I propose the following renamings.
      
      Lexer:
      ```
      pos      -> next_pos      # it's actually the next pos!
      last_pos -> pos           # it's actually the current pos!
      curr     -> ch            # the current char
      curr_is  -> ch_is         # tests the current char
      col (unchanged)           # the current column
      ```
      parser
      ```
      - last_span       -> prev_span          # the previous token's span
      - last_token_kind -> prev_token_kind    # the previous token's kind
      - LastTokenKind   -> PrevTokenKind      # ditto (but the type)
      - token (unchanged)                     # the current token
      - span (unchanged)                      # the current span
      ```
      
      Things to note:
      - This proposal removes all uses of "last", which is an unclear word because it
        could mean (a) previous, (b) final, or (c) most recent, i.e. current.
      - The "current" things (ch, col, token, span) consistently lack a prefix. The
        "previous" and "next" things consistently have a prefix.
      3543a0f6
    • N
      Inline read_{un,}signed_leb128 and opaque::Decoder functions. · 6a4bb35b
      Nicholas Nethercote 提交于
      These functions are all hot in rustc and inlining them speeds up most of
      the rustc-benchmarks by 1--2%.
      6a4bb35b
    • J
      Add stable example to TypeId · a29b5030
      Jethro Beekman 提交于
      a29b5030