about summary refs log tree commit diff
path: root/src/libcore/cell.rs
AgeCommit message (Collapse)AuthorLines
2014-05-25Paper over privacy issues with Deref by changing field names.Huon Wilson-14/+18
Types that implement Deref can cause weird error messages due to their private fields conflicting with a field of the type they deref to, e.g., previously struct Foo { x: int } let a: Arc<Foo> = ...; println!("{}", a.x); would complain the the `x` field of `Arc` was private (since Arc has a private field called `x`) rather than just ignoring it. This patch doesn't fix that issue, but does mean one would have to write `a._ptr` to hit the same error message, which seems far less common. (This patch `_`-prefixes all private fields of `Deref`-implementing types.) cc #12808
2014-05-23auto merge of #14359 : brson/rust/minordoc, r=alexcrichtonbors-2/+1
2014-05-23Minor library doc copyeditingBrian Anderson-2/+1
2014-05-22auto merge of #14357 : huonw/rust/spelling, r=pnkfelixbors-2/+2
The span on a inner doc-comment would point to the next token, e.g. the span for the `a` line points to the `b` line, and the span of `b` points to the `fn`. ```rust //! a //! b fn bar() {} ```
2014-05-22libcore: Remove all uses of `~str` from `libcore`.Patrick Walton-2/+3
[breaking-change]
2014-05-22Spelling/doc formatting fixes.Huon Wilson-2/+2
2014-05-20Address review commentsBrian Anderson-4/+4
2014-05-20core: Convert TODOs to FIXMEsBrian Anderson-4/+4
2014-05-20core: Improve docs for cellBrian Anderson-1/+151
2014-05-15core: Update all tests for fmt movementAlex Crichton-1/+1
2014-05-15Implement cell::clone_refKeegan McAllister-0/+34
Per discussion with @alexcrichton, this is a free function.
2014-05-07std: Small doc tweaksBrian Anderson-1/+1
2014-05-07core: Get coretest workingAlex Crichton-7/+7
This mostly involved frobbing imports between realstd, realcore, and the core being test. Some of the imports are a little counterintuitive, but it mainly focuses around libcore's types not implementing Show while libstd's types implement Show.
2014-05-07core: Inherit the cell moduleAlex Crichton-0/+310
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-136/+0
This only changes the directory names; it does not change the "real" metadata names.
2013-05-19Use assert_eq! rather than assert! where possibleCorey Richardson-2/+2
2013-05-15rc: fix testsDaniel Micay-0/+7
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-2/+2
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-12librustc: Make `self` and `static` into keywordsPatrick Walton-6/+6
2013-05-10Stop using the '<->' operatorAlex Crichton-3/+2
2013-05-07auto merge of #6251 : thestinger/rust/non_owned, r=pcwaltonbors-0/+1
Also fixed the docstring on `TC_ONCE_CLOSURE` (was accidentally the same as `TC_MUTABLE`) and shifted the `TC_EMPTY_ENUM` bit left by one since whatever previously used that bit has been removed.
2013-05-05mark Cell as non-Const with #[mutable]Daniel Micay-0/+1
2013-04-30allover: numerous unused muts etcNiko Matsakis-2/+2
2013-04-22auto merge of #5966 : alexcrichton/rust/issue-3083, r=graydonbors-1/+1
Closes #3083. This takes a similar approach to #5797 where a set is present on the `tcx` of used mutable definitions. Everything is by default warned about, and analyses must explicitly add mutable definitions to this set so they're not warned about. Most of this was pretty straightforward, although there was one caveat that I ran into when implementing it. Apparently when the old modes are used (or maybe `legacy_modes`, I'm not sure) some different code paths are taken to cause spurious warnings to be issued which shouldn't be issued. I'm not really sure how modes even worked, so I was having a lot of trouble tracking this down. I figured that because they're a legacy thing that I'd just de-mode the compiler so that the warnings wouldn't be a problem anymore (or at least for the compiler). Other than that, the entire compiler compiles without warnings of unused mutable variables. To prevent bad warnings, #5965 should be landed (which in turn is waiting on #5963) before landing this. I figured I'd stick it out for review anyway though.
2013-04-22cell: public field is unsafeDaniel Micay-1/+1
use core::cell; fn main() { let x = cell::Cell(Some(~"foo")); let y = x.value.get_ref().get_ref(); do x.with_mut_ref |z| { *z = None; } println(*y) // boom! }
2013-04-20core: remove unused 'mut' variablesAlex Crichton-1/+1
2013-04-04Add cell#with_mut_ref for handling mutable references to the content.Jack Moffitt-0/+26
2013-04-03Removing mut fields from vec.rs, at_vec.rs, str.rs, unstable.rs, and cell.rs.Matthijs Hofstra-7/+5
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-4/+4
2013-03-26option: rm functions that duplicate methodsDaniel Micay-2/+1
2013-03-26core: Make sure every module at least has a one-line descriptionBrian Anderson-3/+7
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-4/+4
2013-03-18librustc: Make the compiler ignore purity.Patrick Walton-1/+12
For bootstrapping purposes, this commit does not remove all uses of the keyword "pure" -- doing so would cause the compiler to no longer bootstrap due to some syntax extensions ("deriving" in particular). Instead, it makes the compiler ignore "pure". Post-snapshot, we can remove "pure" from the language. There are quite a few (~100) borrow check errors that were essentially all the result of mutable fields or partial borrows of `@mut`. Per discussions with Niko I think we want to allow partial borrows of `@mut` but detect obvious footguns. We should also improve the error message when `@mut` is erroneously reborrowed.
2013-03-11Add deriving_eq to Cell.Josh Matthews-0/+1
2013-03-11librustc: Replace all uses of `fn()` with `&fn()`. rs=defunPatrick Walton-1/+1
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-4/+4
2013-03-04De-implicit-self libcoreBen Striegel-4/+4
2013-02-28librustc: Mark all type implementations public. rs=impl-publicityPatrick Walton-1/+1
2013-02-26libcore: Move Cell to core and de-~mut core and stdPatrick Walton-0/+90