| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Emit StorageDead along unwind paths for generators
Completion of the work done in #60840. That PR made a change to implicitly consider a local `StorageDead` after Drop, but that was incorrect for DropAndReplace (see also #61060 which tried to fix this in a different way).
This finally enables the optimization implemented in #60187.
r? @eddyb
cc @Zoxc @cramertj @RalfJung
|
|
This reverts commit dd2eabc49d415dd30cea0953df5d7659d4d9440f.
|
|
Make MIR drop terminators borrow the dropped location
r? @eddyb
cc @tmandry
|
|
Rename Place::local to Place::local_or_deref_local
r? @oli-obk
|
|
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.
Revisions asked by eddyb :
- Renamed of all the occurences of {visit/super}_mir
- Renamed test structures `CachedMir` to `Cached`
Fixing the missing import on `AggregateKind`
|
|
|
|
|
|
Add match arm scopes and other scope fixes
* Add drop and lint scopes for match arms.
* Lint attributes are now respected on match arms.
* Make sure we emit a StorageDead if we diverge when initializing a temporary.
* Adjust MIR pretty printing of scopes for locals.
* Don't generate duplicate lint scopes for `let statements`.
* Add some previously missing fake borrows for matches.
closes #46525
cc @rust-lang/compiler
|
|
|
|
|
|
|
|
|
|
Use normal newtype_index macro for MIR dataflows
* Makes the definition of these structs contain `struct IndexName`
* Avoids having an offset by removing high values, rather than 0
* Implements some traits for us.
|
|
The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.
|
|
|
|
|
|
|
|
|
|
|
|
The borrow place *must* be a place that we track borrows for, otherwise
we will likely ICE.
|
|
|
|
|
|
treat ref-to-raw cast like a reborrow: do a special kind of retag
r? @oli-obk
Cc @nikomatsakis
|
|
MIR borrowck doesn't accept the example of iterating and updating a mutable reference
Fixes #46589.
r? @pnkfelix or @nikomatsakis
|
|
|
|
This avoids all sorts of confusing issues with using both `dest_place`
and `self` in the `propagate_call_return` function in the
`BitDenotation` implementation for `Borrows`.
|
|
This commit extends previous work to kill borrows from a local after
assignment into that local to kill borrows from a projection after
assignment into a prefix of that place.
|
|
|
|
|
|
Now that lexical MIR borrowck is gone, there's no need to store Regions
unnecessarily.
|
|
Since lexical MIR borrow check is gone, and validation no longer uses
these, they can be removed.
|
|
Add escape-to-raw MIR statement
Add a new MIR "ghost state statement": Escaping a ptr to permit raw accesses.
~~This includes #55549, [click here](https://github.com/RalfJung/rust/compare/miri-visitor...RalfJung:escape-to-raw) for just the new commits.~~
|
|
to raw
|
|
refactor: use shorthand fields
refactor: use shorthand for single fields everywhere (excluding tests).
|
|
|
|
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
|
|
As suggested in the feedback for #55244.
When I replaced the macro with a function, rustc started complaining
that there were two unused functions so I also removed those.
|
|
|
|
This shrinks StatementKind from 80 bytes to 64 bytes on 64-bit.
|
|
NLL: disallow creation of immediately unusable variables
Fix #53695
Original description follows
----
This WIP PR is for discussing the impact of fixing #53695 by injecting a fake read in let patterns.
(Travis will fail, at least the `mir-opt` suite is failing in its current state)
|
|
Currently, `BitSet` doesn't actually know its own domain size; it just
knows how many words it contains. To improve things, this commit makes
the following changes.
- It changes `BitSet` and `SparseBitSet` to store their own domain size,
and do more precise bounds and same-size checks with it. It also
changes the signature of `BitSet::to_string()` (and puts it within
`impl ToString`) now that the domain size need not be passed in from
outside.
- It uses `derive(RustcDecodable, RustcEncodable)` for `BitSet`. This
required adding code to handle `PhantomData` in `libserialize`.
- As a result, it removes the domain size from `HybridBitSet`, making a
lot of that code nicer.
- Both set_up_to() and clear_above() were overly general, working with
arbitrary sizes when they are only needed for the domain size. The
commit removes the former, degeneralizes the latter, and removes the
(overly general) tests.
- Changes `GrowableBitSet::grow()` to `ensure()`, fixing a bug where a
(1-based) domain size was confused with a (0-based) element index.
- Changes `BitMatrix` to store its row count, and do more precise bounds
checks with it.
- Changes `ty_params` in `select.rs` from a `BitSet` to a
`GrowableBitSet` because it repeatedly failed the new, more precise
bounds checks. (Changing the type was simpler than computing an
accurate domain size.)
- Various other minor improvements.
|
|
|
|
Merge `bitvec.rs` and `indexed_set.rs`
Because it's not good to have two separate implementations. Also, I will combine the best parts of each to improve NLL memory usage on some benchmarks significantly.
|