about summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2019-12-04Auto merge of #66866 - oli-obk:const_fn_memoization, r=RalfJungbors-1/+1
Only memoize const fn calls during const eval Miri and other engines may want to execute the function in order to detect UB inside of them. r? @RalfJung
2019-12-04Auto merge of #66275 - oli-obk:organize-intrinsics-promotion-checks, r=RalfJungbors-88/+4
Organize intrinsics promotion checks cc @vertexclique supersedes #61835 r? @RalfJung
2019-12-03rustc: expose the mir::Body reference lifetime from mir::ReadOnlyBodyCache ↵Eduard-Mihai Burtescu-21/+21
(#64736 fallout).
2019-12-03TidyOliver Scherer-1/+0
2019-12-03Move all intrinsic whitelists into the constness check fileOliver Scherer-52/+3
2019-12-03Only check `min_const_fn` for const fnsOliver Scherer-1/+1
2019-12-03Check intrinsics for callability in const fnsMahmut Bulut-55/+21
2019-12-02Auto merge of #64736 - Nashenas88:mir_predecessors_cache_cleanup, r=oli-obkbors-171/+242
Remove interior mutability in mir predecessors cache
2019-12-02Suggest feature for const_mut_refs errorsChristian Poveda-3/+7
2019-12-02Fix issues caused during rebasingPaul Daniel Faria-2/+1
2019-12-02Disallow cell borrowingChristian Poveda-27/+36
2019-12-02Allow mutable derefs with feature gateChristian Poveda-1/+5
2019-12-02Allow mutable borrows in constant bodiesChristian Poveda-0/+4
2019-12-02Rename feature gateChristian Poveda-1/+1
2019-12-02Allow &mut in const fns when feature gate is enabledChristian Poveda-4/+8
2019-12-02Fix issues caused during rebasingPaul Daniel Faria-1/+1
2019-12-02Fix tidy issuesPaul Daniel Faria-1/+2
2019-12-02Fix rebasing errors, convert some BodyCache::body() calls to reborrowsPaul Daniel Faria-23/+24
2019-12-02Fix type errors created during rebasingPaul Daniel Faria-38/+42
2019-12-02Fix type errors cause during rebasingPaul Daniel Faria-4/+5
2019-12-02Compute predecessors in mir_build query and use existing cache for ↵Paul Daniel Faria-3/+4
generating ReadOnlyBodyCache, remove unneeded fns
2019-12-02Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, ↵Paul Daniel Faria-331/+331
rename all body_cache back to body
2019-12-02Remove BodyCache.body and rely on Deref as much as possible for ↵Paul Daniel Faria-14/+14
ReadOnlyBodyCache
2019-12-02Fix typoPaul Daniel Faria-1/+1
2019-12-02Fix tidy errorsPaul Daniel Faria-27/+74
2019-12-02Fix typos caused during rebasePaul Daniel Faria-3/+3
2019-12-02Fix remaining compilation issuesPaul Daniel Faria-26/+34
2019-12-02Simplify BodyCache impl and fix all remaining type errors in librustc_mir ↵Paul Daniel Faria-329/+336
(lifetime errors still exist)
2019-12-02Simplify Cache wrapper to single type, impl Deref on it, fix all compilation ↵Paul Daniel Faria-33/+0
errors in librustc_codegen_ssa
2019-12-02Move predecessors cache back to its own typePaul Daniel Faria-1/+2
This ensures that the cache can be properly ignored during encoding and decoding. Fix panics that arose due to lack of encoding
2019-12-02Address nits and remove unneeded passPaul Daniel Faria-8/+4
2019-12-02Move predecessors cache invalidation back to basic_blocks_mut, add a couple ↵Paul Daniel Faria-64/+65
more ensure_predecessors to prevent panics
2019-12-02Ensure predecessors are recomputed at critical points, fixes panicsPaul Daniel Faria-4/+18
2019-12-02Address linting errors caught by CIPaul Daniel Faria-2/+2
2019-12-02Add pass to ensure predecessors cache is generated after optimizationPaul Daniel Faria-0/+17
2019-12-02Stop invalidating predecessors cache when accessing unique basic block, ↵Paul Daniel Faria-58/+64
invalidate cache when accessing unique terminator
2019-12-02Inline cache impl into Body, rename predecessor fns, change output of ↵Paul Daniel Faria-1/+1
predecessors_for to slice
2019-12-02Remove interior mutability in mir predecessors cachePaul Daniel Faria-1/+1
2019-12-02Auto merge of #66874 - RalfJung:miri-assert-panic, r=oli-obkbors-1/+10
Miri engine: proper support for `Assert` MIR terminators This puts down the basis for https://github.com/rust-lang/miri/issues/1070, and I also did some clean-up. The Miri side of this is at https://github.com/rust-lang/miri/pull/1084. r? @oli-obk
2019-12-02Rollup merge of #66654 - ecstatic-morse:check-consts-ref, r=eddyb,matthewjasperRalf Jung-129/+100
Handle const-checks for `&mut` outside of `HasMutInterior` Addresses [this comment](https://github.com/rust-lang/rust/pull/64470#discussion_r328200508). Const-checking relied on `HasMutInterior` to forbid `&mut` in a const context. This was strange because all we needed to do was look for an `Rvalue::Ref` with a certain `BorrowKind`, whereas the `Qualif` traits are specifically meant to get the qualifs for a *value*. This PR removes that logic from `HasMutInterior` and moves it into `check_consts::Validator`. As a result, we can now properly handle qualifications for `static`s, which had to be ignored previously since you can e.g. borrow a static `Cell` from another `static`. We also remove the `derived_from_illegal_borrow` logic, since it is no longer necessary; we give good errors for subsequent reborrows/borrows of illegal borrows.
2019-12-02fix init_allocation_extraRalf Jung-2/+2
2019-12-02Assert terminator is never executed in ConstPropRalf Jung-1/+1
2019-12-02make alloc_extra machine hook a bit nicerRalf Jung-3/+3
2019-12-02expose span to M::assert_panic, and provide helper to turn that into ↵Ralf Jung-0/+1
CallerLocation
2019-12-02Miri: add machine hook for MIR-level assertion panicsRalf Jung-0/+8
2019-12-02make use of Result::map_orLzu Tao-1/+1
2019-12-02Rollup merge of #66926 - RalfJung:miri-stop, r=oli-obkMazdak Farrokhzad-1/+1
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
2019-12-02Rollup merge of #66789 - eddyb:mir-source-scope-local-data, r=oli-obkMazdak Farrokhzad-59/+32
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.
2019-12-01Incorporate fixes from reviewDylan MacKenzie-5/+3
2019-12-01add reusable MachineStop variant to Miri engine error enumRalf Jung-1/+1