1. 08 5月, 2015 4 次提交
  2. 07 5月, 2015 1 次提交
  3. 06 5月, 2015 1 次提交
  4. 05 5月, 2015 1 次提交
  5. 04 5月, 2015 3 次提交
  6. 01 5月, 2015 4 次提交
    • C
      Replaces instanced of 'an UTF' with 'a UTF' · 554da457
      Corey Farwell 提交于
      Even spelled out, one would say 'a Universal Character Set'
      554da457
    • A
      Add downcasting to std::error::Error · a5762625
      Aaron Turon 提交于
      This commit brings the `Error` trait in line with the [Error interoperation
      RFC](https://github.com/rust-lang/rfcs/pull/201) by adding downcasting,
      which has long been intended. This change means that for any `Error`
      trait objects that are `'static`, you can downcast to concrete error
      types.
      
      To make this work, it is necessary for `Error` to inherit from
      `Reflect` (which is currently used to mark concrete types as "permitted
      for reflection, aka downcasting"). This is a breaking change: it means
      that impls like
      
      ```rust
      impl<T> Error for MyErrorType<T> { ... }
      ```
      
      must change to something like
      
      ```rust
      impl<T: Reflect> Error for MyErrorType<T> { ... }
      ```
      
      except that `Reflect` is currently unstable (and should remain so for
      the time being). For now, code can instead bound by `Any`:
      
      ```rust
      impl<T: Any> Error for MyErrorType<T> { ... }
      ```
      
      which *is* stable and has `Reflect` as a super trait. The downside is
      that this imposes a `'static` constraint, but that only
      constrains *when* `Error` is implemented -- it does not actually
      constrain the types that can implement `Error`.
      
      [breaking-change]
      a5762625
    • A
      std: Always check for EDEADLK in rwlocks on unix · 5c8ca26a
      Alex Crichton 提交于
      Apparently implementations are allowed to return EDEADLK instead of blocking
      forever, in which case this can lead to unsafety in the `RwLock` primitive
      exposed by the standard library. A debug-build of the standard library would
      have caught this error (due to the debug assert), but we don't ship debug
      builds right now.
      
      This commit adds explicit checks for the EDEADLK error code and triggers a panic
      to ensure the call does not succeed.
      
      Closes #25012
      5c8ca26a
    • A
      std: Favor cfg! over #[cfg] in unix rwlocks · 4288a08e
      Alex Crichton 提交于
      4288a08e
  7. 30 4月, 2015 1 次提交
  8. 29 4月, 2015 3 次提交
    • A
      std: Fix inheriting standard handles on windows · c1149edf
      Alex Crichton 提交于
      Currently if a standard I/O handle is set to inherited on Windows, no action is
      taken and the slot in the process information description is set to
      `INVALID_HANDLE_VALUE`. Due to our passing of `STARTF_USESTDHANDLES`, however,
      this means that the handle is actually set to nothing and if a child tries to
      print it will generate an error.
      
      This commit fixes this behavior by explicitly creating stdio handles to be
      placed in these slots by duplicating the current process's I/O handles. This is
      presumably what previously happened silently by using a file-descriptor-based
      implementation instead of a `HANDLE`-centric implementation.
      
      Along the way this cleans up a lot of code in `Process::spawn` for Windows by
      ensuring destructors are always run, using more RAII, and limiting the scope of
      `unsafe` wherever possible.
      c1149edf
    • A
      std: Implement fs::DirBuilder · 0368abb0
      Alex Crichton 提交于
      This is the last remaining portion of #24796
      0368abb0
    • T
      Register new snapshots · 69abc12b
      Tamir Duberstein 提交于
      69abc12b
  9. 28 4月, 2015 4 次提交
    • A
      std: Expand the area of std::fs · 93487000
      Alex Crichton 提交于
      This commit is an implementation of [RFC 1044][rfc] which adds additional
      surface area to the `std::fs` module. All new APIs are `#[unstable]` behind
      assorted feature names for each one.
      
      [rfc]: https://github.com/rust-lang/rfcs/pull/1044
      
      The new APIs added are:
      
      * `fs::canonicalize` - bindings to `realpath` on unix and
        `GetFinalPathNameByHandle` on windows.
      * `fs::symlink_metadata` - similar to `lstat` on unix
      * `fs::FileType` and accessor methods as `is_{file,dir,symlink}`
      * `fs::Metadata::file_type` - accessor for the raw file type
      * `fs::DirEntry::metadata` - acquisition of metadata which is free on Windows
        but requires a syscall on unix.
      * `fs::DirEntry::file_type` - access the file type which may not require a
        syscall on most platforms.
      * `fs::DirEntry::file_name` - access just the file name without leading
        components.
      * `fs::PathExt::symlink_metadata` - convenience method for the top-level
        function.
      * `fs::PathExt::canonicalize` - convenience method for the top-level
        function.
      * `fs::PathExt::read_link` - convenience method for the top-level
        function.
      * `fs::PathExt::read_dir` - convenience method for the top-level
        function.
      * `std::os::raw` - type definitions for raw OS/C types available on all
        platforms.
      * `std::os::$platform` - new modules have been added for all currently supported
        platforms (e.g. those more specific than just `unix`).
      * `std::os::$platform::raw` - platform-specific type definitions. These modules
        are populated with the bare essentials necessary for lowing I/O types into
        their raw representations, and currently largely consist of the `stat`
        definition for unix platforms.
      
      This commit also deprecates `Metadata::{modified, accessed}` in favor of
      inspecting the raw representations via the lowering methods of `Metadata`.
      93487000
    • A
      std: Don't assume thread::current() works on panic · d98ab4fa
      Alex Crichton 提交于
      Inspecting the current thread's info may not always work due to the TLS value
      having been destroyed (or is actively being destroyed). The code for printing
      a panic message assumed, however, that it could acquire the thread's name
      through this method.
      
      Instead this commit propagates the `Option` outwards to allow the
      `std::panicking` module to handle the case where the current thread isn't
      present.
      
      While it solves the immediate issue of #24313, there is still another underlying
      issue of panicking destructors in thread locals will abort the process.
      
      Closes #24313
      d98ab4fa
    • A
      std: Don't assume dlopen() works on yourself · 7dd62155
      Alex Crichton 提交于
      Statically linked executables do not succeed (aka MUSL-based executables).
      7dd62155
    • A
      std: Prepare for linking to musl · 6c048723
      Alex Crichton 提交于
      This commit modifies the standard library and its dependencies to link correctly
      when built against MUSL. This primarily ensures that the right libraries are
      linked against and when they're linked against they're linked against
      statically.
      6c048723
  10. 26 4月, 2015 1 次提交
    • B
      std: Fix process spawn for arguments ending in backslashes on Windows · e90408e9
      Brad King 提交于
      Fix `make_command_line` for the case of backslashes at the end of an
      argument requiring quotes.  We must encode the command and arguments
      such that `CommandLineToArgvW` recovers them in the spawned process.
      Simplify the logic by using a running count of backslashes as they
      are encountered instead of looking ahead for quotes following them.
      
      Extend `test_make_command_line` to additionally cover:
      
      * a leading quote in an argument that requires quotes,
      * a backslash before a quote in an argument that requires quotes,
      * a backslash at the end of an argument that requires quotes, and
      * a backslash at the end of an argument that does not require quotes.
      e90408e9
  11. 25 4月, 2015 1 次提交
  12. 23 4月, 2015 3 次提交
    • A
      std: Add missing stability for symlink functions · a318b513
      Alex Crichton 提交于
      These functions were intended to be introduced as `#[stable]` as a stable API
      was deprecated in favor of them, but they just erroneously forgot the stability
      attributes.
      a318b513
    • Y
      implement set_tcp_keepalive for linux · 4d6e2f53
      Young Wu 提交于
      4d6e2f53
    • A
      std: Audit std::thread implementations · 2e110099
      Alex Crichton 提交于
      Much of this code hasn't been updated in quite some time and this commit does a
      small audit of the functionality:
      
      * Implementation functions now centralize all functionality on a locally defined
        `Thread` type.
      * The `detach` method has been removed in favor of a `Drop` implementation. This
        notably fixes leaking thread handles on Windows.
      * The `Thread` structure is now appropriately annotated with `Send` and `Sync`
        automatically on Windows and in a custom fashion on Unix.
      * The unsafety of creating a thread has been pushed out to the right boundaries
        now.
      
      Closes #24442
      2e110099
  13. 22 4月, 2015 4 次提交
    • A
      Test fixes and rebase conflicts, round 1 · 224fc108
      Alex Crichton 提交于
      224fc108
    • A
      std: Bring back f32::from_str_radix as an unstable API · a568a7f9
      Alex Crichton 提交于
      This API was exercised in a few tests and mirrors the `from_str_radix`
      functionality of the integer types.
      a568a7f9
    • A
      std: Remove deprecated/unstable num functionality · eeb94886
      Alex Crichton 提交于
      This commit removes all the old casting/generic traits from `std::num` that are
      no longer in use by the standard library. This additionally removes the old
      `strconv` module which has not seen much use in quite a long time. All generic
      functionality has been supplanted with traits in the `num` crate and the
      `strconv` module is supplanted with the [rust-strconv crate][rust-strconv].
      
      [rust-strconv]: https://github.com/lifthrasiir/rust-strconv
      
      This is a breaking change due to the removal of these deprecated crates, and the
      alternative crates are listed above.
      
      [breaking-change]
      eeb94886
    • B
      Deprecate std::fs::soft_link in favor of platform-specific versions · 3cc84efc
      Brian Campbell 提交于
      On Windows, when you create a symbolic link you must specify whether it
      points to a directory or a file, even if it is created dangling, while
      on Unix, the same symbolic link could point to a directory, a file, or
      nothing at all.  Furthermore, on Windows special privilege is necessary
      to use a symbolic link, while on Unix, you can generally create a
      symbolic link in any directory you have write privileges to.
      
      This means that it is unlikely to be able to use symbolic links purely
      portably; anyone who uses them will need to think about the cross
      platform implications.  This means that using platform-specific APIs
      will make it easier to see where code will need to differ between the
      platforms, rather than trying to provide some kind of compatibility
      wrapper.
      
      Furthermore, `soft_link` has no precedence in any other API, so to avoid
      confusion, move back to the more standard `symlink` terminology.
      
      Create a `std::os::unix::symlink` for the Unix version that is
      destination type agnostic, as well as `std::os::windows::{symlink_file,
      symlink_dir}` for Windows.
      
      Because this is a stable API, leave a compatibility wrapper in
      `std::fs::soft_link`, which calls `symlink` on Unix and `symlink_file`
      on Windows, preserving the existing behavior of `soft_link`.
      3cc84efc
  14. 21 4月, 2015 2 次提交
    • T
      Remove unused files · 32e5f494
      Tamir Duberstein 提交于
      Looks like these were missed in bf4e77d4.
      32e5f494
    • C
      Implement Debug for File · 1131bc0a
      Chris Wong 提交于
      This patch adds a `Debug` impl for `std::fs::File`.
      
      On all platforms (Unix and Windows) it shows the file descriptor.
      
      On Linux, it displays the path and access mode as well.
      
      Ideally we should show the path/mode for all platforms, not just Linux,
      but this will do for now.
      
      cc #24570
      1131bc0a
  15. 18 4月, 2015 1 次提交
    • A
      std: Add Default/IntoIterator/ToOwned to the prelude · 8f5b5f94
      Alex Crichton 提交于
      This is an implementation of [RFC 1030][rfc] which adds these traits to the
      prelude and additionally removes all inherent `into_iter` methods on collections
      in favor of the trait implementation (which is now accessible by default).
      
      [rfc]: https://github.com/rust-lang/rfcs/pull/1030
      
      This is technically a breaking change due to the prelude additions and removal
      of inherent methods, but it is expected that essentially no code breaks in
      practice.
      
      [breaking-change]
      Closes #24538
      8f5b5f94
  16. 17 4月, 2015 1 次提交
    • K
      deprecate Unicode functions that will be moved to crates.io · 29d1252e
      kwantam 提交于
      This patch
      1. renames libunicode to librustc_unicode,
      2. deprecates several pieces of libunicode (see below), and
      3. removes references to deprecated functions from
         librustc_driver and libsyntax. This may change pretty-printed
         output from these modules in cases involving wide or combining
         characters used in filenames, identifiers, etc.
      
      The following functions are marked deprecated:
      
      1. char.width() and str.width():
         --> use unicode-width crate
      
      2. str.graphemes() and str.grapheme_indices():
         --> use unicode-segmentation crate
      
      3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(),
         char.compose(), char.decompose_canonical(), char.decompose_compatible(),
         char.canonical_combining_class():
         --> use unicode-normalization crate
      29d1252e
  17. 15 4月, 2015 5 次提交