1. 02 10月, 2014 1 次提交
    • A
      Remove iotest macro · 15966c3c
      Aaron Turon 提交于
      This commit removes the `iotest!` macro from `std::io`. The macro was
      primarily used to ensure that all io-related tests were run on both
      libnative and libgreen/librustuv. However, now that the librustuv stack
      is being removed, the macro is no longer needed.
      
      See the [runtime removal
      RFC](https://github.com/rust-lang/rfcs/pull/230) for more context.
      
      [breaking-change]
      15966c3c
  2. 01 10月, 2014 2 次提交
  3. 18 9月, 2014 1 次提交
  4. 17 9月, 2014 2 次提交
  5. 29 8月, 2014 1 次提交
  6. 17 8月, 2014 1 次提交
    • P
      librustc: Forbid external crates, imports, and/or items from being · 7f928d15
      Patrick Walton 提交于
      declared with the same name in the same scope.
      
      This breaks several common patterns. First are unused imports:
      
          use foo::bar;
          use baz::bar;
      
      Change this code to the following:
      
          use baz::bar;
      
      Second, this patch breaks globs that import names that are shadowed by
      subsequent imports. For example:
      
          use foo::*; // including `bar`
          use baz::bar;
      
      Change this code to remove the glob:
      
          use foo::{boo, quux};
          use baz::bar;
      
      Or qualify all uses of `bar`:
      
          use foo::{boo, quux};
          use baz;
      
          ... baz::bar ...
      
      Finally, this patch breaks code that, at top level, explicitly imports
      `std` and doesn't disable the prelude.
      
          extern crate std;
      
      Because the prelude imports `std` implicitly, there is no need to
      explicitly import it; just remove such directives.
      
      The old behavior can be opted into via the `import_shadowing` feature
      gate. Use of this feature gate is discouraged.
      
      This implements RFC #116.
      
      Closes #16464.
      
      [breaking-change]
      7f928d15
  7. 14 8月, 2014 2 次提交
  8. 13 8月, 2014 1 次提交
    • I
      libnative: process spawning should not close inherited file descriptors · 3fe0ba9a
      Ivan Petkov 提交于
      * The caller should be responsible for cleaning up file descriptors
      * If a caller safely creates a file descriptor (via
        native::io::file::open) the returned structure (FileDesc) will try to
        clean up the file, failing in the process and writing error messages
        to the screen.
      * This should not happen as the caller has no public interface for
        telling the FileDesc structure to NOT free the underlying fd.
      * Alternatively, if another file is opened under the same fd held by
        the FileDesc structure returned by native::io::file::open, it will
        close the wrong file upon destruction.
      3fe0ba9a
  9. 16 7月, 2014 3 次提交
  10. 14 7月, 2014 1 次提交
    • A
      Stabilization for `owned` (now `boxed`) and `cell` · e0ede9c6
      Aaron Turon 提交于
      This PR is the outcome of the library stabilization meeting for the
      `liballoc::owned` and `libcore::cell` modules.
      
      Aside from the stability attributes, there are a few breaking changes:
      
      * The `owned` modules is now named `boxed`, to better represent its
        contents. (`box` was unavailable, since it's a keyword.) This will
        help avoid the misconception that `Box` plays a special role wrt
        ownership.
      
      * The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move`
        method is renamed to `downcast`, in both cases to improve clarity.
      
      * The recently-added `AnySendOwnExt` extension trait is removed; it was
        not being used and is unnecessary.
      
      [breaking-change]
      e0ede9c6
  11. 11 7月, 2014 1 次提交
    • A
      io::process::Command: add fine-grained env builder · bfa853f8
      Aaron Turon 提交于
      This commit changes the `io::process::Command` API to provide
      fine-grained control over the environment:
      
      * The `env` method now inserts/updates a key/value pair.
      * The `env_remove` method removes a key from the environment.
      * The old `env` method, which sets the entire environment in one shot,
        is renamed to `env_set_all`. It can be used in conjunction with the
        finer-grained methods. This renaming is a breaking change.
      
      To support these new methods, the internal `env` representation for
      `Command` has been changed to an optional `HashMap` holding owned
      `CString`s (to support non-utf8 data). The `HashMap` is only
      materialized if the environment is updated. The implementation does not
      try hard to avoid allocation, since the cost of launching a process will
      dwarf any allocation cost.
      
      This patch also adds `PartialOrd`, `Eq`, and `Hash` implementations for
      `CString`.
      
      [breaking-change]
      bfa853f8
  12. 10 7月, 2014 1 次提交
  13. 09 7月, 2014 1 次提交
  14. 27 6月, 2014 1 次提交
  15. 25 6月, 2014 1 次提交
    • N
      librustc: Remove the fallback to `int` from typechecking. · 9e3d0b00
      Niko Matsakis 提交于
      This breaks a fair amount of code. The typical patterns are:
      
      * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`;
      
      * `println!("{}", 3)`: change to `println!("{}", 3i)`;
      
      * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`.
      
      RFC #30. Closes #6023.
      
      [breaking-change]
      9e3d0b00
  16. 17 6月, 2014 1 次提交
    • A
      std: Support consuming a Process without waiting · 2fe92643
      Alex Crichton 提交于
      Forking off a child which survives the parent is often a useful task, and is
      currently not possible because the Process type will invoke `wait()` in its
      destructor in order to prevent leaking resources. This function adds a new safe
      method, `forget`, which can be used to consume an instance of `Process` which
      will then not call `wait` in the destructor.
      
      This new method is clearly documented as a leak of resources, but it must be
      forcibly opted in to.
      
      Closes #14467
      2fe92643
  17. 16 6月, 2014 1 次提交
  18. 12 6月, 2014 1 次提交
    • A
      rustc: Remove ~[T] from the language · 3316b1eb
      Alex Crichton 提交于
      The following features have been removed
      
      * box [a, b, c]
      * ~[a, b, c]
      * box [a, ..N]
      * ~[a, ..N]
      * ~[T] (as a type)
      * deprecated_owned_vector lint
      
      All users of ~[T] should move to using Vec<T> instead.
      3316b1eb
  19. 09 6月, 2014 1 次提交
  20. 07 6月, 2014 1 次提交
  21. 02 6月, 2014 1 次提交
    • A
      std: Drop Total from Total{Eq,Ord} · bba701c5
      Alex Crichton 提交于
      This completes the last stage of the renaming of the comparison hierarchy of
      traits. This change renames TotalEq to Eq and TotalOrd to Ord.
      
      In the future the new Eq/Ord will be filled out with their appropriate methods,
      but for now this change is purely a renaming change.
      
      [breaking-change]
      bba701c5
  22. 31 5月, 2014 1 次提交
    • A
      std: Rename {Eq,Ord} to Partial{Eq,Ord} · 748bc3ca
      Alex Crichton 提交于
      This is part of the ongoing renaming of the equality traits. See #12517 for more
      details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord}
      or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}.
      
      cc #12517
      
      [breaking-change]
      748bc3ca
  23. 28 5月, 2014 1 次提交
  24. 26 5月, 2014 1 次提交
  25. 25 5月, 2014 1 次提交
  26. 23 5月, 2014 2 次提交
  27. 22 5月, 2014 1 次提交
  28. 16 5月, 2014 2 次提交
  29. 15 5月, 2014 1 次提交
    • A
      Process::new etc should support non-utf8 commands/args · 046062d3
      Aaron Turon 提交于
      The existing APIs for spawning processes took strings for the command
      and arguments, but the underlying system may not impose utf8 encoding,
      so this is overly limiting.
      
      The assumption we actually want to make is just that the command and
      arguments are viewable as [u8] slices with no interior NULLs, i.e., as
      CStrings. The ToCStr trait is a handy bound for types that meet this
      requirement (such as &str and Path).
      
      However, since the commands and arguments are often a mixture of
      strings and paths, it would be inconvenient to take a slice with a
      single T: ToCStr bound. So this patch revamps the process creation API
      to instead use a builder-style interface, called `Command`, allowing
      arguments to be added one at a time with differing ToCStr
      implementations for each.
      
      The initial cut of the builder API has some drawbacks that can be
      addressed once issue #13851 (libstd as a facade) is closed. These are
      detailed as FIXMEs.
      
      Closes #11650.
      
      [breaking-change]
      046062d3
  30. 14 5月, 2014 1 次提交
    • A
      io: Implement process wait timeouts · f09592a5
      Alex Crichton 提交于
      This implements set_timeout() for std::io::Process which will affect wait()
      operations on the process. This follows the same pattern as the rest of the
      timeouts emerging in std::io::net.
      
      The implementation was super easy for everything except libnative on unix
      (backwards from usual!), which required a good bit of signal handling. There's a
      doc comment explaining the strategy in libnative. Internally, this also required
      refactoring the "helper thread" implementation used by libnative to allow for an
      extra helper thread (not just the timer).
      
      This is a breaking change in terms of the io::Process API. It is now possible
      for wait() to fail, and subsequently wait_with_output(). These two functions now
      return IoResult<T> due to the fact that they can time out.
      
      Additionally, the wait_with_output() function has moved from taking `&mut self`
      to taking `self`. If a timeout occurs while waiting with output, the semantics
      are undesirable in almost all cases if attempting to re-wait on the process.
      Equivalent functionality can still be achieved by dealing with the output
      handles manually.
      
      [breaking-change]
      
      cc #13523
      f09592a5
  31. 13 5月, 2014 1 次提交
  32. 09 5月, 2014 1 次提交
  33. 07 5月, 2014 1 次提交
    • A
      core: Inherit possible string functionality · 9bae6ec8
      Alex Crichton 提交于
      This moves as much allocation as possible from teh std::str module into
      core::str. This includes essentially all non-allocating functionality, mostly
      iterators and slicing and such.
      
      This primarily splits the Str trait into only having the as_slice() method,
      adding a new StrAllocating trait to std::str which contains the relevant new
      allocation methods. This is a breaking change if any of the methods of "trait
      Str" were overriden. The old functionality can be restored by implementing both
      the Str and StrAllocating traits.
      
      [breaking-change]
      9bae6ec8