Commit graph

632 commits

Author SHA1 Message Date
bors
cb6122db3f Auto merge of #67076 - mbrubeck:condvar, r=dtolnay
Stabilize Condvar::wait_while and wait_timeout_while (previously wait_until, wait_timeout_until)

Closes #47960.
2020-01-14 10:34:43 +00:00
Igor Aleksanov
f720469fd0 Use matches macro in libcore and libstd 2020-01-08 07:10:28 +03:00
Oliver Scherer
48efc1e6c2
Rollup merge of #67632 - kraai:remove-collapsed-reference-links, r=steveklabnik
Convert collapsed to shortcut reference links
2019-12-28 00:36:11 +01:00
Matt Brubeck
98d054af08 Rename wait_until/wait_timeout_until to wait_while/white_timeout_while 2019-12-26 14:15:05 -08:00
Matt Brubeck
207e60a364 Stabilize Condvar::wait_until and wait_timeout_until 2019-12-26 14:15:05 -08:00
Matthew Kraai
2f43313834 Convert collapsed to shortcut reference links 2019-12-26 05:27:55 -08:00
Matthew Kraai
21e636f188 Remove redundant link texts 2019-12-26 05:04:46 -08:00
David Tolnay
4646a88b7a
Deprecate Error::description for real
`description` has been documented as soft-deprecated since 1.27.0 (17
months ago). There is no longer any reason to call it or implement it.

This commit:

- adds #[rustc_deprecated(since = "1.41.0")] to Error::description;

- moves description (and cause, which is also deprecated) below the
  source and backtrace methods in the Error trait;

- reduces documentation of description and cause to take up much less
  vertical real estate in rustdocs, while preserving the example that
  shows how to render errors without needing to call description;

- removes the description function of all *currently unstable* Error
  impls in the standard library;

- marks #[allow(deprecated)] the description function of all *stable*
  Error impls in the standard library;

- replaces miscellaneous uses of description in example code and the
  compiler.
2019-12-24 22:39:49 -08:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Mark Rousskov
82184440ec Propagate cfg bootstrap 2019-12-18 12:16:19 -05:00
Oliver Scherer
5e17e39881 Require stable/unstable annotations for the constness of all stable functions with a const modifier 2019-12-13 11:27:02 +01:00
Ralf Jung
49697ae38b get rid of __ in field names 2019-12-06 17:28:04 +01:00
David Tolnay
4436c9d354
Format libstd with rustfmt
This commit applies rustfmt with rust-lang/rust's default settings to
files in src/libstd *that are not involved in any currently open PR* to
minimize merge conflicts. THe list of files involved in open PRs was
determined by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8

With the list of files from the script in outstanding_files, the
relevant commands were:

    $ find src/libstd -name '*.rs' \
        | xargs rustfmt --edition=2018 --unstable-features --skip-children
    $ rg libstd outstanding_files | xargs git checkout --

Repeating this process several months apart should get us coverage of
most of the rest of libstd.

To confirm no funny business:

    $ git checkout $THIS_COMMIT^
    $ git show --pretty= --name-only $THIS_COMMIT \
        | xargs rustfmt --edition=2018 --unstable-features --skip-children
    $ git diff $THIS_COMMIT  # there should be no difference
2019-11-29 18:43:27 -08:00
Paul Dicker
b05e200867 Run rustfmt on libstd/sync/once.rs 2019-11-09 12:46:17 +01:00
Paul Dicker
4c66658f2c Don't mutate node.next 2019-11-05 07:15:35 +01:00
Paul Dicker
3712bb68c4 Mention park guarantee 2019-10-25 10:01:27 +02:00
Paul Dicker
c2bbfeadcc Always align Waiter to 4 bytes 2019-10-24 17:57:07 +02:00
Paul Dicker
c11a44ab6c Use more precise atomic orderings 2019-10-24 17:57:07 +02:00
Paul Dicker
88c70edef6 In Waiter use interior mutability for thread 2019-10-24 17:57:05 +02:00
Paul Dicker
4b8da9ccd5 Reduce the amount of comments in call_inner 2019-10-24 17:28:08 +02:00
Paul Dicker
2e8eb5f33d Move thread parking to a seperate function 2019-10-24 17:28:08 +02:00
Paul Dicker
fbc242f1ef Turn Finish into WaiterQueue 2019-10-24 17:28:04 +02:00
Paul Dicker
1479c22a39 Don't mutate waiter nodes 2019-10-23 16:38:50 +02:00
Paul Dicker
7f1e166899 Simplify loop conditions in RUNNING and add comments 2019-10-23 12:09:54 +02:00
Paul Dicker
2ab812c181 Rename state to state_and_queue 2019-10-23 12:09:53 +02:00
boyned//Kampfkarren
247df6e134
Don't recommend ONCE_INIT in std::sync::Once
ONCE_INIT is deprecated, and so suggesting it as not only being on par with, but before `Once::new` is a bad idea.
2019-10-16 00:06:01 -07:00
Linus Färnstrand
b8e7f76181 Remove Error::cause impls equal to deafult impl 2019-10-13 12:30:06 +02:00
Ivan Tham
e2e1175ce2
Update sync condvar doc style 2019-08-31 23:09:37 +08:00
Mark Rousskov
2601c86487 Handle cfg(bootstrap) throughout 2019-08-14 05:39:53 -04:00
bors
18630677cf Auto merge of #62990 - Centril:rollup-k9n0hvs, r=Centril
Rollup of 15 pull requests

Successful merges:

 - #60066 (Stabilize the type_name intrinsic in core::any)
 - #60938 (rustdoc: make #[doc(include)] relative to the containing file)
 - #61884 (Stablize Euclidean Modulo (feature euclidean_division))
 - #61890 (Fix some sanity checks)
 - #62528 (Add joining slices of slices with a slice separator, not just a single item)
 - #62707 (Add tests for overlapping explicitly dropped locals in generators)
 - #62735 (Turn `#[global_allocator]` into a regular attribute macro)
 - #62822 (Improve some pointer-related documentation)
 - #62887 (Make the parser TokenStream more resilient after mismatched delimiter recovery)
 - #62921 (Add method disambiguation help for trait implementation)
 - #62930 (Add test for #51559)
 - #62942 (Use match ergonomics in Condvar documentation)
 - #62977 (Fix inconsistent highlight blocks.)
 - #62978 (Remove `cfg(bootstrap)` code for array implementations)
 - #62981 (Add note suggesting to borrow a String argument to find)

Failed merges:

 - #62964 (clarify and unify some type test names)

r? @ghost
2019-07-25 22:34:23 +00:00
bors
890881f8f4 Auto merge of #60340 - mgeier:cap-vs-capacity, r=alexcrichton
Rename .cap() methods to .capacity()

As mentioned in #60316, there are a few `.cap()` methods, which seem out-of-place because such methods are called `.capacity()` in the rest of the code.

This PR renames them to `.capacity()` but leaves `RawVec::cap()` in there for backwards compatibility.

I didn't try to mark the old version as "deprecated", because I guess this would cause too much noise.
2019-07-25 18:45:42 +00:00
Kevin W Matthews
c0918183a7 Use match ergonomics in Condvar documentation 2019-07-24 09:36:49 -07:00
Ralf Jung
7c1e405478 ONCE_INIT is deprecated-in-future only for bootstrap 2019-07-19 09:48:06 +02:00
Ralf Jung
33452b0587 warn about deprecated-in-future in most of libstd 2019-07-19 09:35:32 +02:00
Mazdak Farrokhzad
0f92eb8a4a
Rollup merge of #62123 - jeremystucki:needless_lifetimes_std, r=alexcrichton
Remove needless lifetimes (std)

Split from #62039
2019-07-05 13:52:58 +02:00
Chris Gregory
636f5e6d11 Convert more usages over 2019-07-01 20:21:12 -07:00
Jeremy Stucki
47ea8ae022
Remove needless lifetimes 2019-07-01 12:15:27 +02:00
Steven Fackler
72e99f57c5 Deprecate ONCE_INIT
Once::new() has been a stable const fn for a while now.

Closes #61746
2019-06-12 21:32:51 -07:00
Mazdak Farrokhzad
a34dae3587
Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPC
Fix intra-doc link resolution failure on re-exporting libstd

Currently, re-exporting libstd items as below will [occur a lot of failures](https://gist.github.com/taiki-e/e33e0e8631ef47f65a74a3b69f456366).
```rust
pub use std::*;
```

Until the underlying issue (#56922) fixed, we can fix that so they don't propagate to downstream crates.

Related: https://github.com/rust-lang/rust/pull/56941 (That PR fixed failures that occur when re-exporting from libcore to libstd.)

r? @QuietMisdreavus
2019-05-20 23:02:59 +02:00
Josh Stone
f950193d74 Remove the unstable and deprecated mpsc_select
This removes macro `select!` and `std::sync::mpsc::{Handle, Select}`,
which were all unstable and have been deprecated since 1.32.
2019-05-17 12:16:52 -07:00
Taiki Endo
ccb9dac5ed Fix intra-doc link resolution failure on re-exporting libstd 2019-05-04 23:48:57 +09:00
Matthias Geier
0967d28be7 Rename .cap() methods to .capacity()
... but leave the old names in there for backwards compatibility.
2019-04-27 22:43:10 +02:00
varkor
aa388f1d11 ignore-tidy-filelength on all files with greater than 3000 lines 2019-04-25 21:39:09 +01:00
Alex Gaynor
ce5d69480a Add must_use annotations to Result::is_ok and is_err 2019-04-08 12:58:09 -04:00
Mazdak Farrokhzad
379c380a60 libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
Jethro Beekman
f229422cc1 SGX target: fix std unit tests 2019-03-25 11:31:19 -07:00
Alexander Regueiro
d4b2071b1f Resolved nits raised in review. 2019-03-11 15:54:57 +00:00
Alexander Regueiro
8629fd3e4e Improvements to comments in libstd, libcore, liballoc. 2019-03-11 02:25:44 +00:00
Taiki Endo
93b6d9e086 libstd => 2018 2019-02-28 04:06:15 +09:00
kennytm
e3a8f7db47
Rollup merge of #58553 - scottmcm:more-ihle, r=Centril
Use more impl header lifetime elision

Inspired by seeing explicit lifetimes on these two:

- https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator
- https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not

And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore.

Most of the changes in here fall into two big categories:

- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`)

- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)

I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm).

I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
2019-02-20 11:59:10 +08:00