1. 29 9月, 2017 2 次提交
    • D
      rustc: Fix main() entry point signature on 64bit · c2fe69b9
      Daniel Klauer 提交于
      To match the C signature, main() should be generated with C int type
      for the argc parameter and result, i.e. i32 instead of i64 on 64bit.
      
      That way it no longer relies on the upper 32 bits being zero, which I'm
      not sure is guaranteed by ABIs or startup code.
      c2fe69b9
    • D
      rustc: Add Type::c_int() · 6c9a4ba8
      Daniel Klauer 提交于
      Add c_int for use in the compiler,
      assuming i32 for all targets as in libc.
      6c9a4ba8
  2. 28 9月, 2017 5 次提交
    • B
      Auto merge of #44806 - KiChjang:mir-err-notes-2, r=pnkfelix · d8873690
      bors 提交于
      Add span label to E0384 for MIR borrowck
      
      Corresponds to `report_illegal_reassignment`.
      
      Part of #44596.
      d8873690
    • B
      Auto merge of #44790 - clarcharr:zip_bytes, r=sfackler · f22b9da1
      bors 提交于
      TrustedRandomAccess specialisation for Iterator::cloned when Item: Copy.
      
      This should fix #44424. It also provides a potential fix for more iterators using `Iterator::cloned`.
      f22b9da1
    • B
      Auto merge of #44779 - tjkirch:master, r=alexcrichton · 9cb90f4e
      bors 提交于
      Add aarch64-unknown-linux-musl target
      
      This adds support for the aarch64-unknown-linux-musl target in the build and CI systems.
      
      This addresses half of issue #42520.
      
      The new file `aarch64_unknown_linux_musl.rs` is a copy of `aarch64_unknown_linux_gnu.rs` with "gnu" replaced by "musl", and the added logic in `build-arm-musl.sh` is similarly a near-copy of the arches around it, so overall the changes were straightforward.
      
      Testing:
      
      ```
      $ sudo ./src/ci/docker/run.sh cross
      ...
      Dist std stage2 (x86_64-unknown-linux-gnu -> aarch64-unknown-linux-musl)
      Building stage2 test artifacts (x86_64-unknown-linux-gnu -> aarch64-unknown-linux-musl)
         Compiling getopts v0.2.14
         Compiling term v0.0.0 (file:///checkout/src/libterm)
         Compiling test v0.0.0 (file:///checkout/src/libtest)
          Finished release [optimized] target(s) in 16.91 secs
      Copying stage2 test from stage2 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / aarch64-unknown-linux-musl)
      ...
      Build completed successfully in 0:55:22
      ```
      
      ```
      $ rustup toolchain link local obj/build/x86_64-unknown-linux-gnu/stage2
      $ rustup default local
      ```
      
      After setting the local toolchain as default, and adding this in ~/.cargo/config:
      
      ```
      [target.aarch64-unknown-linux-musl]
      linker = "aarch64-linux-musl-gcc"
      ```
      
      ...then the toolchain was able to build a working ripgrep as a test:
      
      ```
      $ readelf -a target/aarch64-unknown-linux-musl/debug/rg | grep -i interpreter
      $ readelf -a target/aarch64-unknown-linux-musl/debug/rg | grep NEEDED
      $ file target/aarch64-unknown-linux-musl/debug/rg
      target/aarch64-unknown-linux-musl/debug/rg: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=be11036b0988fac5dccc9f6487eb780b05186582, not stripped
      ```
      9cb90f4e
    • B
      Auto merge of #44782 - estebank:issue-36700, r=GuillaumeGomez · 44d5090a
      bors 提交于
      Point at parameter type on E0301
      
      On "the parameter type `T` may not live long enough" error, point to the
      parameter type suggesting lifetime bindings:
      
      ```
      error[E0310]: the parameter type `T` may not live long enough
        --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
         |
      27 | struct Foo<T> {
         |            - help: consider adding an explicit lifetime bound `T: 'static`...
      28 |     foo: &'static T
         |     ^^^^^^^^^^^^^^^
         |
      note: ...so that the reference type `&'static T` does not outlive the data it points at
        --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
         |
      28 |     foo: &'static T
         |     ^^^^^^^^^^^^^^^
      ```
      
      Fix #36700.
      44d5090a
    • B
      Auto merge of #44709 - Badel2:inclusive-range-dotdoteq, r=petrochenkov · 0e6f4cf5
      bors 提交于
      Initial support for `..=` syntax
      
      #28237
      
      This PR adds `..=` as a synonym for `...` in patterns and expressions.
      Since `...` in expressions was never stable, we now issue a warning.
      
      cc @durka
      r? @aturon
      0e6f4cf5
  3. 27 9月, 2017 10 次提交
  4. 26 9月, 2017 6 次提交
    • B
      Auto merge of #44736 - pnkfelix:mir-borrowck4, r=arielb1 · 1c4510ad
      bors 提交于
      Some fixes to mir-borrowck
      
      Make the code more closely match the NLL RFC (updated description).
      
      (The biggest visible fix the addition of the Shallow/Deep distinction, which means mir-borrowck stops falsely thinking that StorageDeads need deep access to their input L-value.)
      1c4510ad
    • B
      Auto merge of #44735 - tirr-c:issue-42143, r=arielb1 · 4b8bf391
      bors 提交于
      Friendlier error message for closure argument type mismatch
      
      Rebased #42270.
      Fixes #42143.
      
      ---
      
      `test.rs`:
      
      ```rust
      fn main() {
          foo(|_: i32, _: usize| ());
      }
      
      fn foo<F>(_: F) where F: Fn(&str, usize) {}
      ```
      
      Before:
      
      ```
      error[E0281]: type mismatch: `[closure@test.rs:2:9: 2:30]` implements the trait `std::ops::Fn<(i32, usize)>`, but the trait `for<'r> std::ops::Fn<(&'r str, usize)>` is required
       --> test.rs:2:5
        |
      2 |     foo(|_: i32, _: usize| ());
        |     ^^^ --------------------- implements `std::ops::Fn<(i32, usize)>`
        |     |
        |     expected &str, found i32
        |     requires `for<'r> std::ops::Fn<(&'r str, usize)>`
        |
        = note: required by `foo`
      ```
      
      After (early):
      
      ```
      error[E0631]: type mismatch in closure arguments
       --> test.rs:2:5
        |
      2 |     foo(|_: i32, _: usize| ());
        |     ^^^ --------------------- takes arguments of type `i32` and `usize`
        |     |
        |     expected arguments of type `&str` and `usize`
        |
        = note: required by `foo`
      ```
      
      After (current):
      
      ```
      error[E0631]: type mismatch in closure arguments
       --> test.rs:2:5
        |
      2 |     foo(|_: i32, _: usize| ());
        |     ^^^ --------------------- found signature of `fn(i32, usize) -> _`
        |     |
        |     expected signature of `for<'r> fn(&'r str, usize) -> _`
        |
        = note: required by `foo`
      ```
      
      ~~Compiler output has been changed, and a few tests are failing. Help me writing/fixing tests!~~
      
      r? @nikomatsakis
      4b8bf391
    • J
      375332c6
    • B
      Auto merge of #44297 - laumann:suggest-misspelt-methods, r=arielb1 · 82ae9682
      bors 提交于
      Add suggestions for misspelled method names
      
      Use the syntax::util::lev_distance module to provide suggestions when a
      named method cannot be found.
      
      Part of #30197
      82ae9682
    • B
      Auto merge of #44279 - smaeul:crt_static-deps, r=alexcrichton · 6c476ce4
      bors 提交于
      Require rlibs for dependent crates when linking static executables
      
      This handles the case for `CrateTypeExecutable` and `+crt_static`. I reworked the match block to avoid duplicating the `attempt_static` and error checking code again (this case would have been a copy of the `CrateTypeCdylib`/`CrateTypeStaticlib` case).
      
      On `linux-musl` targets where `std` was built with `crt_static = false` in `config.toml`, this change brings the test suite from entirely failing to mostly passing.
      
      This change should not affect behavior for other crate types, or for targets which do not respect `+crt_static`.
      6c476ce4
    • B
      Auto merge of #44085 - bjorn3:no_llvm_write_metadata, r=arielb1 · 3df1f7b8
      bors 提交于
      Allow writing metadata without llvm
      
      # Todo:
      
      * [x] Rebase
      * [x] Fix eventual errors
      * [x] <strike>Find some crate to write elf files</strike> (will do it later)
      
      Cc #43842
      3df1f7b8
  5. 25 9月, 2017 17 次提交