Skip to content

Allow rvalues to be borrowed mutably - #6472

Closed
nikomatsakis wants to merge 561 commits into
rust-lang:masterfrom
nikomatsakis:issue-5967-rvalue-immutability
Closed

Allow rvalues to be borrowed mutably#6472
nikomatsakis wants to merge 561 commits into
rust-lang:masterfrom
nikomatsakis:issue-5967-rvalue-immutability

Conversation

@nikomatsakis

Copy link
Copy Markdown
Contributor

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

yichoiand 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.
Fixesrust-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
Closesrust-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.
emberianand others added 27 commits May 13, 2013 01:06
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 fixesrust-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
Copy Markdown
ContributorAuthor

reissued

U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
6472: Add `static` modifier for associated functions r=matklad a=p3achyjr
Adds static semantic token modifier to associated functions, resolvesrust-lang#6194 ## Info
- Associated functions are more-or-less equivalent to static methods in other languages. This PR checks, for each function, whether that function has a self_param, and whether it's enclosed in a trait/impl.
## Changes
- Added method ```is_associated``` to code_model::Function. This basically gets the source from the ast, and checks whether the enclosing scope is an impl or trait.
- Added `static` to HighlightModifiers
- Added unit test
## Tests
- Ran ```cargo test```
Co-authored-by: Anatol Liu <axlui@anatols-mbp.lan>
Sign up for freeto 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.

20 participants

@nikomatsakis@graydon@brson@bors@yichoi@sammykim@brendanzab@sanxiyn@thestinger@indutny@ILyoan@z0w0@huonw@seanmoon@pcwalton@vibe-vacation@crabtw@alexcrichton@dotdash@catamorphism