about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform
AgeCommit message (Collapse)AuthorLines
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
2022-05-09reviewlcnr-6/+2
2022-05-09only compute `codegen_fn_attrs` where neededlcnr-1/+6
2022-05-09move `panic-in-drop=abort` check for `drop_in_place`lcnr-9/+7
Whether `drop_in_place` can abort does depend on the `panic-in-drop` option while compiling the current crate, not `core`
2022-05-07Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errorsbors-12/+14
Begin fixing all the broken doctests in `compiler/` Begins to fix #95994. All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are. There are also a few that I marked `ignore` that could maybe be made to work but seem less important. Each `ignore` has a rough "reason" for ignoring after it parentheses, with - `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax" - `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy. - `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR. - `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup. Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful. I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_tool
2022-05-05Rollup merge of #96714 - RalfJung:scalar-pair-debug, r=oli-obkMatthias Krüger-4/+4
interpret/validity: debug-check ScalarPair layout information This would have caught https://github.com/rust-lang/rust/issues/96158. I ran the Miri test suite and it still passes. r? `@oli-obk`
2022-05-05give it a scary nameRalf Jung-4/+4
2022-05-04interpret: debug-check ScalarPair layout informationRalf Jung-3/+3
2022-05-02fix most compiler/ doctestsElliot Roberts-12/+14
2022-05-01re-name stuffouz-a-3/+6
2022-04-29remove and blessouz-a-2/+2
2022-04-29exp-stuff-dirtyouz-a-5/+18
2022-04-28Rollup merge of #96471 - BoxyUwU:let_else_considered_harmful, r=lcnrDylan DPC-3/+1
replace let else with `?` r? `@oli-obk`
2022-04-27tut tut tutEllen-3/+1
2022-04-26Revert "add `DefId` to unsafety violations and display function path in E0133"Oli Scherer-5/+4
This reverts commit 8b8f6653cfd54525714f02efe7af0a0f830e185c.
2022-04-25Auto merge of #96294 - Emilgardis:def_id-in-unsafetyviolationdetails, r=oli-obkbors-5/+8
Display function path in unsafety violations - E0133 adds `DefId` to `UnsafetyViolationDetails` this enables consumers to access the function definition that was reported to be unsafe and also changes the output for some E0133 diagnostics
2022-04-25Auto merge of #96116 - ouz-a:mir-opt, r=oli-obkbors-55/+76
Make derefer work everwhere Follow up work on previous PR's #95649 and #95857. r? rust-lang/mir-opt _Co-Authored-By: `@oli-obk_`
2022-04-25Rollup merge of #96090 - JakobDegen:mir-tests, r=nagisaMatthias Krüger-4/+17
Implement MIR opt unit tests This implements rust-lang/compiler-team#502 . There's not much to say here, this implementation does everything as proposed. I also added the flag to a bunch of existing tests (mostly those to which I could add it without causing huge diffs due to changes in line numbers). Summarizing the changes to test outputs: - Every time an `MirPatch` is created, it adds a cleanup block to the body if it did not exist already. If this block is unused (as is usually the case), it usually gets removed soon after by some pass calling `SimplifyCFG` for unrelated reasons (in many cases this cycle happens quite a few times for a single body). We now run `SimplifyCFG` less often, so those blocks end up in some of our outputs. I looked at changing `MirPatch` to not do this, but that seemed too complicated for this PR. I may still do that in a follow-up. - The `InstCombine` test had set `-C opt-level=0` in its flags and so there were no storage markers. I don't really see a good motivation for doing this, so bringing it back in line with what everything else does seems correct. - One of the `EarlyOtherwiseBranch` tests had `UnreachableProp` running on it. Preventing that kind of thing is the goal of this feature, so this seems fine. For the remaining tests for which this feature might be useful, we can gradually migrate them as opportunities present themselves. In terms of documentation, I plan on submitting a PR to the rustc dev guide in the near future documenting this and other recent changes to MIR. If there's any other places to update, do let me know r? `@nagisa`
2022-04-24only show a simple description in E0133 span labelEmil Gardström-1/+1
2022-04-24add `DefId` to unsafety violations and display function path in E0133Emil Gardström-4/+7
this enables consumers to access the function definition that was reported to be unsafe
2022-04-22use references to avoid function callsSparrowLii-12/+29
2022-04-21access `local_decls` through `ecx`SparrowLii-49/+14
2022-04-17little changesouz-a-4/+4
2022-04-16Address nitsJakob Degen-3/+3
2022-04-16Add support for MIR opt unit testsJakob Degen-4/+17
2022-04-16Make derefer work everwhereouz-a-55/+76
Co-Authored-By: Oli Scherer <332036+oli-obk@users.noreply.github.com>
2022-04-13couple of clippy::complexity fixesMatthias Krüger-2/+2
2022-04-11Remove inlining cost of `Deinit` statementsJakob Degen-0/+1
2022-04-11Add new `MutatatingUseContext`s for deinit and `SetDiscriminant`Jakob Degen-1/+5
2022-04-11Add new `Deinit` statement kindJakob Degen-5/+14
2022-04-10Auto merge of #95889 - Dylan-DPC:rollup-1cmywu4, r=Dylan-DPCbors-8/+8
Rollup of 7 pull requests Successful merges: - #95566 (Avoid duplication of doc comments in `std::char` constants and functions) - #95784 (Suggest replacing `typeof(...)` with an actual type) - #95807 (Suggest adding a local for vector to fix borrowck errors) - #95849 (Check for git submodules in non-git source tree.) - #95852 (Fix missing space in lossy provenance cast lint) - #95857 (Allow multiple derefs to be splitted in deref_separator) - #95868 (rustdoc: Reduce allocations in a `html::markdown` function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup