1. 06 8月, 2017 4 次提交
  2. 05 8月, 2017 10 次提交
    • B
      Auto merge of #43652 - frewsxcv:frewsxcv-str-examples, r=QuietMisdreavus · 5a5a32a4
      bors 提交于
      String slice doc improvements.
      
      None
      5a5a32a4
    • B
      Auto merge of #43554 - eddyb:apfloat, r=nikomatsakis · 2b82b7e5
      bors 提交于
      APFloat: Rewrite It In Rust and use it for deterministic floating-point CTFE.
      
      As part of the CTFE initiative, we're forced to find a solution for floating-point operations.
      By design, IEEE-754 does not explicitly define everything in a deterministic manner, and there is some variability between platforms, at the very least (e.g. NaN payloads).
      
      If types are to evaluate constant expressions involving type (or in the future, const) generics, that evaluation needs to be *fully deterministic*, even across `rustc` host platforms.
      That is, if `[T; T::X]` was used in a cross-compiled library, and the evaluation of `T::X` executed a floating-point operation, that operation has to be reproducible on *any other host*, only knowing `T` and the definition of the `X` associated const (as either AST or HIR).
      
      Failure to uphold those rules allows an associated type (e.g. `<Foo as Iterator>::Item`) to be seen as two (or more) different types, depending on the current host, and such type safety violations typically allow writing of a `transmute` in safe code, given enough generics.
      
      The options considered by @rust-lang/compiler were:
      1. Ban floating-point operations in generic const-evaluation contexts
      2. Emulate floating-point operations in an uniformly deterministic fashion
      
      The former option may seem appealing at first, but floating-point operations *are allowed today*, so they can't be banned wholesale, a distinction has to be made between the code that already works, and future generic contexts. *Moreover*, every computation that succeeded *has to be cached*, otherwise the generic case can be reproduced without any generics. IMO there are too many ways it can go wrong, and a single violation can be enough for an unsoundness hole.
      Not to mention we may end up really wanting floating-point operations *anyway*, in CTFE.
      
      I went with the latter option, and seeing how LLVM *already* has a library for this exact purpose (as it needs to perform optimizations independently of host floating-point capabilities), i.e. `APFloat`, that was what I ended up basing this PR on.
      But having been burned by the low reusability of bindings that link to LLVM, and because I would *rather* the floating-point operations to be wrong than not deterministic or not memory-safe (`APFloat` does far more pointer juggling than I'm comfortable with), I decided to RIIR.
      
      This way, we have a guarantee of *no* `unsafe` code, a bit more control over the where native floating-point might accidentally be involved, and non-LLVM backends can share it.
      I've also ported all the testcases over, *before* any functionality, to catch any mistakes.
      
      Currently the PR replaces all CTFE operations to go through `apfloat::ieee::{Single,Double}`, keeping only the bits of the `f32` / `f64` memory representation in between operations.
      Converting from a string also double-checks that `core::num` and `apfloat` agree on the interpretation of a floating-point number literal, in case either of them has any bugs left around.
      
      r? @nikomatsakis
      f? @nagisa @est31
      
      <hr/>
      
      Huge thanks to @edef1c for first demoing usable `APFloat` bindings and to @chandlerc for fielding my questions on IRC about `APFloat` peculiarities (also upstreaming some bugfixes).
      2b82b7e5
    • C
      6722185a
    • C
      de4f1a17
    • B
      Auto merge of #43640 - oli-obk:patch-5, r=nikomatsakis · 5c7add75
      bors 提交于
      Uplift some comments to Doc comments
      5c7add75
    • B
      Auto merge of #43642 - mmatyas:unskip_aarch64_tests, r=sanxiyn · e8909d25
      bors 提交于
      Unskip some tests on AArch64
      
      I've been running the test suite remotely on an Acer Chromebook R13 and natively on an ARM Juno developer board, both AArch64 devices. Most of the tests that are skipped on AArch64 are due to testing stdcall/fastcall/x86-specific code or the debugger, but I've found a few tests that could be enabled there.
      
      These have been skipped previously due to failing on the `aarch64-linux-android` and `mac-android` buildbots, more than 2 years ago (#23471, #23695). It seems we don't test those platforms any more, but as they do work on AArch64 Linux, I'd like to propose re-enabling them. All of them pass on my devices.
      e8909d25
    • B
      Auto merge of #43639 - TobiasSchaffner:master, r=alexcrichton · 49ded7ec
      bors 提交于
      Add L4Re Support in librustc_back
      
      Add experimental support for x86_64-unknown-l4re-uclibc target, which covers the L4 Runtime Environment.
      
      This pull request contains the changes that have to be made to librustc_back. It follows the changes humenda made in pull request https://github.com/rust-lang/libc/pull/591 to libc.
      
      Next steps will be the modifications to the needed libraries. (libstd,  liballoc_system, libpanic_abort, libunwind)
      
      Thanks to humenda for reviewing.
      49ded7ec
    • B
      Auto merge of #43615 - dhduvall:lto-unaligned-read, r=nagisa · 9b6c2382
      bors 提交于
      Fix some unaligned reads on SPARC in LTO
      
      This fixes #43593 by eliminating some undefined behavior.
      9b6c2382
    • B
      Auto merge of #43590 - michaelwoerister:no-reopening-1, r=nikomatsakis · d692a91f
      bors 提交于
      incr.comp.: Assert that no DepNode is re-opened (see issue #42298).
      
      This PR removes the last occurrence of DepNode re-opening and adds an assertion that prevents our doing so in the future too. The DepGraph should no be guaranteed to be cycle free.
      
      r? @nikomatsakis
      
      EDIT: Closes https://github.com/rust-lang/rust/issues/42298
      d692a91f
    • B
      Auto merge of #43577 - cuviper:link-llvm-dylib, r=sanxiyn · ff1135b2
      bors 提交于
      Link LLVM tools dynamically
      
      Set `LLVM_LINK_LLVM_DYLIB=ON` -- "If enabled, tools will be linked with
      the libLLVM shared library."  Rust doesn't ship any of the LLVM tools,
      and only needs a few at all for some test cases, so statically linking
      the tools is just a waste of space.  I've also had memory issues on
      slower machines with LLVM debuginfo enabled, when several tools start
      linking in parallel consuming several GBs each.
      
      With the default configuration, `build/x86_64-unknown-linux-gnu/llvm`
      was 1.5GB before, now down to 731MB.  The difference is more drastic
      with `--enable-llvm-release-debuginfo`, from 28GB to "only" 13GB.
      
      This does not change the linking behavior of `rustc_llvm`.
      ff1135b2
  3. 04 8月, 2017 20 次提交
  4. 03 8月, 2017 6 次提交