1. 10 4月, 2015 17 次提交
    • A
      std: Unconditionally close all file descriptors · eadc3bcd
      Alex Crichton 提交于
      The logic for only closing file descriptors >= 3 was inherited from quite some
      time ago and ends up meaning that some internal APIs are less consistent than
      they should be. By unconditionally closing everything entering a `FileDesc` we
      ensure that we're consistent in our behavior as well as robustly handling the
      stdio case.
      eadc3bcd
    • A
      std: Clean up process spawn impl on unix · 33a2191d
      Alex Crichton 提交于
      * De-indent quite a bit by removing usage of FnOnce closures
      * Clearly separate code for the parent/child after the fork
      * Use `fs2::{File, OpenOptions}` instead of calling `open` manually
      * Use RAII to close I/O objects wherever possible
      * Remove loop for closing all file descriptors, all our own ones are now
        `CLOEXEC` by default so they cannot be inherited
      33a2191d
    • A
      std: Set CLOEXEC for all fds opened on unix · d6c72306
      Alex Crichton 提交于
      This commit starts to set the CLOEXEC flag for all files and sockets opened by
      the standard library by default on all unix platforms. There are a few points of
      note in this commit:
      
      * The implementation is not 100% satisfactory in the face of threads. File
        descriptors only have the `F_CLOEXEC` flag set *after* they are opened,
        allowing for a fork/exec to happen in the middle and leak the descriptor.
        Some platforms do support atomically opening a descriptor while setting the
        `CLOEXEC` flag, and it is left as a future extension to bind these apis as it
        is unclear how to do so nicely at this time.
      
      * The implementation does not offer a method of opting into the old behavior of
        not setting `CLOEXEC`. This will possibly be added in the future through
        extensions on `OpenOptions`, for example.
      
      * This change does not yet audit any Windows APIs to see if the handles are
        inherited by default by accident.
      
      This is a breaking change for users who call `fork` or `exec` outside of the
      standard library itself and expect file descriptors to be inherted. All file
      descriptors created by the standard library will no longer be inherited.
      
      [breaking-change]
      d6c72306
    • B
      Auto merge of #24232 - Manishearth:rollup, r=Manishearth · 88fc5438
      bors 提交于
      None
      88fc5438
    • M
      fixup windows std_misc · ea731797
      Manish Goregaokar 提交于
      ea731797
    • M
    • M
      ede25fe5
    • M
      Rollup merge of #24170 - omo:omo-typo-fix, r=steveklabnik · ce825ab3
      Manish Goregaokar 提交于
       Can anyone take a look? Very trivial.
      ce825ab3
    • M
      27ecaa23
    • M
      Rollup merge of #24218 - lstat:remove-ignore-tidy, r=alexcrichton · b3892079
      Manish Goregaokar 提交于
       This is a really minor issue. I noticed some tests no longer need the ignore
      tidy comment directive.
      
      A quick grep turned up the following files:
      
          src/test/compile-fail/bad-mid-path-type-params.rs
          src/test/compile-fail/bad-sized.rs
          src/test/compile-fail/coherence-default-trait-impl.rs
          src/test/compile-fail/coherence-orphan.rs
          src/test/compile-fail/issue-8767.rs
          src/test/compile-fail/lint-stability.rs
          src/test/compile-fail/lint-uppercase-variables.rs
          src/test/compile-fail/typeck-default-trait-impl-outside-crate.rs
          src/test/compile-fail/use-after-move-implicity-coerced-object.rs
          src/test/debuginfo/gdb-pretty-std.rs
      
      It didn't seem like it was worth opening an issue for this, but if that is not
      the case (i.e. it is required), I'll open one up. Thanks!
      b3892079
    • M
      Rollup merge of #24216 - alexcrichton:stabilize-from-raw-os-error, r=aturon · 1a6e100f
      Manish Goregaokar 提交于
       This commit stabilizes the old `io::Error::from_os_error` after being renamed to
      use the `raw_os_error` terminology instead. This function is often useful when
      writing bindings to OS functions but only actually converting to an I/O error at
      a later point.
      1a6e100f
    • M
      Rollup merge of #24215 - alexcrichton:stabilize-clone-from, r=aturon · cdfbb11f
      Manish Goregaokar 提交于
       This method hasn't really changed since is inception, and it can often be a
      nice performance win for some situations. This method also imposes no burden on
      implementors or users of `Clone` as it's just a default method on the side.
      cdfbb11f
    • M
      Rollup merge of #24212 - alexcrichton:destabilize-begin-unwind, r=huonw · 5daee19e
      Manish Goregaokar 提交于
       Now that we have a `#[allow_internal_unstable]` attribute for macros there's no
      need for these two `begin_unwind` functions to be stable. Right now the `panic!`
      interface is the only one we wish to stabilize, so remove the stability markers
      from these functions.
      
      While this is a breaking change, it is highly unlikely to break any actual code.
      It is recommended to use the `panic!` macro instead if it breaks explicit calls
      into `std::rt`.
      
      [breaking-change]
      cc #24208
      5daee19e
    • M
      Rollup merge of #24207 - kmcallister:llvm-plugin, r=brson · 4e466e73
      Manish Goregaokar 提交于
       r? @brson
      
      I'm using this to integrate rustc with [american-fuzzy-lop](http://lcamtuf.coredump.cx/afl/). Building with afl instrumentation is no different from loading any other plugin library.
      
      I'd like this PR to include a `run-make` test with a custom LLVM pass; however I'm not sure it's worth the trouble of building C++ code and linking LLVM from the test suite (are there existing tests that do this?)
      4e466e73
    • M
      Rollup merge of #24205 - brson:debug, r=alexcrichton · 2dffe789
      Manish Goregaokar 提交于
       This makes the default configuration fully optimized, with no debugging options, no llvm asserts, renames --enable-debug to --enable-debug-assertions, and adds --enable-debug as a blanket option that toggles various things, per #17665. It does not add a `--enable-release` flag since that would be a no-op.
      
      cc @nrc
      
      Fixes https://github.com/rust-lang/rust/issues/22390
      Fixes https://github.com/rust-lang/rust/issues/17081
      Partially addresses https://github.com/rust-lang/rust/issues/17665
      2dffe789
    • M
      Rollup merge of #24193 - lstat:needstest, r=alexcrichton · 67fa4d3a
      Manish Goregaokar 提交于
       Closes #22289
      Closes #22370
      Closes #22384
      67fa4d3a
    • M
      Rollup merge of #24191 - nikomatsakis:issue-20791, r=pnkfelix · 3b871402
      Manish Goregaokar 提交于
       Modify the ExprUseVisitor to walk each part of an AutoRef, and in
      particular to treat an AutoUnsize as as kind of \"instantaneous\" borrow
      of the value being unsized. This prevents us from feeding uninitialized
      data.
      
      This caused a problem for the eager reborrow of comparison traits,
      because that wound up introducing a \"double AutoRef\", which was not
      being thoroughly checked before but turned out not to type check.
      Fortunately, we can just remove that \"eager reborrow\" as it is no longer
      needed now that `PartialEq` doesn't force both LHS and RHS to have the
      same type (and even if we did have this problem, the better way would be
      to lean on introducing a common supertype).
      
      Fixes #20791.
      
      r? @nrc
      3b871402
  2. 09 4月, 2015 23 次提交