1. 20 9月, 2016 1 次提交
  2. 19 9月, 2016 6 次提交
  3. 18 9月, 2016 8 次提交
  4. 17 9月, 2016 18 次提交
  5. 16 9月, 2016 7 次提交
    • B
      Auto merge of #36353 - arielb1:union-drops, r=pnkfelix · c6673db5
      bors 提交于
      a few move-checker improvements
      
      This fixes moves out of unions and prohibits moves out of slices (see the individual commits).
      
      r? @pnkfelix
      c6673db5
    • A
      fix test fallout · 5c5f7522
      Ariel Ben-Yehuda 提交于
      5c5f7522
    • A
      fix dynamic drop for unions · eeedc144
      Ariel Ben-Yehuda 提交于
      Moving out of a union is now treated like moving out of its parent type.
      
      Fixes #36246
      eeedc144
    • A
      forbid moves out of slices · 7b25e886
      Ariel Ben-Yehuda 提交于
      The wording of RFC #495 enables moves out of slices. Unfortuantely, non-zeroing
      moves out of slices introduce a very annoying complication: as slices can
      vary in their length, indexes from the start and end may or may not overlap
      depending on the slice's exact length, which prevents assigning a particular
      drop flag for each individual element.
      
      For example, in the code
      
      ```Rust
      fn foo<T>(a: Box<[Box<[T]>]>, c: bool) -> T {
          match (a, c) {
              (box [box [t, ..], ..], true) => t,
              (box [.., box [.., t]], false) => t,
              _ => panic!()
          }
      }
      ```
      
      If the condition is false, we have to drop the first element
      of `a`, unless `a` has size 1 in which case we drop all the elements
      of it but the last.
      
      If someone comes with a nice way of handling it, we can always re-allow
      moves out of slices.
      
      This is a [breaking-change], but it is behind the `slice_patterns` feature
      gate and was not allowed until recently.
      7b25e886
    • A
      groundwork refactoring of `gather_moves` · eb19cd65
      Ariel Ben-Yehuda 提交于
      eb19cd65
    • B
      Auto merge of #36441 - alexcrichton:rustbuild-target, r=brson · 8394685b
      bors 提交于
      rustbuild: Fix cross-compiles to MinGW on Linux
      
      Closes #36290
      Closes #36291
      8394685b
    • B
      Auto merge of #36338 - estebank:primitive-shadow, r=jseyfried · 89500e93
      bors 提交于
      Be more specific when type parameter shadows primitive type
      
      When a type parameter shadows a primitive type, the error message
      was non obvious. For example, given the file `file.rs`:
      
      ```rust
      trait Parser<T> {
          fn parse(text: &str) -> Option<T>;
      }
      
      impl<bool> Parser<bool> for bool {
          fn parse(text: &str) -> Option<bool> {
              Some(true)
          }
      }
      
      fn main() {
          println!("{}", bool::parse("ok").unwrap_or(false));
      }
      ```
      
      The output was:
      
      ```bash
      % rustc file.rs
      error[E0308]: mismatched types
       --> file.rs:7:14
        |
      7 |         Some(true)
        |              ^^^^ expected type parameter, found bool a
        |
        = note: expected type `bool`
        = note:    found type `bool`
      
      error: aborting due to previous error
      ```
      
      We now show extra information about the type:
      
      ```bash
      % rustc file.rs
      error[E0308]: mismatched types
       --> file.rs:7:14
        |
      7 |         Some(true)
        |              ^^^^ expected type parameter, found bool a
        |
        = note: expected type `bool` (type parameter)
        = note:    found type `bool` (bool)
      
      error: aborting due to previous error
      ```
      
      Fixes #35030
      89500e93