| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Rename OOM to allocation error
The acronym is not descriptive unless one has seen it before.
* Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle.
* Rename `set_oom_hook` to `set_alloc_error_hook`
* Rename `take_oom_hook` to `take_alloc_error_hook`
Bikeshed: `on` v.s. `for`, `alloc` v.s. `allocator`, `error` v.s. `failure`
|
|
Fuchsia is changing the semantics for zx_cprng_draw and
zx_cprng_draw_new is a temporary name for the new semantics.
|
|
Use String, not &str in some collection examples
Discussed in #46966
Overuse of borrowed values in data structures is a common mistake I see in Rust user forums. Users who copy&paste such examples end up fighting with the borrow checker as soon as they replace string literals with some real values.
This changes a couple of examples to use `String`, and it adds opportunity to demonstrate use of `Borrow`.
|
|
The acronym is not descriptive unless one has seen it before.
* Rename the `oom` function to `handle_alloc_error`. It was **stabilized in 1.28**, so if we do this at all we need to land it this cycle.
* Rename `set_oom_hook` to `set_alloc_error_hook`
* Rename `take_oom_hook` to `take_alloc_error_hook`
Bikeshed: `alloc` v.s. `allocator`, `error` v.s. `failure`
|
|
|
|
|
|
libstd: add an RAII utility for sys_common::mutex::Mutex
It is indeed debatable whether or not we should introduce more sophistication like this to the lowest layer of a system library. In fact, `Drop::drop()` cannot be `unsafe` (IIRC there was a discussion on introducing an unsafe variant of `Drop` whose entire scope must be within `unsafe`)
|
|
Removed two unused variables in os.rs
Issue #51419 suggested removing two unused variables in `libstd/sys/redox/os.rs`. This PR implements that change.
It compiles for me locally, but I haven't run any other tests.
|
|
Signed-off-by: NODA, Kai <nodakai@gmail.com>
|
|
Add lint for intra link resolution failure
This PR is almost done, just remains this note:
```
note: requested on the command line with `-W intra-link-resolution-failure`
```
I have no idea why my lint is considered as being passed through command line and wasn't able to find where it was set. If anyone has an idea, it'd be very helpful!
cc @QuietMisdreavus
|
|
|
|
|
|
|
|
|
|
Certain directories in `/proc` can cause the `ReadDir`
iterator to loop indefinitely. We get an error code (22) when
calling libc's `readdir_r` on these directories, but `entry_ptr`
is `NULL` at the same time, signalling the end of the directory
stream.
This change introduces an internal state to the iterator such
that the `Some(Err(..))` value will only be returned once when
calling `next`. Subsequent calls will return `None`.
fixes #50619
|
|
Stabilize GlobalAlloc and #[global_allocator]
This PR implements the changes discussed in https://github.com/rust-lang/rust/issues/49668#issuecomment-393263510
Fixes #49668
Fixes #27389
This does not change the default global allocator: #36963
|
|
docs
|
|
|
|
|
|
|
|
|
|
|
|
Add some docs where they were missing,
attempt to fix them where they were out of date.
|
|
|
|
The heap.rs file was already unused.
|
|
|
|
|
|
[futures] add a few blanket impls to std
these were defined in the futures crate, but with the core definitions moving to std these would need to move too.
|
|
Add #[doc(inline)] in `std::task` to make the doc seem right.
|
|
|
|
|
|
[fuchsia] Migrate from launchpad to fdio_spawn_etc
fdio_spawn_etc is the preferred way of creating processes on Fuchsia
now.
cc @abarth
|
|
|
|
|
|
fdio_spawn_etc is the preferred way of creating processes on Fuchsia
now.
|
|
Add Future and task system to the standard library
This adds preliminary versions of the `std::future` and `std::task` modules in order to unblock development of async/await (https://github.com/rust-lang/rust/issues/50547). These shouldn't be considered as final forms of these libraries-- design questions about the libraries should be left on https://github.com/rust-lang/rfcs/pull/2418. Once that RFC (or a successor) is merged, these APIs will be adjusted as necessary.
r? @aturon
|
|
|
|
a portability lint"
This reverts commit 837d6c70233715a0ae8e15c703d40e3046a2f36a.
Fixes https://github.com/rust-lang/rust/issues/49415
|
|
Fix confusing error message for sub_instant
When subtracting an Instant from another, the function will panick when `RHS > self`, but the error message confusingly displays a different error:
```rust
let i = Instant::now();
let other = Instant::now();
if other > i {
println!("{:?}", i - other);
}
```
This results in a panic:
```
thread 'test_instant' panicked at 'other was less than the current instant', libstd/sys/unix/time.rs:292:17
```
But clearly, `other` was actually greater than the current instant.
|
|
rustdoc: introduce the #[doc(keyword="")] attribute for documenting keywords
Part of #34601.
r? @QuietMisdreavus
|
|
This now produces the same assembly code as the previous implementation.
|
|
|
|
Uses the same wording as [`src/libstd/sys/windows/time.rs`][1].
1: https://github.com/avdv/rust/blob/95e2bf253d864c5e14ad000ffa2040ce85916056/src/libstd/sys/windows/time.rs#L65
|
|
not required because this is a Rust function
|
|
|
|
|
|
|
|
|
|
|