| Age | Commit message (Collapse) | Author | Lines |
|
|
|
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.
|
|
This is part of the numeric trait reform tracked on issue #4819
|
|
Also fix up all the fallout elsewhere throughout core. It's really nice being
able to have the prelude.
I'm not quite sure how resolution works with traits, but it seems to me like the public imports at the top-level of the core crate were leaking into the sub-crates, but that could also be working as intended. Regardless, things compile without the re-exports now.
|
|
|
|
|
|
- vec.rs :add 'each2_mut function'
- testsuit : run-pass/vec-each2_mut.rs
|
|
Also fix up all the fallout elsewhere throughout core. It's really nice being
able to have the prelude.
|
|
r? @pcwalton
* Move `SharedMutableState`, `LittleLock`, and `Exclusive` from `core::unstable` to `core::unstable::sync`
* Modernize the `SharedMutableState` interface with methods
* Rename `SharedMutableState` to `UnsafeAtomicRcBox` to match `RcBox`.
|
|
r? @graydon
|
|
|
|
|
|
|
|
|
|
This pull request adds 4 atomic intrinsics to the compiler, in preparation for #5042.
* `atomic_load(src: &int) -> int` performs an atomic sequentially consistent load.
* `atomic_load_acq(src: &int) -> int` performs an atomic acquiring load.
* `atomic_store(dst: &mut int, val: int)` performs an atomic sequentially consistent store.
* `atomic_store_rel(dst: &mut int, val: int)` performs an atomic releasing store.
For more information about the whole acquire/release thing: http://llvm.org/docs/Atomics.html
r?
|
|
|
|
|
|
|
|
literals (possibly with a minus).
This had very minimal fallout.
|
|
|
|
|
|
In this commit I added a useful utility type, named Void, that encapsulates the
doable but annoying job of creating an uninhabited type. As well, a function on
that type, named absurd, was created which is useful for ignoring the result of
matching on that type. No unit tests were created because it is not possible to
create an instance of this type to test the usage of.
This type is useful because it is like NonCopyable in that it can be used to
create a type with special characteristics without special bloat. For instance,
instead of typing pub struct PhantomType { priv contents : () } for each void
type one may want to use one can simply type pub struct PhantomType (Void);.
This type make such special cases much easier to write.
|
|
|
|
|
|
intrinsics.
The default versions (atomic_load and atomic_store) are sequentially consistent.
The atomic_load_acq intrinsic acquires as described in [1].
The atomic_store_rel intrinsic releases as described in [1].
[1]: http://llvm.org/docs/Atomics.html
|
|
Implemented to_str() for HashMap and HashSet
Added tests.
Minor formatting and stylistic cleanups.
|
|
All tests pass now.
|
|
Just cleaning up warnings.
|
|
|
|
|
|
|
|
|
|
|
|
Fix for #3356
|
|
All tests now pass.
|
|
Also added some whitespace to enhance readabilty.
|
|
|
|
|
|
1. Extra space removed.
2. Using acc.push_str() instead of str::push_str
3. Update test to reflect representation change.
|
|
doesn't need to be mutable.
|
|
|
|
There may be a more efficient implementation of `core::util::swap_ptr`. The issue mentioned using `move_val_init`, but I couldn't figure out what that did, so I just used `copy_memory` a few times instead.
I'm not exactly the best at reading LLVM generated by rust, but this does appear to be optimized away just as expected (when possible).
|
|
|
|
|
|
r? @graydon
I don't think this is necessary in core.
|
|
Closes #6183.
The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout.
The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
|
|
|
|
|
|
|
|
|