1. 11 1月, 2018 1 次提交
  2. 10 1月, 2018 13 次提交
    • B
      Auto merge of #47167 - ivanbakel:builtin_indexing, r=nikomatsakis · f62f7740
      bors 提交于
      Fix built-in indexing not being used where index type wasn't "obviously" usize
      
      Fixes #33903
      Fixes #46095
      
      This PR was made possible thanks to the generous help of @EddyB
      
      Following the example of binary operators, builtin checking for indexing has been moved from the typecheck stage to a writeback stage, after type constraints have been resolved.
      f62f7740
    • B
      Auto merge of #46830 - Diggsey:cursor-vec-mut, r=alexcrichton · 27ede554
      bors 提交于
      Implement `Write` for `Cursor<&mut Vec<T>>`
      
      Fixes #30132
      
      r? @dtolnay (I'm just going through `feature-accepted` issues I swear 😛)
      27ede554
    • B
      Auto merge of #47308 - frewsxcv:rollup, r=frewsxcv · 92c32d2d
      bors 提交于
      Rollup of 5 pull requests
      
      - Successful merges: #46762, #46777, #47262, #47285, #47301
      - Failed merges:
      92c32d2d
    • C
      Rollup merge of #47301 - GuillaumeGomez:fix-error-index-display, r=QuietMisdreavus · 8fbfd2c9
      Corey Farwell 提交于
      Fix error index display
      
      Fixes #47284.
      
      r? @QuietMisdreavus
      8fbfd2c9
    • C
      Rollup merge of #47285 - AndrewBrinker:master, r=kennytm · 14a9e264
      Corey Farwell 提交于
      Fixed a typo in the compile_error docs
      
      Noticed a typo and fixed it.
      14a9e264
    • C
      Rollup merge of #47262 - estebank:issue-45562, r=petrochenkov · 14284f36
      Corey Farwell 提交于
      Account for `pub` in `const` -> `static` suggestion
      
      Fix #45562.
      14284f36
    • C
      Rollup merge of #46777 - frewsxcv:frewsxcv-rotate, r=alexcrichton · e2e8cd3d
      Corey Farwell 提交于
      Deprecate [T]::rotate in favor of [T]::rotate_{left,right}.
      
      Background
      ==========
      
      Slices currently have an **unstable** [`rotate`] method which rotates
      elements in the slice to the _left_ N positions. [Here][tracking] is the
      tracking issue for this unstable feature.
      
      ```rust
      let mut a = ['a', 'b' ,'c', 'd', 'e', 'f'];
      a.rotate(2);
      assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
      ```
      
      Proposal
      ========
      
      Deprecate the [`rotate`] method and introduce `rotate_left` and
      `rotate_right` methods.
      
      ```rust
      let mut a = ['a', 'b' ,'c', 'd', 'e', 'f'];
      a.rotate_left(2);
      assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
      ```
      
      ```rust
      let mut a = ['a', 'b' ,'c', 'd', 'e', 'f'];
      a.rotate_right(2);
      assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
      ```
      
      Justification
      =============
      
      I used this method today for my first time and (probably because I’m a
      naive westerner who reads LTR) was surprised when the docs mentioned that
      elements get rotated in a left-ward direction. I was in a situation
      where I needed to shift elements in a right-ward direction and had to
      context switch from the main problem I was working on and think how much
      to rotate left in order to accomplish the right-ward rotation I needed.
      
      Ruby’s `Array.rotate` shifts left-ward, Python’s `deque.rotate` shifts
      right-ward. Both of their implementations allow passing negative numbers
      to shift in the opposite direction respectively. The current `rotate`
      implementation takes an unsigned integer argument which doesn't allow
      the negative number behavior.
      
      Introducing `rotate_left` and `rotate_right` would:
      
      - remove ambiguity about direction (alleviating need to read docs 😉)
      - make it easier for people who need to rotate right
      
      [`rotate`]: https://doc.rust-lang.org/std/primitive.slice.html#method.rotate
      [tracking]: https://github.com/rust-lang/rust/issues/41891
      e2e8cd3d
    • C
      Rollup merge of #46762 - est31:master, r=alexcrichton · 2b61564f
      Corey Farwell 提交于
      Stabilize the panic_col feature
      
      I've added the panic_col feature in PR #42938.
      Now it's time to stabilize it!
      Closes #42939.
      2b61564f
    • E
      We have Rust 1.25 now · 24918148
      est31 提交于
      24918148
    • E
      Stabilize the panic_col feature · a8556d77
      est31 提交于
      I've added the panic_col feature in PR #42938.
      Now it's time to stabilize it!
      Closes #42939.
      a8556d77
    • B
      Auto merge of #47248 - EdSchouten:cloudabi-liblibc, r=kennytm · 107e65ec
      bors 提交于
      Upgrade liblibc to upstream version 0.2.35.
      
      This version of liblibc is a prerequisite for getting libstd to build on
      CloudABI.
      107e65ec
    • G
      Fix error index display · 265b234d
      Guillaume Gomez 提交于
      265b234d
    • B
      Auto merge of #47269 - michaelwoerister:mangled-cgu-names, r=alexcrichton · 61452e50
      bors 提交于
      Shorten names of some compiler generated artifacts.
      
      This PR makes the compiler mangle codegen unit names by default. The name of every codegen unit name will now be a random string of 16 characters. It also makes the file extensions of some intermediate compiler products shorter. Hopefully, these changes will reduce the pressure on tools with path length restrictions like buildbot. The change should also solve problems with case-insensitive file system.
      
      cc #47186 and #47222
      
      r? @alexcrichton
      61452e50
  3. 09 1月, 2018 15 次提交
  4. 08 1月, 2018 11 次提交
    • E
      Upgrade liblibc to latest upstream version. · 80cfcdf1
      Ed Schouten 提交于
      This version of liblibc is a prerequisite for getting libstd to build on
      CloudABI.
      80cfcdf1
    • B
      Auto merge of #47208 - Manishearth:double-ended-searcher, r=pnkfelix · b5392f54
      bors 提交于
      Make double ended searchers use dependent fingers
      
      (fixes #47175)
      
      r? @burntsushi @alexcrichton
      
      needs uplift to beta
      b5392f54
    • G
      Add missing links · 93969734
      Guillaume Gomez 提交于
      93969734
    • J
      1a7b00d5
    • M
      94f3037f
    • B
      Auto merge of #47232 - keatinge:master, r=petrochenkov · 1b193de9
      bors 提交于
      Add help message for incorrect pattern syntax
      
      When I was getting started with rust I often made the mistake of using `||` instead of `|` to match multiple patterns and spent a long time staring at my code wondering what was wrong.
      
      for example:
      
      ```
      fn main() {
          let x = 1;
      
          match x {
              1 || 2 => println!("1 or 2"),
              _ => println!("Something else"),
          }
      }
      
      ```
      
      If you compile this with current rustc you will see
      
      ```
      error: expected one of `...`, `..=`, `..`, `=>`, `if`, or `|`, found `||`
       --> test.rs:5:11
        |
      5 |         1 || 2 => println!("1 or 2"),
        |          -^^ unexpected token
        |          |
        |          expected one of `...`, `..=`, `..`, `=>`, `if`, or `|` here
      
      error: aborting due to previous error
      ```
      
      With my proposed change it will show:
      ```
      error: unexpected token `||` after pattern
       --> test.rs:5:11
        |
      5 |         1 || 2 => println!("1 or 2"),
        |           ^^
        |
        = help: did you mean to use `|` to specify multiple patterns instead?
      
      error: aborting due to previous error
      ```
      1b193de9
    • E
      0528693f
    • B
      Auto merge of #47200 - BurntPizza:query-snatp, r=nikomatsakis · 795594cd
      bors 提交于
      Make normalize_and_test_predicates into a query
      
      From #44891.
      
      I'm not real solid on how `dep_graph` stuff works, but if a node is going to have a key (again, not sure how important that is), then the key needs to be `Copy`. So since `normalize_and_test_predicates` only had one out-of-module use, I changed that call site to use a new function, `substitute_normalize_and_test_predicates` which is the query and enables having the arguments be `Copy`. Hopefully this makes sense.
      
      r? @nikomatsakis
      and/or @michaelwoerister
      795594cd
    • O
      8302044a
    • R
      rustc::ty: Rename `struct_variant` to `non_enum_variant` · cf3fefe9
      Robin Kruppe 提交于
      It is also intended for use with unions.
      cf3fefe9
    • B
      Auto merge of #47171 - estebank:numeric-literal-suggestion, r=nikomatsakis · a29461f3
      bors 提交于
      Provide suggestion when trying to use method on numeric literal
      
      New output:
      
      ```
      error[E0688]: can't call method `powi` on ambiguous numeric type `{float}`
        --> $DIR/method-on-ambiguous-numeric-type.rs:12:17
         |
      12 |     let x = 2.0.powi(2);
         |                 ^^^^
      help: you must specify a concrete type for this numeric value, like `f32`
         |
      12 |     let x = 2.0_f32.powi(2);
         |             ^^^^^^^
      ```
      
      Previous output:
      
      ```
      error[E0599]: no method named `powi` found for type `{float}` in the current scope
        --> src/main.rs:12:17
         |
      12 |     let x = 2.0.powi(2);
         |                 ^^^^
         |
         = help: items from traits can only be used if the trait is in scope
      help: the following trait is implemented but not in scope, perhaps add a `use` for it:
         |
      11 | use core::num::Float;
         |
      ```
      
      Fix #40985.
      a29461f3