Commit graph

474 commits

Author SHA1 Message Date
Corey Farwell
eb48ee72db Rewrite Receiver::try_iter doc example to show resulting values. 2017-06-02 00:21:32 -04:00
Corey Farwell
d3f3e26db0 Rewrite Receiver::iter doc example to show resulting values. 2017-06-02 00:21:27 -04:00
bors
4ed2edaafe Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakis
Decompose Adjustment into smaller steps and remove the method map.

The method map held method callee information for:
* actual method calls (`x.f(...)`)
* overloaded unary, binary, indexing and call operators
* *every overloaded deref adjustment* (many can exist for each expression)

That last one was a historical ~~accident~~ hack, and part of the motivation for this PR, along with:
* a desire to compose adjustments more freely
* containing the autoderef logic better to avoid mutation within an inference snapshot
* not creating `TyFnDef` types which are incompatible with the original one
  * i.e. we used to take a`TyFnDef`'s `for<'a> &'a T -> &'a U` signature and instantiate `'a` using a region inference variable, *then* package the resulting `&'b T -> &'b U` signature in another `TyFnDef`, while keeping *the same* `DefId` and `Substs`
* to fix #3548 by explicitly writing autorefs for the RHS of comparison operators

Individual commits tell their own story, of "atomic" changes avoiding breaking semantics.

Future work based on this PR could include:
* removing the signature from `TyFnDef`, now that it's always "canonical"
  * some questions of variance remain, as subtyping *still* treats the signature differently
* moving part of the typeck logic for methods, autoderef and coercion into `rustc::traits`
* allowing LUB coercions (joining multiple expressions) to "stack up" many adjustments
* transitive coercions (e.g. reify or unsize after multiple steps of autoderef)

r? @nikomatsakis
2017-06-01 11:34:13 +00:00
Eduard-Mihai Burtescu
58632f3c1c tests: fix fallout from empowering unused_allocation in comparisons. 2017-06-01 08:59:47 +03:00
Corey Farwell
bcd1fe56c7 Rewrite doc examples for Receiver::recv_timeout. 2017-05-31 23:01:55 -04:00
Dmitry Vyukov
0b85b64d6b libstd/sync/mpsc: relicense under rust license
These files are licensed under a different license
than the rest of the codebase. This causes potential
issues and inconveniences.
Relicense these files under the standard license.
I hold original copyright on that code.

Fixes #36556
2017-05-22 09:27:39 +02:00
bors
272e77f035 Auto merge of #42111 - ollie27:stab, r=Mark-Simulacrum
Correct some stability versions

These were found by running tidy on stable versions of rust and finding
features stabilised with the wrong version numbers.
2017-05-20 15:42:43 +00:00
Oliver Middleton
2f703e4304 Correct some stability versions
These were found by running tidy on stable versions of rust and finding
features stabilised with the wrong version numbers.
2017-05-20 08:38:39 +01:00
Denis Andrejew
f4e33a011e fix typo in libstd/sync/mpsc/mod.rs docs 2017-05-18 08:45:18 +02:00
Ralf Jung
23522f6cab need to pick a new feature name 2017-04-29 19:15:59 +02:00
Ralf Jung
998a877737 MutexGuard<T> may be Sync only if T is Sync
Also remove some unnecessary unsafe impl from the tests.
2017-04-29 09:44:09 +02:00
projektir
c59b188aae Adding links and examples for various mspc pages #29377 2017-04-26 23:11:57 -04:00
Guillaume Gomez
d79b511f5c Fix invalid linkage 2017-04-22 13:25:14 +02:00
bors
2bdf368bde Auto merge of #41103 - projektir:channel_error_docs, r=GuillaumeGomez
Channel error docs

r? @steveklabnik

I'm going to need some help on this one, a few ambiguities.
2017-04-10 09:45:16 +00:00
Geoffry Song
3d60bf45f4 Minor fix to mutex example
Presumably `N` was supposed to be used in both places.
2017-04-09 19:42:01 -04:00
projektir
28a232a59a Adding links around Sender/SyncSender/Receiver errors; Adding more documentation to channel() and sync_channel(); adding more links #29377 2017-04-08 15:33:21 -04:00
Corey Farwell
b0aefe31f4 Rollup merge of #40981 - Technius:master, r=steveklabnik
Add links and some examples to std::sync::mpsc docs

Addresses part of #29377
r? @steveklabnik

I took a stab at adding links to the `std::sync::mpsc` docs, and I also wrote a few examples.

Edit: Whoops, typed in `?r` instead of `r?`.
2017-04-05 12:44:27 -04:00
Corey Farwell
1a9f415bfb Rollup merge of #40977 - projektir:BarrierWaitResult_doc, r=steveklabnik
Updating the description for BarrierWaitResult #29377

Referencing `Barrier`, removing reference to `is_leader`.
2017-04-05 12:44:26 -04:00
Corey Farwell
ca37f1ad17 Rollup merge of #40608 - GuillaumeGomez:mutex-doc-inconsistency, r=steveklabnik
Fix mutex's docs inconsistency

Fixes #40176.

r? @steveklabnik
cc @rust-lang/docs
2017-04-05 12:44:24 -04:00
Bryan Tan
ab4f4428e7 Fix styling issues 2017-04-03 16:09:19 -07:00
Guillaume Gomez
e7c2160f8a Fix mutex's docs inconsistency 2017-04-03 18:57:13 +02:00
Bryan Tan
dab8e8121f Fix warnings in examples 2017-03-31 23:22:59 -07:00
Bryan Tan
ae8ba78e9d Fix broken links to std::iter::Iterator::next 2017-03-31 18:51:37 -07:00
Bryan Tan
89c35ae764 Add links and examples to std::sync::mpsc docs (#29377)
This change adds links to to `Receiver`, `Iter`, `TryIter`, `IntoIter`,
`Sender`, `SyncSender`, `SendError`, `RecvError`, `TryRecvError`,
`RecvTimeoutError`, `TrySendError`, `Sender::send`, `SyncSender::send`,
`SyncSender::try_send`, `Receiver::recv`, `Receiver::recv_timeout`,
`Receiver::iter`, and `Receiver::try_iter`.

Examples added to `Receiver`, `Sender`, `Receiver::iter`.
2017-03-31 17:07:01 -07:00
projektir
44d8b236f4 Updating the description for BarrierWaitResult #29377 2017-03-31 18:58:32 -04:00
Bryan Tan
5a6ebdfcda Add links to std::sync::mpsc docs #29377 2017-03-30 23:28:15 -07:00
projektir
3207657d12 Adding linking for Once docs #29377 2017-03-29 00:21:55 -04:00
Corey Farwell
d8c8e01038 Rollup merge of #40611 - ScottAbbey:patch-1, r=GuillaumeGomez
Fix typo in mutex.rs docs

This seems to match other uses of "be accessed" in the document.
2017-03-19 10:18:20 -04:00
ScottAbbey
ec8ecf4f9d Fix typo in mutex.rs docs
This seems to match other uses of "be accessed" in the document.
2017-03-17 13:27:13 -05:00
Corey Farwell
e7b0f2badf Remove function invokation parens from documentation links.
This was never established as a convention we should follow in the 'More
API Documentation Conventions' RFC:

https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-03-13 21:43:18 -04:00
Corey Farwell
5be0d9ff04 Rollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcv
Add missing urls and examples for Condvar docs

r? @frewsxcv
2017-02-28 08:33:01 -05:00
Guillaume Gomez
802a502ebd Rollup merge of #40052 - GuillaumeGomez:sunc_docs, r=frewsxcv
Add missing urls in MutexGuard docs

r? @frewsxcv
2017-02-24 13:23:00 +01:00
Guillaume Gomez
088b727456 Add missing urls in MutexGuard docs 2017-02-23 11:43:30 +01:00
Guillaume Gomez
d3b8f56ae7 Add missing urls and examples for Condvar docs 2017-02-23 11:38:05 +01:00
Guillaume Gomez
58a9dd3f7e Add missing urls and examples into Barrier structs 2017-02-21 21:12:35 +01:00
Stjepan Glavina
1fbbe79bcb Fix wording in LocalKey documentation 2017-02-15 23:31:51 +01:00
Corey Farwell
65b24779a9 Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichton
Fix a few impl stability attributes

The versions show up in rustdoc.
2017-02-05 09:14:45 -05:00
Son
3c020df3e9 tiny doc wording change 2017-02-04 00:16:56 +11:00
Oliver Middleton
9128f6100c Fix a few impl stability attributes
The versions show up in rustdoc.
2017-01-29 13:31:47 +00:00
Guillaume Gomez
346c84fb0b Add missing doc examples for Mutex 2017-01-10 20:58:17 +01:00
Andrew Paseltiner
ca9b07bbc9
Replace uses of #[unsafe_destructor_blind_to_params] with #[may_dangle]
CC #34761
2016-12-28 17:47:10 -05:00
Alex Crichton
68dd6fd964 Rollup merge of #38006 - frewsxcv:libstd-debug, r=alexcrichton
Implement `fmt::Debug` for all structures in libstd.

Part of https://github.com/rust-lang/rust/issues/31869.

Also turn on the `missing_debug_implementations` lint at the crate
level.
2016-12-20 11:16:17 -08:00
Seo Sanghyeon
4b5cffc04b Rollup merge of #38421 - apasel422:issue-36934, r=alexcrichton
Replace invalid use of `&mut` with `UnsafeCell` in `std::sync::mpsc`

Closes #36934

r? @alexcrichton
2016-12-19 16:59:38 +09:00
Corey Farwell
86fc63e62d Implement fmt::Debug for all structures in libstd.
Part of https://github.com/rust-lang/rust/issues/31869.

Also turn on the `missing_debug_implementations` lint at the crate
level.
2016-12-18 14:55:14 -08:00
Andrew Paseltiner
26d4308c6a
Replace invalid use of &mut with UnsafeCell in std::sync::mpsc
Closes #36934
2016-12-16 19:52:12 -05:00
Aaron Turon
9e8fd24383 Stabilize std::sync::mpsc::Receiver::try_iter 2016-12-15 10:56:55 -08:00
Cobrand
57f998a460 Improve and fix mpsc documentation
Closes #37915

This commit enhances documentation with several links and
fixes an error in the `sync_channel` documentation as well:
`send` doesn't panic when the senders are all disconnected
2016-12-07 18:57:01 +01:00
Seo Sanghyeon
44b926a6bb Rollup merge of #38010 - frewsxcv:lock-creations, r=GuillaumeGomez
Document how lock 'guard' structures are created.
2016-11-26 22:02:15 +09:00
Corey Farwell
6075af4ac0 Document how the MutexGuard structure is created.
Also, end sentence with a period.
2016-11-25 19:08:26 -05:00
Corey Farwell
6b4de8bf91 Document how the RwLockWriteGuard structure is created. 2016-11-25 18:57:11 -05:00