about summary refs log tree commit diff
path: root/src/libcore/cell.rs
AgeCommit message (Collapse)AuthorLines
2019-04-11Auto merge of #59211 - nox:refcell-borrow-state, r=KodrAusbors-0/+38
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-03-31Rollup merge of #59581 - jmcomets:stabilize-refcell_replace_swap, r=CentrilMazdak Farrokhzad-4/+1
Stabilize refcell_replace_swap feature Please be kind, this is my first time contributing. :smile: 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-31refcell_replace_swap: remove feature gate & obsolete documentation itemJean-Marie Comets-2/+0
2019-03-31Stabilize refcell_replace_swap feature, closes #43570Jean-Marie Comets-2/+1
2019-03-30Fix doc testsFabian Drinck-1/+0
2019-03-19Introduce RefCell::try_borrow_unguardedAnthony Ramine-49/+38
This replaces RefCell::borrow_state to something that encodes the use case of Servo better.
2019-03-18Stabilize refcell_map_split featureJoshua Liebow-Feeser-4/+2
- Closes #51476
2019-03-16Tweak documentation of RefCell::borrow_stateAnthony Ramine-6/+10
2019-03-15Revert "Deprecate std::cell::RefCell::borrow_state"Anthony Ramine-4/+0
This reverts commit dc2d5058e999abb18ab2686b4e3e385ec6e36666.
2019-03-15Revert "Remove RefCell::borrow_state"Anthony Ramine-0/+49
This reverts commit 313aab8fbeb98730f8ffa741ccf54f843d5e3525.
2019-02-10libs: doc commentsAlexander Regueiro-4/+4
2019-02-10tests: doc commentsAlexander Regueiro-4/+4
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2
2018-11-17add comment explaining why what we do is legalRalf Jung-0/+2
2018-11-16avoid shared ref in UnsafeCell::getRalf Jung-1/+1
2018-11-10revert making internal APIs const fn.Mazdak Farrokhzad-2/+2
2018-11-10constify parts of libcore.Mazdak Farrokhzad-4/+4
2018-10-26Slight copy-editing for `std::cell::Cell` docsGeoffry Song-4/+5
Hopefully this is a bit more precise and also more correct English.
2018-09-29Use impl_header_lifetime_elision in libcoreScott McMurray-9/+9
2018-08-04Remove redundant field names in structsljedrz-3/+3
2018-07-25Enforce #![deny(bare_trait_objects)] in src/libcoreljedrz-3/+3
2018-07-23use inherent method insteadF001-12/+20
2018-07-18revert DerefF001-17/+9
2018-07-17impl DerefMut for Cell<[T]>F001-0/+10
2018-07-17code style fixesF001-2/+4
2018-07-17impl `Deref` instead of `Index`F001-10/+8
2018-07-17use lifetime elision for consistencyF001-1/+1
2018-07-17remove "get_with" methodF001-24/+2
2018-07-17implement rfc 1789F001-44/+103
2018-07-04Auto merge of #51395 - SimonSapin:repr-transparent, r=SimonSapinbors-0/+2
Add #[repr(transparent)] to some libcore types * `UnsafeCell` * `Cell` * `NonZero*` * `NonNull` * `Unique` CC https://github.com/rust-lang/rust/issues/43036
2018-06-27Optimize RefCell refcount trackingJoshua Liebow-Feeser-30/+36
2018-06-16Add #[repr(transparent)] to some libcore typesSimon Sapin-0/+2
* `UnsafeCell` * `Cell` * `NonZero*` * `NonNull` * `Unique`
2018-06-13Add Ref/RefMut map_split methodJoshua Liebow-Feeser-19/+126
2018-05-23Rollup merge of #50913 - d-e-s-o:fix-typo, r=joshtriplettkennytm-1/+1
Fix typo in cell.rs
2018-05-19Fix typo in cell.rsDaniel Mueller-1/+1
2018-05-19UnsafeCell doc typos and minor flow improvementsJake Goulding-13/+14
2018-04-23Assign the tracking issueStjepan Glavina-1/+1
2018-04-23Clarify the docs for Cell::updateStjepan Glavina-2/+3
2018-04-06Fix the failing testsStjepan Glavina-0/+2
2018-04-06Change TODO to FIXMEStjepan Glavina-1/+1
2018-04-06Add Cell::updateStjepan Glavina-0/+24
2018-03-17Remove deprecated unstable ptr::Shared type alias.Simon Sapin-3/+2
It has been deprecated for about one release cycle.
2018-03-13Rollup merge of #48201 - NovemberZulu:master, r=steveklabnikkennytm-15/+36
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-08and again :(Maxim Nazarenko-3/+3
2018-03-08tidy. AgainMaxim Nazarenko-2/+2
2018-03-08another rewriteMaxim Nazarenko-15/+31
based on @nikomatsakis texthg
2018-03-06Rollup merge of #48474 - christianpoveda:new_cell_docs, r=steveklabnikkennytm-0/+18
New Cell docs This fixes https://github.com/rust-lang/rust/issues/44061
2018-02-27and some more tidy checksMaxim Nazarenko-2/+2
2018-02-27fix tidy checksMaxim Nazarenko-3/+3