Skip to content

Allow rvalues to be borrowed mutably #6472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

nikomatsakis
Copy link
Contributor

Simpler version of PR #5974 based on the new borrow checker.

yichoi and others added 30 commits May 7, 2013 15:29
…graydon

Fix unintended error problem of:
````
static s: int = 1;
static e: int = 42;

fn main() {
    match 7 {
        s..e => (),
         ^~                 error: expected `=>` but found `..`
        _ => (),
    }
}
````
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.
Both expm1 and ln1p have been renamed to exp_m1 and ln_1p in order to be consistent with the underscore usage elsewhere.

The exp_m1 method is used for increased accuracy when doing floating point calculations, so this has been moved from the more general 'Exponential' trait into 'Float'.
These breakpoints make it difficult to debug coretest
…priv-variants, r=graydon

@brson: r?  [please ignore the other one that was accidentally based off master due to back-button-bugs in github.com]

My goal is to resolve the question of whether we want to encourage (by example) consistent use of pub to make identifiers publicly-accessible, even in syntax extensions. (If people don't want that, then we can just let this pull request die.)

This is part one of two. Part two, whose contents should be clear from the FIXME's in this commit, would land after this gets incorporated into a snapshot.

(The eventual goal is to address issue rust-lang#6009 , which was implied by my choice of branch name, but not mentioned in the pull request, so github did not notice it.)
existing tests. The bug itself was fixed as part of recent borrowck
reform.

Fixes rust-lang#4666.
… r=thestinger

It appears the cause of rust-lang#5517 was fixed in 0dc6c41, so adding a test so the issue can be closed.
…ter-foldl, r=graydon

Closes rust-lang#5311 and rust-lang#4490.

This doesn't change `vec.foldl` because that's still part of `old_iter`, although I could change that as well if necessary.
This is only used on rust_rng, which I am trying to extricate from
the kernel.
bors and others added 28 commits May 12, 2013 21:58
…nger

Instead link against the built libraries and directly invoke those.

Closes rust-lang#5387
When trying to import nonexistent items from existing modules, specify that
that is what happened, rather than just reporting "unresolved name".
This pull request adds 4 atomic intrinsics to the compiler, in preparation for rust-lang#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?
When trying to import nonexistent items from existing modules, specify that
that is what happened, rather than just reporting "unresolved name".

Ideally the error would be reported on the span of the import... but I do not see a way to get a span there. Help appreciated 😄
I changed the dependencies of librust in rust-lang#6438, but I forgot to update the dependencies in the Makefile, this should have the dependencies right now.
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`.
Also fix up all the fallout elsewhere throughout core. It's really nice being
able to have the prelude.
uninit() would result in potentially running a destructor on arbitrary
memory if the Ord implementation throws
- vec.rs :add 'each2_mut function'
- testsuit : run-pass/vec-each2_mut.rs
This includes 26fa6f8 which fixes rust-lang#6258

@ILyoan I ported your patches forward and confirmed that they build but you should be aware of this upgrade.
…pcwalton

uninit() would result in potentially running a destructor on arbitrary
memory if the Ord implementation throws
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.
@nikomatsakis
Copy link
Contributor Author

reissued

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.