- 08 5月, 2015 4 次提交
-
-
由 Alex Crichton 提交于
This commit is an implementation of [RFC 1066][rfc] where the conclusion was that leaking a value is a safe operation in Rust code, so updating the signature of this function follows suit. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1066-safe-mem-forget.md Closes #25186
-
由 Alex Crichton 提交于
Perform unsafe initialization up front and then only afterward the mutex is in place do we initialize it.
-
由 Alex Crichton 提交于
This module has been removed for quite some time!
-
由 Alex Crichton 提交于
Now that `std::old_io` has been removed for quite some time the naming real estate here has opened up to allow these modules to move back to their proper names.
-
- 07 5月, 2015 1 次提交
-
-
由 Steven Allen 提交于
-
- 06 5月, 2015 1 次提交
-
-
由 Tshepang Lekhonkhobe 提交于
-
- 05 5月, 2015 1 次提交
-
-
由 Alex Crichton 提交于
These all had a typo where they were accessing the seconds field, not the nanoseconds field.
-
- 04 5月, 2015 3 次提交
-
-
由 Nick Hamann 提交于
-
由 Nick Hamann 提交于
This now omits address fields in Debug implementations when a proper address value cannot be unwrapped.
-
由 Nick Hamann 提交于
Fixes #23134.
-
- 01 5月, 2015 4 次提交
-
-
由 Corey Farwell 提交于
Even spelled out, one would say 'a Universal Character Set'
-
由 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]
-
由 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
-
由 Alex Crichton 提交于
-
- 30 4月, 2015 1 次提交
-
-
由 Alex Crichton 提交于
-
- 29 4月, 2015 3 次提交
-
-
由 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.
-
由 Alex Crichton 提交于
This is the last remaining portion of #24796
-
由 Tamir Duberstein 提交于
-
- 28 4月, 2015 4 次提交
-
-
由 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`.
-
由 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
-
由 Alex Crichton 提交于
Statically linked executables do not succeed (aka MUSL-based executables).
-
由 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.
-
- 26 4月, 2015 1 次提交
-
-
由 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.
-
- 25 4月, 2015 1 次提交
-
-
由 Johannes Oertel 提交于
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
-
- 23 4月, 2015 3 次提交
-
-
由 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.
-
由 Young Wu 提交于
-
由 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
-
- 22 4月, 2015 4 次提交
-
-
由 Alex Crichton 提交于
-
由 Alex Crichton 提交于
This API was exercised in a few tests and mirrors the `from_str_radix` functionality of the integer types.
-
由 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]
-
由 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`.
-
- 21 4月, 2015 2 次提交
-
-
由 Tamir Duberstein 提交于
Looks like these were missed in bf4e77d4.
-
由 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
-
- 18 4月, 2015 1 次提交
-
-
由 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
-
- 17 4月, 2015 1 次提交
-
-
由 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
-
- 15 4月, 2015 5 次提交
-
-
由 Tamir Duberstein 提交于
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
-
由 Tamir Duberstein 提交于
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
-
由 Alex Crichton 提交于
This commit removes the last remnants of file descriptors from the Windows implementation of `std::sys` by using `CreatePipe` to create anonymous pipes instead of the `pipe` shim provided in msvcrt.
-
由 Alex Crichton 提交于
This commit modifies the socket creation functions on windows to always specify the `WSA_FLAG_OVERLAPPED` and `WSA_FLAG_NO_HANDLE_INHERIT` flags by default. The overlapped flag enables IOCP APIs on Windows to be used with the socket at no cost, enabling better interoperation with external libraries. The no handle inherit flag mirrors the upcoming change to Unix to set CLOEXEC by default for all handles. Closes #24206
-
由 Alex Crichton 提交于
This commit entirely removes the old I/O, path, and rand modules. All functionality has been deprecated and unstable for quite some time now!
-