| Age | Commit message (Collapse) | Author | Lines |
|
(ReadOnly)BodyCache type errors
|
|
(ReadOnly)BodyCache type errors
|
|
predecessor_locations fn to ReadOnlyBodyCache
|
|
|
|
body_mut method, fix visit macros, simplify usage in codegen_ssa analyzer
|
|
errors in librustc_codegen_ssa
|
|
and Body (WIP, amend this commit)
|
|
This ensures that the cache can be properly ignored during encoding and decoding.
Fix panics that arose due to lack of encoding
|
|
|
|
|
|
more ensure_predecessors to prevent panics
|
|
|
|
|
|
predecessors cache
|
|
|
|
invalidate cache when accessing unique terminator
|
|
|
|
predecessors_for to slice
|
|
|
|
|
|
|
|
add reusable MachineStop variant to Miri engine error enum
Replace the Miri-tool-specific `Exit` error variant with something dynamically typed that all clients of the Miri engine can use.
r? @oli-obk
Cc https://github.com/rust-lang/rust/issues/66902
|
|
rustc: hide HirId's fmt::Debug output from -Z span_free_formats.
This replaces the only occurrences of `HirId {...}` from tests with paths, i.e.:
```rust
[closure@HirId { owner: DefIndex(4), local_id: 15 } q:&i32, t:&T]
```
becomes, after this PR:
```rust
[closure@foo<T>::{{closure}}#0 q:&i32, t:&T]
```
r? @oli-obk cc @michaelwoerister
|
|
rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.
By having one `ClearCrossCrate<SourceScopeLocalData>` for each scope, as opposed to a single `ClearCrossCrate` for all the `SourceScopeLocalData`s, we can represent the fact that some scopes have `SourceScopeLocalData` associated with them, and some don't.
This is useful when doing MIR inlining across crates, because the `ClearCrossCrate` will be `Clear` for the cross-crate MIR scopes and `Set` for the local ones.
Also see https://github.com/rust-lang/rust/pull/66203#issuecomment-555589574 for some context around this approach.
Fixes #51314.
|
|
|
|
|
|
const_prop: detect and avoid catching Miri errors that require allocation
r? @wesleywiser @oli-obk
|
|
|
|
|
|
Async fn resume after completion
#65419 -- Attempting to run an async fn after completion mentions generators
Not yet ready for review - work in progress
Just need to run the tests on a proper build server
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add memoization for const function evaluations
When a const function is being evaluated, as long as all its arguments are zero-sized-types (or it has no arguments) then we can trivially memoize the evaluation result using the existing query mechanism.
With thanks to @oli-obk for mentoring me through this at RustFest Barcelona.
r? @oli-obk
|
|
Fix spelling typos
Should be non-semantic.
Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos.
|
|
VarDebugInfo.
|
|
When a const function is being evaluated, as long as all its
arguments are zero-sized-types (or it has no arguments) then we
can trivially memoize the evaluation result using the existing
query mechanism.
|
|
[const prop] Fix "alloc id without corresponding allocation" ICE
r? @oli-obk
|
|
|
|
This is necessary so that the `ComstPropMachine` can intern allocations.
|
|
fix reoccuring typo: dereferencable -> dereferenceable
|
|
Handle statics in MIR as const pointers
This is the first PR towards the goal of removing `PlaceBase::Static`. In this PR:
* Statics are lowered to dereferencing a const pointer.
* The temporaries holding such pointers are tracked in MIR, for the most part this is only used for diagnostics. There are two exceptions:
* The borrow checker has some checks for thread-locals that directly use this data.
* Const checking will suppress "cannot dereference raw pointer" diagnostics for pointers to `static mut`/`extern static`. This is to maintain the current behaviour (12 tests fail otherwise).
The following are left to future PRs (I think that @spastorino will be working on the first 3):
* Applying the same treatments to promoted statics.
* Removing `PlaceBase::Static`.
* Replacing `PlaceBase` with `Local`.
* Moving the ever growing collection of metadata that we have for diagnostics in MIR passes somewhere more appropriate.
r? @oli-obk
|
|
|
|
[mir-opt] asking `?`s in a more optimized fashion
This PR works towards https://github.com/rust-lang/rust/issues/66234 by providing two optimization passes meant to run in sequence:
- `SimplifyArmIdentity` which transforms something like:
```rust
_LOCAL_TMP = ((_LOCAL_1 as Variant ).FIELD: TY );
((_LOCAL_0 as Variant).FIELD: TY) = move _LOCAL_TMP;
discriminant(_LOCAL_0) = VAR_IDX;
```
into:
```rust
_LOCAL_0 = move _LOCAL_1
```
- `SimplifyBranchSame` which transforms `SwitchInt`s to identical basic blocks into a `goto` to the first reachable target.
Together, these are meant to simplify the following into just `res`:
```rust
match res {
Ok(x) => Ok(x),
Err(x) => Err(x),
}
```
It should be noted however that the desugaring of `?` includes a function call and so the first pass in this PR relies on inlining to substitute that function call for identity on `x`. Inlining requires `mir-opt-level=2` so this might not have any effect in perf-bot but let's find out.
r? @oli-obk -- This is WIP, but I'd appreciate feedback. :)
|
|
|
|
|