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
Scott McMurray
3bea2ca49d
Use more impl header lifetime elision
...
There are two big categories of changes in here
- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`)
- 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.
2019-02-17 19:42:36 -08:00
bors
b244f61b77
Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
...
Cosmetic improvements to doc comments
This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).
r? @steveklabnik
Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
Oliver Scherer
1dba7cb202
Fiddle through the module visibilities for tests
2019-02-11 15:08:17 +01:00
Oliver Scherer
a83e73dce4
Move out tests of a deprecated module to work around #[test] bugs
...
https://github.com/rust-lang/rust/issues/47238
2019-02-11 15:08:17 +01:00
Alexander Regueiro
99ed06eb88
libs: doc comments
2019-02-10 23:57:25 +00:00
Alexander Regueiro
b87363e763
tests: doc comments
2019-02-10 23:42:32 +00:00
Mara Bos
2e9deed9f1
Simplify Debug implementation of MutexGuard.
...
Just transparently print the guarded data, instead of wrapping it in
`MutexGuard { lock: Mutex { data: ... } }`.
2019-01-17 20:03:59 +01:00
Mara Bos
7b55711988
Make MutexGuard's Debug implementation more useful.
...
Fixes #57702 .
2019-01-17 19:00:48 +01:00
bors
96530344ef
Auto merge of #56827 - faern:eliminate-recv-timeout-panic, r=KodrAus
...
Eliminate Receiver::recv_timeout panic
Fixes #54552 .
This panic is because `recv_timeout` uses `Instant::now() + timeout` internally. This possible panic is not mentioned in the documentation for this method.
Very recently we merged (still unstable) support for checked addition (#56490 ) of `Instant + Duration`, so it's now finally possible to add these together without risking a panic.
2019-01-02 02:03:15 +00:00
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Linus Färnstrand
018f8a027d
Use checked_add for adding time in recv_timeout
2018-12-14 21:43:52 +01:00
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
Benoît C
c1221e2072
Replace data.clone() by Arc::clone(&data) in mutex doc.
...
Arc::clone(&from) is considered as more idiomatic because it conveys more explicitly the meaning of the code.
2018-11-16 15:34:12 -05:00
Stjepan Glavina
d75dae3069
Deprecate channel selection
2018-11-08 22:51:46 +01:00
kennytm
9d9146ad95
Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwco
...
refactor: use shorthand fields
refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-07 21:27:00 +08:00
teresy
eca11b99a7
refactor: use shorthand fields
2018-11-06 15:05:44 -05:00
Matthias Krüger
4972beaf65
fix typos in various places
2018-10-23 15:56:25 +02:00
Simon Sapin
9a9894a8f1
Fix tracking issue for Once::is_completed
2018-10-07 12:00:41 +02:00
Pietro Albini
6b24de1edd
Rollup merge of #54078 - GabrielMajeri:expand-sync-docs, r=steveklabnik
...
Expand the documentation for the `std::sync` module
I've tried to expand the documentation for Rust's synchronization primitives. The module level documentation explains why synchronization is required when working with a multiprocessor system,
and then links to the appropiate structure in this module.
Fixes #29377 , since this should be the last item on the checklist (documentation for `Atomic*` was fixed in #44854 , but not ticked off the checklist).
2018-10-05 22:33:10 +02:00
Gabriel Majeri
6ba5584712
Address review comments
2018-10-05 08:50:17 +03:00
Aleksey Kladov
f8e9d2f0ec
Fix Once perf regression
...
Because `call_once` is generic, but `is_completed` is not, we need
`#[inline]` annotation to allow LLVM to inline `is_completed` into
`call_once` in downstream crates.
2018-09-29 11:07:48 +03:00
Gabriel Majeri
7e921aa590
Rewrite section on concurrency
2018-09-28 12:03:40 +03:00
Gabriel Majeri
bcec6bb525
Fix broken links
2018-09-28 12:03:33 +03:00
Gabriel Majeri
f3fdbbfae8
Address review comments
...
Reword the lead paragraph and turn the list items into
complete sentences.
2018-09-27 20:25:04 +03:00
Gabriel Majeri
e0df0ae734
Make example code use global variables
...
Because `fn main()` was added automatically, the variables
were actually local statics.
2018-09-27 20:13:33 +03:00
Gabriel Majeri
f5e991bee0
Expand the documentation for the std::sync module
...
Provides an overview on why synchronization is required,
as well a short summary of what sync primitives are available.
2018-09-27 20:13:32 +03:00
Guillaume Gomez
c1ad1b0338
Fix invalid urls
2018-09-06 23:32:30 +02:00
bors
0be2c30369
Auto merge of #53075 - Mark-Simulacrum:update-cargolock, r=alexcrichton
...
Update Cargo.lock
This also includes major version bumps for the rand crate used by core, std, and alloc tests, among other crates (regex, etc.) used elsewhere. Since these are all internal there should be no user-visible changes.
r? @alexcrichton
2018-09-05 03:04:20 +00:00
bors
f68b7cc598
Auto merge of #53027 - matklad:once_is_completed, r=alexcrichton
...
Allow to check if sync::Once is already initialized
Hi!
I propose to expose a way to check if a `Once` instance is initialized.
I need it in `once_cell`. `OnceCell` is effetively a pair of `(Once, UnsafeCell<Option<T>>)`, which can set the `T` only once. Because I can't check if `Once` is initialized, I am forced to add an indirection and check the value of ptr instead:
https://github.com/matklad/once_cell/blob/8127a81976c3f2f4c0860562c3f14647ebc025c0/src/lib.rs#L423-L429
https://github.com/matklad/once_cell/blob/8127a81976c3f2f4c0860562c3f14647ebc025c0/src/lib.rs#L457-L461
The `parking_lot`'s version of `Once` exposes the state as an enum: https://docs.rs/parking_lot/0.6.3/parking_lot/struct.Once.html#method.state .
I suggest, for now, just to add a simple `bool` function: this fits my use-case perfectly, exposes less implementation details, and is forward-compatible with more fine-grained state checking.
2018-09-05 00:37:03 +00:00
Mark Rousskov
9ec5ef541a
Breaking change upgrades
2018-09-04 13:22:08 -06:00
Matthias Krüger
71120ef1e5
Fix typos found by codespell.
2018-08-19 17:41:28 +02:00
bors
5bb2094d89
Auto merge of #52936 - felixrabe:patch-1, r=alexcrichton
...
Document #39364 – Panic in mpsc::Receiver::recv_timeout
I can still reproduce #39364 with the example code at https://github.com/rust-lang/rust/issues/39364#issuecomment-320637702 .
I'm opening this PR in an attempt to document this bug as a known issue in [libstd/sync/mpsc/mod.rs](https://github.com/rust-lang/rust/blob/master/src/libstd/sync/mpsc/mod.rs ).
Inputs very much welcome. ([Nightly docs for `recv_timeout`.](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Receiver.html?search=#method.recv_timeout ))
2018-08-14 22:22:18 +00:00
Aleksey Kladov
e1bd0e7b4e
Reduce code duplication in Once
2018-08-09 20:50:43 +03:00
Felix Rabe
025f41f4c0
"Panics" -> "Known Issues"; rm trailing WS
2018-08-07 17:34:34 +02:00
Felix Rabe
6e2051cd08
Less words better than moar words
2018-08-07 16:39:09 +02:00
Felix Rabe
c574720d88
Rephrase
2018-08-07 16:38:02 +02:00
Felix Rabe
b1f47aa838
Document panic in mpsc::Receiver::recv_timeout
2018-08-07 16:35:03 +02:00
Ralf Jung
a92b5cc916
Remove references to StaticMutex which got removed a while ago
2018-08-06 12:34:00 +02:00
Aleksey Kladov
a2f9aaf7a3
Fix trailnig WS
2018-08-03 16:50:30 +03:00
Aleksey Kladov
6aba6f9184
Allow to check if sync::Once is initialized
2018-08-03 15:49:23 +03:00
Aleksey Kladov
94de821002
Specify reentrancy gurantees of Once::call_once
2018-08-03 14:18:06 +03:00
Felix Rabe
c3fdd19e43
Document #39364 (WIP)
2018-08-01 09:42:46 +02:00