about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
AgeCommit message (Collapse)AuthorLines
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-5/+5
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-06-12Auto merge of #98018 - scottmcm:miri-yeet, r=RalfJungbors-0/+1
Try out `yeet` in the MIR interpreter Since we got a new bootstrap, we can give this a shot. r? `@oli-obk`
2022-06-11Try out `yeet` in the MIR interpreterScott McMurray-0/+1
2022-06-12Remove duplicated implementations of borrowed locals analysisTomasz Miąsko-133/+8
2022-06-09Add a explanation about required panic strategy computationGary Guo-0/+21
2022-06-09Auto merge of #97740 - RalfJung:ctfe-cycle-spans, r=lcnrbors-10/+19
use precise spans for recursive const evaluation This fixes https://github.com/rust-lang/rust/issues/73283 by using a `TyCtxtAt` with a more precise span when the interpreter recursively calls itself. Hopefully such calls are sufficiently rare that this does not cost us too much performance. (In theory, cycles can also arise through layout computation, as layout can depend on consts -- but layout computation happens all the time so we'd have to do something to not make this terrible for performance.)
2022-06-08Rename `panic_strategy` query to `required_panic_strategy`Gary Guo-2/+4
2022-06-08Use is_fn_like instead of matching on DefKindGary Guo-12/+2
2022-06-08Handle panic runtime speciallyGary Guo-1/+5
2022-06-08Fix FFI-unwind unsoundness with mixed panic modeGary Guo-0/+153
2022-06-08Rollup merge of #97597 - tmiasko:simplify-locals-side-effects, ↵Dylan DPC-3/+7
r=RalfJung,JakobDegen Preserve unused pointer to address casts Fixes #97421. cc `@RalfJung`
2022-06-07Preserve unused pointer to address castsTomasz Miąsko-3/+7
2022-06-07Remove `AlwaysLiveLocals` wrapper structTomasz Miąsko-5/+5
It is just a wrapper around a `BitSet` and doesn't have any functionality of its own.
2022-06-05Auto merge of #97697 - WaffleLapkin:no_ref_vec, r=WaffleLapkinbors-19/+17
Replace `&Vec<_>`s with `&[_]`s It's generally preferable to use `&[_]` since it's one less indirection and it can be created from types other that `Vec`. I've left `&Vec` in some locals where it doesn't really matter, in cases where `TypeFoldable` is expected (`TypeFoldable: Clone` so slice can't implement it) and in cases where it's `&TypeAliasThatIsActiallyVec`. Nothing important, really, I was just a little annoyed by `visit_generic_param_vec` :D r? `@compiler-errors`
2022-06-04const_prop_lint: ensure we have up-to-date cur_span()Ralf Jung-10/+19
2022-06-04Rollup merge of #97696 - cjgillot:normalize-inline, r=compiler-errorsMatthias Krüger-10/+15
Do not ICE when failing to normalize during inlining. Fixes https://github.com/rust-lang/rust/issues/97695
2022-06-03Do not ICE when failing to normalize during inlining.Camille GILLOT-10/+15
2022-06-03Replace `&Vec<_>`s with `&[_]`sMaybe Waffle-19/+17
2022-05-31Add a pointer to address cast kindTomasz Miąsko-2/+2
A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.
2022-05-30validate derefer, run derefer inside generatorouz-a-52/+65
2022-05-28Make TyCtxt implement Interner, make HashStable generic and move to ↵Michael Goulet-2/+2
rustc_type_ir
2022-05-28Initial fixes on top of type interner commitMichael Goulet-2/+4
2022-05-24Add dead store elimination passJakob Degen-1/+151
2022-05-24coverage: Don't underflow column numberTyler Mandry-1/+1
I noticed this when running coverage on a debug build of rustc. There may be other places that do this but I'm just fixing the one I hit.
2022-05-23Refactor call terminator to always hold a destination placeJakob Degen-98/+92
2022-05-23Rollup merge of #97292 - compiler-errors:tcxify-rustc, r=davidtwcoDylan DPC-17/+8
Lifetime variance fixes for rustc #97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be unified by shortening both to some common lifetime. This is doable, since many lifetimes are already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from #97287 so the compiler team can review independently.
2022-05-22Lifetime variance fixes for rustcMichael Goulet-17/+8
2022-05-22Remove box syntax from rustc_mir_dataflow and rustc_mir_transformest31-5/+5
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-4/+3
2022-05-19Rollup merge of #97142 - SparrowLii:inline, r=tmiaskoDylan DPC-28/+27
move processing of `source_scope_data` into `MutVisitor`'s impl of `Integrator` when inline This PR fixes the FIXME in the inline mir-opt which moves processing of `source_scope_data` into `MutVisitor`'s impl of `Integrator` when inline
2022-05-19Auto merge of #97103 - luqmana:asm-unwind-cleanup, r=Amanieu,tmiaskobors-2/+9
Update MIR passes to handle unwinding Inline Asm Some more follow up fixes from https://github.com/rust-lang/rust/pull/95864#issuecomment-1094165398 r? `@Amanieu`
2022-05-18Update MIR passes that assumed inline can never unwind.Luqman Aden-2/+9
2022-05-18move processing of `source_scope_data` into `MutVisitor`'s impl of ↵SparrowLii-28/+27
Integrator when inline mir-opt
2022-05-17Auto merge of #97111 - JohnTitor:rollup-x3vjf6u, r=JohnTitorbors-10/+10
Rollup of 7 pull requests Successful merges: - #96329 (Add a couple tests for #90887 fixes) - #97009 (Allow `unused_macro_rules` in path tests) - #97075 (Add regression test for #81804) - #97079 (Change `Successors` to `impl Iterator<Item = BasicBlock>`) - #97080 (remove the `RelateResultCompare` trait) - #97093 (Migrate `maybe_recover_from_bad_type_plus` diagnostic) - #97102 (Update function pointer call error message) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-17Rollup merge of #97079 - SparrowLii:successors, r=lcnrYuki Okushi-10/+10
Change `Successors` to `impl Iterator<Item = BasicBlock>` This PR fixes the FIXME in `compiler\rustc_middle\src\mir\mod.rs`. This can omit several `&`, `*` or `cloned` operations on Successros' generated elements
2022-05-17Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwcobors-5/+2
Add a query for checking whether a function is an intrinsic. work towards #93145 This will reduce churn when we add more ways to declare intrinsics r? `@scottmcm`
2022-05-17Auto merge of #96825 - kckeiks:remove-item-like-visitor-trait, r=cjgillotbors-1/+1
Retire `ItemLikeVisitor` trait Issue #95004 cc `@cjgillot`
2022-05-17Change `Successors` to `impl Iterator<Item = BasicBlock>`SparrowLii-10/+10
2022-05-16Add a query for checking whether a function is an intrinsic.Oli Scherer-5/+2
2022-05-14Auto merge of #96883 - jackh726:early-binder-2, r=oli-obkbors-13/+15
Add EarlyBinder Chalk has no concept of `Param` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L579) or `ReEarlyBound` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L1308). Everything is just "bound" - the equivalent of rustc's late-bound. It's not completely clear yet whether to move everything to the same time of binder in rustc or add `Param` and `ReEarlyBound` in Chalk. Either way, tracking when we have or haven't already substituted out these in rustc can be helpful. As a first step, I'm just adding a `EarlyBinder` newtype that is required to call `subst`. I also add a couple "transparent" `bound_*` wrappers around a couple query that are often immediately substituted. r? `@nikomatsakis`
2022-05-14Auto merge of #95826 - carbotaniuman:miri-permissive-provenance, r=RalfJungbors-3/+20
Initial work on Miri permissive-exposed-provenance Rustc portion of the changes for portions of a permissive ptr-to-int model for Miri. The main changes here are changing `ptr_get_alloc` and `get_alloc_id` to return an Option, and also making ptr-to-int casts have an expose side effect.
2022-05-13Add bound_fn_sigJack Huey-4/+4
2022-05-13Add bound_type_ofJack Huey-2/+4
2022-05-13Rustc changes for permissive provenancecarbotaniuman-3/+20
2022-05-13rename visit item-like methodsMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove ItemLikeVisitor and DeepVisitorMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-12Use IndexSet for deterministic orderOli Scherer-3/+2
2022-05-12Gracefully handle normalization failures in the prospective inliner cycle ↵Oli Scherer-1/+4
detector
2022-05-10Introduce EarlyBinderJack Huey-17/+17
2022-05-10simplify length countMatthias Krüger-1/+1