about summary refs log tree commit diff
path: root/src/libcore/cell.rs
AgeCommit message (Collapse)AuthorLines
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