about summary refs log tree commit diff
path: root/src/libstd/old_io
AgeCommit message (Collapse)AuthorLines
2015-02-17rollup merge of #22319: huonw/send-is-not-staticAlex Crichton-1/+1
Conflicts: src/libstd/sync/task_pool.rs src/libstd/thread.rs src/libtest/lib.rs src/test/bench/shootout-reverse-complement.rs src/test/bench/shootout-spectralnorm.rs
2015-02-17rollup merge of #22435: aturon/final-stab-threadAlex Crichton-122/+122
Conflicts: src/test/bench/rt-messaging-ping-pong.rs src/test/bench/rt-parfib.rs src/test/bench/task-perf-spawnalot.rs
2015-02-17rollup merge of #22459: alexcrichton/feature-namesAlex Crichton-1/+1
Conflicts: src/rustbook/main.rs
2015-02-17rollup merge of #22440: semarie/openbsd-connect_errorAlex Crichton-1/+3
The `connect_error` test check if connecting to "0.0.0.0:1" works (it shouldn't). And in case of error, the test expects a `ConnectionRefused` error. Under OpenBSD, trying to connect to "0.0.0.0" isn't a `ConnectionRefused`: it is an `InvalidInput` error. The patch allow the error to be `ConnectionRefused` or `InvalidInput`. Another possibility is to check connecting to "127.0.0.1:1" and expects only `ConnectionRefused` error.
2015-02-18Update tests for the Send - 'static change.Huon Wilson-1/+1
2015-02-17Fallout from stabilizationAaron Turon-122/+122
2015-02-17std: Rename io/path features with old_ prefixAlex Crichton-1/+1
This commit renames the features for the `std::old_io` and `std::old_path` modules to `old_io` and `old_path` to help facilitate migration to the new APIs. This is a breaking change as crates which mention the old feature names now need to be renamed to use the new feature names. [breaking-change]
2015-02-17Auto merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonbors-2/+2
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
2015-02-17Rollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonManish Goregaokar-2/+2
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
2015-02-17Rollup merge of #22404 - semarie:signal_reported_right, r=aturonManish Goregaokar-3/+3
The test \"signal_reported_right\" send a signal `1` to `/bin/sh`, and check the status code to check if the signal is reported right. Under OpenBSD, the signal `1` (`SIGHUP`) is catched by `/bin/sh`, resulting the test failed. Use the uncatchable signal `9` (`SIGKILL`) for test.
2015-02-17openbsd: adapt connect_error testSébastien Marie-1/+3
The connect_error test check if connecting to "0.0.0.0:1" works (it shouldn't). And in case of error, the test expects a ConnectionRefused error. Under OpenBSD, trying to connect to "0.0.0.0" isn't a ConnectionRefused: it is an InvalidInput error. The patch allow the error to be ConnectionRefused or InvalidInput.
2015-02-17Auto merge of #21932 - Jormundir:std-os-errno-type, r=alexcrichtonbors-2/+2
Changes std::os::errno to return i32, the return type used by the function being delegated to. This is my first contribution, so feel free to give me advice. I'll be happy to correct things.
2015-02-16change the signal used to test signal_reported_rightSébastien Marie-3/+3
The test "signal_reported_right" send a signal `1` to `/bin/sh`, and check the status code to check if the signal is reported right. Under OpenBSD, the signal `1` (`SIGHUP`) is catched by `/bin/sh`, resulting the test failed. Use the uncatchable signal `9` (`SIGKILL`) for test.
2015-02-15Fix rollup (remove slicing_syntax)Manish Goregaokar-1/+0
2015-02-13Rename std::failure to std::panickingKevin Yap-1/+1
Closes #22306.
2015-02-14Rename `fmt::Writer` to `fmt::Write`Chris Wong-2/+2
This brings it in line with its namesake in `std::io`. [breaking-change]
2015-02-11rollup merge of #22127: alexcrichton/stability-holesAlex Crichton-21/+24
There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Closes #8962 Closes #16360 Closes #20327
2015-02-11rustc: Fix a number of stability lint holesAlex Crichton-21/+24
There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Additionally, the compiler now has special logic to ignore its own generated `__test` module for the `--test` harness in terms of stability. Closes #8962 Closes #16360 Closes #20327 [breaking-change]
2015-02-11shift bindings to accommodate new lifetime/dtor rules.Felix S. Klock II-2/+4
(My fix to for-loops (21984) did not deal with similar problems in if-let expressions, so those binding shifts stay.)
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-53/+53
2015-02-04Remove unnecessary type casts.Jormundir-1/+1
2015-02-04remove all kind annotations from closuresJorge Aparicio-11/+11
2015-02-04std::os::errno returns platform specific value. fixes #21898Jormundir-2/+2
2015-02-04Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichtonbors-0/+2
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io. [breaking-change]
2015-02-04Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.Huon Wilson-0/+2
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]
2015-02-03Rename std::path to std::old_pathAaron Turon-6/+6
As part of [RFC 474](https://github.com/rust-lang/rfcs/pull/474), this commit renames `std::path` to `std::old_path`, leaving the existing path API in place to ease migration to the new one. Updating should be as simple as adjusting imports, and the prelude still maps to the old path APIs for now. [breaking-change]
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-18/+18
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02rollup merge of #21787: alexcrichton/std-envAlex Crichton-9/+10
Conflicts: src/libstd/sys/unix/backtrace.rs src/libstd/sys/unix/os.rs
2015-02-02remove unused mut qualifiersJorge Aparicio-1/+1
2015-02-02`for x in xs.into_iter()` -> `for x in xs`Jorge Aparicio-2/+2
Also `for x in option.into_iter()` -> `if let Some(x) = option`
2015-02-02`for x in xs.iter_mut()` -> `for x in &mut xs`Jorge Aparicio-3/+3
Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-12/+12
2015-02-01std: Add a new `env` moduleAlex Crichton-9/+10
This is an implementation of [RFC 578][rfc] which adds a new `std::env` module to replace most of the functionality in the current `std::os` module. More details can be found in the RFC itself, but as a summary the following methods have all been deprecated: [rfc]: https://github.com/rust-lang/rfcs/pull/578 * `os::args_as_bytes` => `env::args` * `os::args` => `env::args` * `os::consts` => `env::consts` * `os::dll_filename` => no replacement, use `env::consts` directly * `os::page_size` => `env::page_size` * `os::make_absolute` => use `env::current_dir` + `join` instead * `os::getcwd` => `env::current_dir` * `os::change_dir` => `env::set_current_dir` * `os::homedir` => `env::home_dir` * `os::tmpdir` => `env::temp_dir` * `os::join_paths` => `env::join_paths` * `os::split_paths` => `env::split_paths` * `os::self_exe_name` => `env::current_exe` * `os::self_exe_path` => use `env::current_exe` + `pop` * `os::set_exit_status` => `env::set_exit_status` * `os::get_exit_status` => `env::get_exit_status` * `os::env` => `env::vars` * `os::env_as_bytes` => `env::vars` * `os::getenv` => `env::var` or `env::var_string` * `os::getenv_as_bytes` => `env::var` * `os::setenv` => `env::set_var` * `os::unsetenv` => `env::remove_var` Many function signatures have also been tweaked for various purposes, but the main changes were: * `Vec`-returning APIs now all return iterators instead * All APIs are now centered around `OsString` instead of `Vec<u8>` or `String`. There is currently on convenience API, `env::var_string`, which can be used to get the value of an environment variable as a unicode `String`. All old APIs are `#[deprecated]` in-place and will remain for some time to allow for migrations. The semantics of the APIs have been tweaked slightly with regard to dealing with invalid unicode (panic instead of replacement). The new `std::env` module is all contained within the `env` feature, so crates must add the following to access the new APIs: #![feature(env)] [breaking-change]
2015-01-31Kill more `isize`sTobias Bucher-4/+4
2015-01-30Test fixes and rebase conflictsAlex Crichton-6/+6
Also some tidying up of a bunch of crate attributes
2015-01-30rollup merge of #21631: tbu-/isize_policeAlex Crichton-8/+8
Conflicts: src/libcoretest/iter.rs
2015-01-30rollup merge of #21713: alexcrichton/second-pass-fmtAlex Crichton-2/+3
2015-01-30rollup merge of #21736: sfackler/bufread-capacity-fixAlex Crichton-1/+1
We don't care about how much space the allocation has, but the actual usable space in the buffer. r? @alexcrichton
2015-01-30std: Stabilize the std::fmt moduleAlex Crichton-2/+3
This commit performs a final stabilization pass over the std::fmt module, marking all necessary APIs as stable. One of the more interesting aspects of this module is that it exposes a good deal of its runtime representation to the outside world in order for `format_args!` to be able to construct the format strings. Instead of hacking the compiler to assume that these items are stable, this commit instead lays out a story for the stabilization and evolution of these APIs. There are three primary details used by the `format_args!` macro: 1. `Arguments` - an opaque package of a "compiled format string". This structure is passed around and the `write` function is the source of truth for transforming a compiled format string into a string at runtime. This must be able to be constructed in stable code. 2. `Argument` - an opaque structure representing an argument to a format string. This is *almost* a trait object as it's just a pointer/function pair, but due to the function originating from one of many traits, it's not actually a trait object. Like `Arguments`, this must be constructed from stable code. 3. `fmt::rt` - this module contains the runtime type definitions primarily for the `rt::Argument` structure. Whenever an argument is formatted with nonstandard flags, a corresponding `rt::Argument` is generated describing how the argument is being formatted. This can be used to construct an `Arguments`. The primary interface to `std::fmt` is the `Arguments` structure, and as such this type name is stabilize as-is today. It is expected for libraries to pass around an `Arguments` structure to represent a pending formatted computation. The remaining portions are largely "cruft" which would rather not be stabilized, but due to the stability checks they must be. As a result, almost all pieces have been renamed to represent that they are "version 1" of the formatting representation. The theory is that at a later date if we change the representation of these types we can add new definitions called "version 2" and corresponding constructors for `Arguments`. One of the other remaining large questions about the fmt module were how the pending I/O reform would affect the signatures of methods in the module. Due to [RFC 526][rfc], however, the writers of fmt are now incompatible with the writers of io, so this question has largely been solved. As a result the interfaces are largely stabilized as-is today. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md Specifically, the following changes were made: * The contents of `fmt::rt` were all moved under `fmt::rt::v1` * `fmt::rt` is stable * `fmt::rt::v1` is stable * `Error` is stable * `Writer` is stable * `Writer::write_str` is stable * `Writer::write_fmt` is stable * `Formatter` is stable * `Argument` has been renamed to `ArgumentV1` and is stable * `ArgumentV1::new` is stable * `ArgumentV1::from_uint` is stable * `Arguments::new_v1` is stable (renamed from `new`) * `Arguments::new_v1_formatted` is stable (renamed from `with_placeholders`) * All formatting traits are now stable, as well as the `fmt` method. * `fmt::write` is stable * `fmt::format` is stable * `Formatter::pad_integral` is stable * `Formatter::pad` is stable * `Formatter::write_str` is stable * `Formatter::write_fmt` is stable * Some assorted top level items which were only used by `format_args!` were removed in favor of static functions on `ArgumentV1` as well. * The formatting-flag-accessing methods remain unstable Within the contents of the `fmt::rt::v1` module, the following actions were taken: * Reexports of all enum variants were removed * All prefixes on enum variants were removed * A few miscellaneous enum variants were renamed * Otherwise all structs, fields, and variants were marked stable. In addition to these actions in the `std::fmt` module, many implementations of `Show` and `String` were stabilized as well. In some other modules: * `ToString` is now stable * `ToString::to_string` is now stable * `Vec` no longer implements `fmt::Writer` (this has moved to `String`) This is a breaking change due to all of the changes to the `fmt::rt` module, but this likely will not have much impact on existing programs. Closes #20661 [breaking-change]
2015-01-30std: Stabilize FromStr and parseAlex Crichton-49/+59
This commits adds an associated type to the `FromStr` trait representing an error payload for parses which do not succeed. The previous return value, `Option<Self>` did not allow for this form of payload. After the associated type was added, the following attributes were applied: * `FromStr` is now stable * `FromStr::Err` is now stable * `FromStr::from_str` is now stable * `StrExt::parse` is now stable * `FromStr for bool` is now stable * `FromStr for $float` is now stable * `FromStr for $integral` is now stable * Errors returned from stable `FromStr` implementations are stable * Errors implement `Display` and `Error` (both impl blocks being `#[stable]`) Closes #15138
2015-01-30Remove all `i` suffixesTobias Bucher-8/+8
2015-01-29s/Show/Debug/gJorge Aparicio-25/+25
2015-01-29remove unused importsJorge Aparicio-1/+1
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-2/+2
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-24/+24
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29`range(a, b).foo()` -> `(a..b).foo()`Jorge Aparicio-1/+1
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-29Auto merge of #21680 - japaric:slice, r=alexcrichtonbors-5/+5
Replaces `slice_*` method calls with slicing syntax, and removes `as_slice()` calls that are redundant due to `Deref`.
2015-01-28Fix up check to bypass internal bufferSteven Fackler-1/+1
We don't care about how much space the allocation has, but the actual usable space in the buffer.
2015-01-27Merge remote-tracking branch 'rust-lang/master'Brian Anderson-0/+12833
Conflicts: src/libcore/cell.rs src/librustc_driver/test.rs src/libstd/old_io/net/tcp.rs src/libstd/old_io/process.rs
2015-01-27cleanup: s/`v.slice*()`/`&v[a..b]`/g + remove redundant `as_slice()` callsJorge Aparicio-5/+5