about summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
2015-03-09Rename #[should_fail] to #[should_panic]Steven Fackler-5/+5
2015-03-06rollup merge of #22813: alexcrichton/deprecate-netAlex Crichton-0/+20
The `std::net` primitives should be ready for use now and as a result the old ones are now deprecated and slated for removal. Most TCP/UDP functionality is now available through `std::net` but the `std::old_io::net::pipe` module is removed entirely from the standard library. Unix socket funtionality can be found in sfackler's [`unix_socket`][unix] crate and there is currently no replacement for named pipes on Windows. [unix]: https://crates.io/crates/unix_socket [breaking-change]
2015-03-06std: Deprecate the std::old_io::net primitivesAlex Crichton-0/+20
The `std::net` primitives should be ready for use now and as a result the old ones are now deprecated and slated for removal. Most TCP/UDP functionality is now available through `std::net` but the `std::old_io::net::pipe` module is removed entirely from the standard library. Unix socket funtionality can be found in sfackler's [`unix_socket`][unix] crate and there is currently no replacement for named pipes on Windows. [unix]: https://crates.io/crates/unix_socket [breaking-change]
2015-03-06Rollup merge of #23079 - alexcrichton:deprecate-process, r=aturonManish Goregaokar-0/+4
This module is now superseded by the `std::process` module. This module still has some room to expand to get quite back up to parity with the `old_io` version, and there is a [tracking issue][issue] for feature requests as well as known room for expansion. [issue]: https://github.com/rust-lang/rfcs/issues/941 [breaking-change]
2015-03-06Rollup merge of #22899 - huonw:macro-stability, r=alexcrichtonManish Goregaokar-5/+1
Unstable items used in a macro expansion will now always trigger stability warnings, *unless* the unstable items are directly inside a macro marked with `#[allow_internal_unstable]`. IOW, the compiler warns unless the span of the unstable item is a subspan of the definition of a macro marked with that attribute. E.g. #[allow_internal_unstable] macro_rules! foo { ($e: expr) => {{ $e; unstable(); // no warning only_called_by_foo!(); }} } macro_rules! only_called_by_foo { () => { unstable() } // warning } foo!(unstable()) // warning The unstable inside `foo` is fine, due to the attribute. But the `unstable` inside `only_called_by_foo` is not, since that macro doesn't have the attribute, and the `unstable` passed into `foo` is also not fine since it isn't contained in the macro itself (that is, even though it is only used directly in the macro). In the process this makes the stability tracking much more precise, e.g. previously `println!(\"{}\", unstable())` got no warning, but now it does. As such, this is a bug fix that may cause [breaking-change]s. The attribute is definitely feature gated, since it explicitly allows side-stepping the feature gating system. --- This updates `thread_local!` macro to use the attribute, since it uses unstable features internally (initialising a struct with unstable fields).
2015-03-05std: Deprecate the old_io::process moduleAlex Crichton-0/+4
This module is now superseded by the `std::process` module. This module still has some room to expand to get quite back up to parity with the `old_io` version, and there is a [tracking issue][issue] for feature requests as well as known room for expansion. [issue]: https://github.com/rust-lang/rfcs/issues/941 [breaking-change]
2015-03-06Use `#[allow_internal_unstable]` for `thread_local!`Huon Wilson-5/+1
This destabilises all the implementation details of `thread_local!`, since they do not *need* to be stable with the new attribute.
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-3/+3
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-1/+3
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-03Auto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddybbors-1/+1
Rebase and follow-through on work done by @cmr and @aatch. Implements most of rust-lang/rfcs#560. Errors encountered from the checks during building were fixed. The checks for division, remainder and bit-shifting have not been implemented yet. See also PR #20795 cc @Aatch ; cc @nikomatsakis
2015-03-03Rollup merge of #22956 - ejjeong:aarch64-linux-android, r=alexcrichtonManish Goregaokar-1/+1
aarch64-linux-android build has been broken since #22839. Aarch64 android has _Unwind_GetIPInfo, so re-define this only for arm32 android. r? @alexcrichton
2015-03-03Rollup merge of #22876 - Florob:const, r=nikomatsakisManish Goregaokar-3/+3
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-03-03Rollup merge of #22943 - ipetkov:lint-recursion, r=alexcrichtonManish Goregaokar-8/+9
* The lint visitor's visit_ty method did not recurse, and had a reference to the now closed #10894 * The newly enabled recursion has only affected the `deprectated` lint which now detects uses of deprecated items in trait impls and function return types * Renamed some references to `CowString` and `CowVec` to `Cow<str>` and `Cow<[T]>`, respectively, which appear outside of the crate which defines them * Replaced a few instances of `InvariantType<T>` with `PhantomData<Cell<T>>` * Disabled the `deprecated` lint in several places that reference/implement traits on deprecated items which will get cleaned up in the future * Unfortunately, this means that if a library declares `#![deny(deprecated)]` and marks anything as deprecated, it will have to disable the lint for any uses of said item, e.g. any impl the now deprecated item For any library that denies deprecated items but has deprecated items of its own, this is a [breaking-change] I had originally intended for the lint to ignore uses of deprecated items that are declared in the same crate, but this goes against some previous test cases that expect the lint to capture *all* uses of deprecated items, so I maintained the previous approach to avoid changing the expected behavior of the lint. Tested locally on OS X, so hopefully there aren't any deprecated item uses behind a `cfg` that I may have missed.
2015-03-03Fix backtrace tests for LinuxManish Goregaokar-1/+1
2015-03-02core: Audit num module for int/uintBrian Anderson-2/+2
* count_ones/zeros, trailing_ones/zeros return u32, not usize * rotate_left/right take u32, not usize * RADIX, MANTISSA_DIGITS, DIGITS, BITS, BYTES are u32, not usize Doesn't touch pow because there's another PR for it. [breaking-change]
2015-03-02Enable recursion for visit_ty in lint visitorIvan Petkov-8/+9
* The lint visitor's visit_ty method did not recurse, and had a reference to the now closed #10894 * The newly enabled recursion has only affected the `deprectated` lint which now detects uses of deprecated items in trait impls and function return types * Renamed some references to `CowString` and `CowVec` to `Cow<str>` and `Cow<[T]>`, respectively, which appear outside of the crate which defines them * Replaced a few instances of `InvariantType<T>` with `PhantomData<Cell<T>>` * Disabled the `deprecated` lint in several places that reference/implement traits on deprecated items which will get cleaned up in the future * Disabled the `exceeding_bitshifts` lint for compile-fail/huge-array-simple test so it doesn't shadow the expected error on 32bit systems * Unfortunately, this means that if a library declares `#![deny(deprecated)]` and marks anything as deprecated, it will have to disable the lint for any uses of said item, e.g. any impl the now deprecated item For any library that denies deprecated items but has deprecated items of its own, this is a [breaking-change]
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-3/+3
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-03-02Auto merge of #22797 - alexcrichton:io-stdio, r=aturonbors-2/+224
This is an implementation of RFC 899 and adds stdio functionality to the new `std::io` module. Details of the API can be found on the RFC, but from a high level: * `io::{stdin, stdout, stderr}` constructors are now available. There are also `*_raw` variants for unbuffered and unlocked access. * All handles are globally shared (excluding raw variants). * The stderr handle is no longer buffered. * All handles can be explicitly locked (excluding the raw variants). The `print!` and `println!` machinery has not yet been hooked up to these streams just yet. The `std::fmt::output` module has also not yet been implemented as part of this commit.
2015-03-02Fix broken aarch64 buildEunji Jeong-1/+1
2015-02-28std: Implement stdio for `std::io`Alex Crichton-2/+224
This is an implementation of RFC 899 and adds stdio functionality to the new `std::io` module. Details of the API can be found on the RFC, but from a high level: * `io::{stdin, stdout, stderr}` constructors are now available. There are also `*_raw` variants for unbuffered and unlocked access. * All handles are globally shared (excluding raw variants). * The stderr handle is no longer buffered. * All handles can be explicitly locked (excluding the raw variants). The `print!` and `println!` machinery has not yet been hooked up to these streams just yet. The `std::fmt::output` module has also not yet been implemented as part of this commit.
2015-02-28openbsd: adjust page guard addressSébastien Marie-1/+1
some commits in OpenBSD base have corrected a problem of stack position. Now, we can adjust more accurately the page guard in rust.
2015-02-28Rollup merge of #22884 - japaric:obsolete, r=alexcrichtonManish Goregaokar-2/+2
This is leftover from #21843 If you still have `|&:| {}` closures in your code, simply remove the `&:` part. [breaking-change]
2015-02-28Auto merge of #22839 - lifthrasiir:better-backtrace, r=alexcrichtonbors-10/+107
Fixes #20978 for supported platforms (i.e. non-Android POSIX). This uses `backtrace_pcinfo` to inspect the DWARF debug info and list the file and line pairs for given stack frame. Such pair is not unique due to the presence of inlined functions and the updated routine correctly handles this case. The code is modelled after libbacktrace's `backtrace_full` routine. There is one known issue with this approach. Macros, when invoked, take over the current frame and shadows the file and line pair which has invoked a macro. In particular, this makes many panicking macros a bit harder to inspect. This really is a debuginfo problem, and the backtrace routine should print them correctly with a correct debuginfo. Some example trace: ``` thread '<main>' panicked at 'explicit panic', /home/arachneng/Works/git/rust/src/test/run-pass/backtrace-debuginfo.rs:74 stack backtrace: 1: 0xd964702f - sys::backtrace::write::h32d93fffb64131b2yxC 2: 0xd9670202 - panicking::on_panic::h3a4fcb37b873aefeooM 3: 0xd95b396a - rt::unwind::begin_unwind_inner::h576b3df5f626902dJ2L 4: 0xd9eb88df - rt::unwind::begin_unwind::h16852273847167740350 5: 0xd9eb8afb - aux::callback::h15056955655605709172 at /home/arachneng/Works/git/rust/<std macros>:3 at src/test/run-pass/backtrace-debuginfo-aux.rs:15 6: 0xd9eb8caa - outer::h2cf96412459fceb6ema at src/test/run-pass/backtrace-debuginfo.rs:73 at src/test/run-pass/backtrace-debuginfo.rs:88 7: 0xd9ebab24 - main::h3f701287441442edasa at src/test/run-pass/backtrace-debuginfo.rs:134 8: 0xd96daba8 - rust_try_inner 9: 0xd96dab95 - rust_try 10: 0xd9671af4 - rt::lang_start::h7da0de9529b4c394liM 11: 0xd8f3aec4 - __libc_start_main 12: 0xd9eb8148 - <unknown> 13: 0xffffffff - <unknown> ```
2015-02-27remove leftover annotationsJorge Aparicio-2/+2
2015-02-28std: Fixed backtrace warnings and tests for non-Linux platforms.Kang Seonghoon-1/+2
- Fixed a couple of dead code warnings in std::sys::backtrace. - Made `backtrace-debuginfo` test a no-op on non-Linux platforms. - `backtrace-debuginfo` is no longer tested on pretty-rpass.
2015-02-27Rollup merge of #22788 - vadimcn:fix-precise_time_ns, r=pnkfelixManish Goregaokar-2/+25
which starts happening after ~2 hours of machine uptime. Closes #17845
2015-02-27Rollup merge of #22846 - dhuseby:bitrig-cleanup, r=alexcrichtonManish Goregaokar-15/+1
This patch contains a couple time fixes to make Rust compile on Bitrig again. This does not affect OpenBSD.
2015-02-26fixing a few bitrig build breakersDave Huseby-15/+1
2015-02-27std: Include line numbers in backtraces.Kang Seonghoon-10/+106
Fixes #20978 for supported platforms (i.e. non-Android POSIX). This uses `backtrace_pcinfo` to inspect the DWARF debug info and list the file and line pairs for given stack frame. Such pair is not unique due to the presence of inlined functions and the updated routine correctly handles this case. The code is modelled after libbacktrace's `backtrace_full` routine. There is one known issue with this approach. Macros, when invoked, take over the current frame and shadows the file and line pair which has invoked a macro. In particular, this makes many panicking macros a bit harder to inspect. This really is a debuginfo problem, and the backtrace routine should print them correctly with a correct debuginfo.
2015-02-26path -> PathBuf for openbsd/bitrigSébastien Marie-1/+2
2015-02-25Fix overflow in precise_time_ns() on Windows,Vadim Chugunov-2/+25
which starts happening after ~2 hours of machine uptime.
2015-02-25path -> PathBuf for osx/dragonfly (fixup #22727)Manish Goregaokar-11/+11
2015-02-25Assert is internal now (fixup #22739)Manish Goregaokar-1/+1
2015-02-25Fix type inference error (fixup #22739)Manish Goregaokar-1/+1
2015-02-25Rollup merge of #22744 - alexcrichton:issue-22738, r=aturonManish Goregaokar-0/+4
Currently we have a `set_mode` mutator, so this just adds the pairing of a `mode` accessor to read the value. Closes #22738
2015-02-25Rollup merge of #22727 - alexcrichton:prep-env, r=aturonManish Goregaokar-57/+69
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
2015-02-25Rollup merge of #22596 - alexcrichton:fix-some-impls, r=huonwManish Goregaokar-9/+33
This commit removes many unnecessary `unsafe impl` blocks as well as pushing the needed implementations to the lowest level possible. I noticed that the bounds for `RwLock` are a little off when reviewing #22574 and wanted to ensure that we had our story straight on these implementations.
2015-02-24std: Move std::env to the new I/O APIsAlex Crichton-57/+69
This commit moves `std::env` away from the `std::old_io` error type as well as the `std::old_path` module. Methods returning an error now return `io::Error` and methods consuming or returning paths use `std::path` instead of `std::old_path`. This commit does not yet mark these APIs as `#[stable]`. This commit also migrates `std::old_io::TempDir` to `std::fs::TempDir` with essentially the exact same API. This type was added to interoperate with the new path API and has its own `tempdir` feature. Finally, this commit reverts the deprecation of `std::os` APIs returning the old path API types. This deprecation can come back once the entire `std::old_path` module is deprecated. [breaking-change]
2015-02-25Rollup merge of #22772 - tbu-:pr_panic_fail, r=alexcrichtonManish Goregaokar-1/+1
2015-02-25Rollup merge of #22758 - ejjeong:aarch64-linux-android, r=alexcrichtonManish Goregaokar-2/+19
This commit has already been merged in #21774, but i think it has been accidently overriden by #22584 and #22480. r? @alexcrichton
2015-02-25Rollup merge of #22739 - tbu-:pr_error_net, r=alexcrichtonManish Goregaokar-31/+37
This affects the `set_non_blocking` function which cannot fail for Unix or Windows, given correct parameters. Additionally, the short UDP write error case has been removed as there is no such thing as \"short UDP writes\", instead, the operating system will error out if the application tries to send a packet larger than the MTU of the network path.
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-3/+3
2015-02-24Improve readability of an error check in `set_non_blocking`Tobias Bucher-5/+5
2015-02-24Revert a wrong replace of "fail" to "panic"Tobias Bucher-1/+1
2015-02-24Replace deprecated getdtablesize() with sysconf(_SC_OPEN_MAX) for android ↵Eunji Jeong-2/+19
aarch64
2015-02-24Rollup merge of #22594 - alexcrichton:issue-22577, r=aturonManish Goregaokar-25/+47
The windows/unix modules were currently inconsistent about the traits being implemented for `DirEntry` and there isn't much particular reason why the traits *couldn't* be implemented for `ReadDir` and `DirEntry`, so this commit ensures that they are implemented. Closes #22577
2015-02-23std: Expose a `mode` accessor for Permissions on unixAlex Crichton-0/+4
Currently we have a `set_mode` mutator, so this just adds the pairing of a `mode` accessor to read the value. Closes #22738
2015-02-23Hide unnecessary error checking from the userTobias Bucher-29/+35
This affects the `set_non_blocking` function which cannot fail for Unix or Windows, given correct parameters. Additionally, the short UDP write error case has been removed as there is no such thing as "short UDP writes", instead, the operating system will error out if the application tries to send a packet larger than the MTU of the network path.
2015-02-23Test fixes and rebase conflictsAlex Crichton-2/+0
2015-02-23Fix windows failure (fixup #22538)Manish Goregaokar-2/+2