| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Cleanup the MIR visitor
* Remove useless `BasicBlock` parameters on methods with `Location`s.
* Prefer `visit_terminator_kind` to `visit_terminator`.
* Remove `Region` from PlaceContexts. `visit_rvalue` should be used when the region is important.
* Remove unused visitor methods.
|
|
|
|
|
|
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.
|
|
|
|
Shrink `mir::Statement`.
The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.
|
|
The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.
|
|
|
|
|
|
|
|
Merge `Promoted` and `Static` in `mir::Place`
fixes #53848
|
|
Use a valid name for graphviz graphs
Hiridification has broken graphviz output because `HirId` has a more complex display implemetation than `NodeId`. Since the id was just used to generate a distinct identifier, we just pull out the various constituent indexed.
|
|
|
|
|
|
|
|
Report the diagnostic on macro expansions, and add a label indicating
why the comment is unused.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
cleanup: remove static lifetimes from consts
A follow-up to https://github.com/rust-lang/rust/pull/56497.
|
|
More MIR borrow check cleanup
* Fix some rustc doc links
* Remove the `region_map` field from `BorrowSet`
* Use `visit_local` to find 2PB activations
r? @nikomatsakis
|
|
|
|
|
|
|
|
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.~~
|
|
NLL Diagnostic Review 3: Unions not reinitialized after assignment into field
Fixes #55651, #55652.
This PR makes two changes:
First, it updates the dataflow builder to add an init for the place
containing a union if there is an assignment into the field of
that union.
Second, it stops a "use of uninitialized" error occuring when there is an
assignment into the field of an uninitialized union that was previously
initialized. Making this assignment would re-initialize the union, as
tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`.
The check for previous initialization ensures that we do not start
supporting partial initialization yet (cc #21232, #54499, #54986).
This PR also fixes #55652 which was marked as requiring investigation
as the changes in this PR add an error that was previously missing
(and mentioned in the review comments) and confirms that the error
that was present is correct and a result of earlier partial
initialization changes in NLL.
r? @pnkfelix (due to earlier work with partial initialization)
cc @nikomatsakis
|
|
to raw
|
|
refactor: use shorthand fields
refactor: use shorthand for single fields everywhere (excluding tests).
|
|
|
|
This commit makes two changes:
First, it updates the dataflow builder to add an init for the place
containing a union if there is an assignment into the field of
that union.
Second, it stops a "use of uninitialized" error occuring when there is an
assignment into the field of an uninitialized union that was previously
initialized. Making this assignment would re-initialize the union, as
tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`.
The check for previous initialization ensures that we do not start
supporting partial initialization yet (cc #21232, #54499, #54986).
|
|
rustc: improve E0669 span
E0669 refers to an operand that cannot be coerced into a single LLVM
value, unfortunately right now this uses the Span for the entire inline
assembly statement, which is less than ideal.
This commit preserves the Span from HIR, which lets us emit the error
using the Span for the operand itself in MIR.
r? @nagisa
cc/ @parched
|
|
Add Retagging statements
This adds a `Retag` statement kind to MIR, used to perform the retagging operation from [Stacked Borrows](https://www.ralfj.de/blog/2018/08/07/stacked-borrows.html). It also kills the old `Validate` statements that I added last year.
NOTE: This includes https://github.com/rust-lang/rust/pull/55270. Only [these commits are new](https://github.com/RalfJung/rust/compare/stacked-borrows-ng...RalfJung:retagging).
|
|
This reduces allocation counts significantly in a few benchmarks,
reducing instruction counts by up to 2%.
|
|
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.
|
|
|
|
|