Brent Kerby
d3c73ddec9
typo
2019-05-23 19:36:06 -06:00
Brent Kerby
e641fb47c4
Simplify RefCell minimum_spanning_tree example
2019-05-21 21:52:21 -06:00
Mazdak Farrokhzad
dbfbadeac4
libcore: deny more...
2019-04-19 01:37:12 +02:00
Taiki Endo
360432f1e8
libcore => 2018
2019-04-18 14:47:35 +09:00
bors
850912704e
Auto merge of #59211 - nox:refcell-borrow-state, r=KodrAus
...
Introduce RefCell::try_borrow_unguarded
*Come sit next to the fireplace with me, this is going to be a long story.*
So, you may already be aware that Servo has weird design constraints that forces us developers working on it to do weird things. The thing that interests us today is that we do layout on a separate thread with its own thread pool to do some things in parallel, whereas the data it uses comes from the script thread, which implements the entire DOM and related pieces, with `!Sync` data types such as `RefCell<T>`.
The invariant we maintain is that script does not do anything ever with the DOM data as long as layout is doing its job. That's all nice and all, but one thing we don't ensure is that we don't actually know if script was currently mutably borrowing some `RefCell<T>` prior to starting layout, which may lead to aliasing mutable memory and obviously undefined behaviour.
This PR reinstates `RefCell::borrow_state` so that [this method](https://github.com/servo/servo/blob/master/components/script/dom/bindings/cell.rs#L23-L30 ) can make use of it and return `None` if the cell was mutably borrowed.
Cc @SimonSapin
2019-04-11 12:49:49 +00:00
Mazdak Farrokhzad
9d198db339
Rollup merge of #59581 - jmcomets:stabilize-refcell_replace_swap, r=Centril
...
Stabilize refcell_replace_swap feature
Please be kind, this is my first time contributing. 😄
I noticed #43570 only needs stabilizing (and I need it for a side project I'm working on), so I followed the [guide](https://rust-lang.github.io/rustc-guide/stabilization_guide.html#stabilization-pr ) to move things forward.
I'm happy to amend things if needed, let me know!
2019-03-31 19:19:53 +02:00
Jean-Marie Comets
c789a539a2
refcell_replace_swap: remove feature gate & obsolete documentation item
2019-03-31 14:50:06 +02:00
Jean-Marie Comets
70fa616a23
Stabilize refcell_replace_swap feature, closes #43570
2019-03-31 10:54:14 +02:00
Fabian Drinck
8fb0549151
Fix doc tests
2019-03-30 22:37:02 +01:00
Anthony Ramine
38811a1d31
Introduce RefCell::try_borrow_unguarded
...
This replaces RefCell::borrow_state to something that encodes the use
case of Servo better.
2019-03-19 12:24:38 +01:00
Joshua Liebow-Feeser
de4be2cd85
Stabilize refcell_map_split feature
...
- Closes #51476
2019-03-18 15:06:34 -07:00
Anthony Ramine
a9388c28c2
Tweak documentation of RefCell::borrow_state
2019-03-16 12:16:25 +01:00
Anthony Ramine
fab71dd046
Revert "Deprecate std::cell::RefCell::borrow_state"
...
This reverts commit dc2d5058e9 .
2019-03-15 15:01:48 +01:00
Anthony Ramine
1c365cedf8
Revert "Remove RefCell::borrow_state"
...
This reverts commit 313aab8fbe .
2019-03-15 15:01:48 +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
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
Ralf Jung
25d46f3091
add comment explaining why what we do is legal
2018-11-17 10:20:28 +01:00
Ralf Jung
41434e001b
avoid shared ref in UnsafeCell::get
2018-11-16 22:17:26 +01:00
Mazdak Farrokhzad
e15c62d61f
revert making internal APIs const fn.
2018-11-10 01:10:07 +01:00
Mazdak Farrokhzad
5b89877dda
constify parts of libcore.
2018-11-10 01:07:32 +01:00
Geoffry Song
6df57a7d68
Slight copy-editing for std::cell::Cell docs
...
Hopefully this is a bit more precise and also more correct English.
2018-10-26 12:09:41 -07:00
Scott McMurray
0a3bd9b6ab
Use impl_header_lifetime_elision in libcore
2018-09-29 21:33:35 -07:00
ljedrz
d46dca66c9
Remove redundant field names in structs
2018-08-04 14:58:20 +02:00
ljedrz
8646a17143
Enforce #![deny(bare_trait_objects)] in src/libcore
2018-07-25 10:21:41 +09:00
F001
489101cc45
use inherent method instead
2018-07-23 20:58:40 +08:00
F001
8812c6bae9
revert Deref
2018-07-18 12:30:20 +08:00
F001
3eee486e27
impl DerefMut for Cell<[T]>
2018-07-17 11:34:19 +08:00
F001
b1344abc58
code style fixes
2018-07-17 11:34:19 +08:00
F001
bdf86300b4
impl Deref instead of Index
2018-07-17 11:34:19 +08:00
F001
4d99957ce3
use lifetime elision for consistency
2018-07-17 11:34:19 +08:00
F001
4bf8b57950
remove "get_with" method
2018-07-17 11:34:19 +08:00
F001
9928baa786
implement rfc 1789
2018-07-17 11:34:19 +08:00
bors
0ad8f9e5b1
Auto merge of #51395 - SimonSapin:repr-transparent, r=SimonSapin
...
Add #[repr(transparent)] to some libcore types
* `UnsafeCell`
* `Cell`
* `NonZero*`
* `NonNull`
* `Unique`
CC https://github.com/rust-lang/rust/issues/43036
2018-07-04 16:21:42 +00:00
Joshua Liebow-Feeser
851cc39503
Optimize RefCell refcount tracking
2018-06-27 00:07:18 -07:00
Simon Sapin
530d7bc517
Add #[repr(transparent)] to some libcore types
...
* `UnsafeCell`
* `Cell`
* `NonZero*`
* `NonNull`
* `Unique`
2018-06-16 18:25:15 +02:00
Joshua Liebow-Feeser
2a999b4b52
Add Ref/RefMut map_split method
2018-06-13 11:35:39 -07:00
kennytm
e51b35e26f
Rollup merge of #50913 - d-e-s-o:fix-typo, r=joshtriplett
...
Fix typo in cell.rs
2018-05-23 00:26:12 +08:00
Daniel Mueller
e2f0cc084f
Fix typo in cell.rs
2018-05-19 20:40:11 -07:00
Jake Goulding
52249e357d
UnsafeCell doc typos and minor flow improvements
2018-05-19 21:10:24 -04:00
Stjepan Glavina
29e9de85d6
Assign the tracking issue
2018-04-23 20:34:49 +02:00
Stjepan Glavina
1c0db245e0
Clarify the docs for Cell::update
2018-04-23 20:23:04 +02:00
Stjepan Glavina
5dcce51946
Fix the failing tests
2018-04-06 22:45:31 +02:00
Stjepan Glavina
9377340ee3
Change TODO to FIXME
2018-04-06 15:29:10 +02:00
Stjepan Glavina
f86deef5b6
Add Cell::update
2018-04-06 15:15:28 +02:00
Simon Sapin
73c053786d
Remove deprecated unstable ptr::Shared type alias.
...
It has been deprecated for about one release cycle.
2018-03-17 23:59:35 +01:00
kennytm
fdb5181f25
Rollup merge of #48201 - NovemberZulu:master, r=steveklabnik
...
rephrase UnsafeCell doc
As shown by discussions on users.rust-lang.org [[1]], [[2]], UnsafeCell doc is not totally clear. I tried to made the doc univocal regarding what is allowed and what is not. The edits are based on my understanding following [[1]].
[1]: https://users.rust-lang.org/t/unsafecell-behavior-details/1560
[2]: https://users.rust-lang.org/t/is-there-a-better-way-to-overload-index-indexmut-for-a-rc-refcell/15591/12
2018-03-13 00:54:24 +08:00
Maxim Nazarenko
55be283674
and again :(
2018-03-08 23:26:27 +02:00
Maxim Nazarenko
fbcd2f5a6a
tidy. Again
2018-03-08 23:16:31 +02:00