1. 01 5月, 2015 1 次提交
    • 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
  2. 30 4月, 2015 7 次提交
  3. 29 4月, 2015 7 次提交
  4. 28 4月, 2015 6 次提交
    • S
      remove stability note from std::net · 97199bcb
      Steve Klabnik 提交于
      This is served by stability markers.
      97199bcb
    • 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: Clean up some annotations in thread::local · 0e154aaa
      Alex Crichton 提交于
      Don't need so much manual #[doc(hidden)] and #[unstable] as much of it is
      inherited!
      0e154aaa
    • 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
  5. 27 4月, 2015 1 次提交
  6. 26 4月, 2015 2 次提交
    • 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
    • M
      add import (fixup #24649) · 3e67b6bb
      Manish Goregaokar 提交于
      3e67b6bb
  7. 25 4月, 2015 1 次提交
  8. 24 4月, 2015 1 次提交
  9. 23 4月, 2015 6 次提交
  10. 22 4月, 2015 7 次提交
    • C
      Remove doc-comment default::Default imports · 68989918
      Corey Farwell 提交于
      In 8f5b5f94, `default::Default` was
      added to the prelude, so these imports are no longer necessary.
      68989918
    • 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
    • A
      std: Remove deprecated AsPath trait · e091ba3f
      Alex Crichton 提交于
      e091ba3f
    • A
      std: Remove deprecated AsOsStr/Str/AsSlice traits · 69ded69d
      Alex Crichton 提交于
      Cleaning out more deprecated items
      69ded69d
    • 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
  11. 21 4月, 2015 1 次提交