summary refs log tree commit diff
path: root/compiler/rustc_middle/src/mir
AgeCommit message (Collapse)AuthorLines
2022-10-04Make QueryOutlivesConstraint contain a ConstraintCategoryJack Huey-2/+2
(cherry picked from commit a46376e247e947f6e7db5ac6da5da4d88249942a)
2022-09-17Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnrbors-46/+89
Use only ty::Unevaluated<'tcx, ()> in type system r? `@lcnr`
2022-09-16Revert "Better errors for implied static bound"Jack Huey-2/+2
This reverts commit c75817b0a75d4b6b01ee10900ba5d01d4915e6a8.
2022-09-15nitsb-naber-0/+1
2022-09-15Merge all `TypeVisitable for &List<T>` impls into one generic oneOli Scherer-6/+0
2022-09-15Replace more manual TypeFoldable and TypeVisitable impls with derivesOli Scherer-1/+1
2022-09-15derive TypeVisitable and TypeFoldable for mir typesOli Scherer-312/+25
2022-09-15Derive TypeFoldable and TypeVisitable for mir::PlaceElementOli Scherer-32/+1
2022-09-15derive various Lift impl instead of hand rolling themOli Scherer-30/+2
2022-09-14Auto merge of #101212 - eholk:dyn-star, r=compiler-errorsbors-0/+3
Initial implementation of dyn* This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things: * Introduce `dyn_star` feature flag * Adds parsing for `dyn* Trait` types * Defines `dyn* Trait` as a sized type * Adds support for explicit casts, like `42usize as dyn* Debug` * Including const evaluation of such casts * Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope * Adds codegen for method calls, at least for methods that take `&self` Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits. Joint work with `@nikomatsakis` and `@compiler-errors.` r? `@bjorn3`
2022-09-14address review againb-naber-14/+5
2022-09-13Better errors for implied static boundJack Huey-2/+2
2022-09-13Only keep one version of ImplicitSelfKind.Camille GILLOT-17/+1
2022-09-13address reviewb-naber-11/+3
2022-09-13remove visit_const from mir visitorsb-naber-17/+13
2022-09-13fixes/working versionb-naber-1/+5
2022-09-13use ty::Unevaluated<'tcx, ()> in type systemb-naber-21/+80
2022-09-12dyn* through more typechecking and MIREric Holk-0/+3
2022-09-12Rollup merge of #100767 - kadiwa4:escape_ascii, r=jackh726Dylan DPC-9/+1
Remove manual <[u8]>::escape_ascii `@rustbot` label: +C-cleanup
2022-09-08Rollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obkDylan DPC-2/+2
Remove unnecessary `PartialOrd` and `Ord`
2022-09-08remove unnecessary `PartialOrd` and `Ord`Takayuki Maeda-2/+2
2022-09-07Use niche-filling optimization even when multiple variants have data.Michael Benfield-1/+2
Fixes #46213
2022-09-07Auto merge of #101522 - oli-obk:miriup, r=oli-obkbors-1/+3
Update miri submodule fixes #101344 cc `@rust-lang/miri` r? `@ghost`
2022-09-07Update miri submoduleOli Scherer-1/+3
2022-09-07Auto merge of #98332 - oli-obk:assume, r=wesleywiserbors-19/+50
Lower the assume intrinsic to a MIR statement This makes https://github.com/rust-lang/rust/pull/96862#issuecomment-1153739068 easier and will generally allow us to cheaply insert assume intrinsic calls in mir building. r? rust-lang/wg-mir-opt
2022-09-06Update docsOli Scherer-2/+2
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-32/+50
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-0/+13
2022-09-06Add more size assertions for MIR types.Nicholas Nethercote-8/+14
And move them into a module, as has been done previously for AST, HIR, etc.
2022-09-01tracing::instrument cleanupOli Scherer-14/+8
2022-08-31Fix a bunch of typoDezhi Wu-4/+4
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-30Auto merge of #99102 - JakobDegen:reorder-generators, r=oli-obkbors-55/+102
Rework definition of MIR phases to more closely reflect semantic concerns Implements most of rust-lang/compiler-team#522 . I tried my best to restrict this PR to the "core" parts of the MCP. In other words, this includes just enough changes to make the new definition of `MirPhase` make sense. That means there are a couple of FIXMEs lying around. Depending on what reviewers prefer, I can either fix them in this PR or send follow up PRs. There are also a couple other refactorings of the `rustc_mir_transform/src/lib.rs` file that I want to do in follow ups that I didn't leave explicit FIXMEs for.
2022-08-30Refactor MIR phasesJakob Degen-55/+102
2022-08-30Rollup merge of #101101 - RalfJung:read-pointer-as-bytes, r=oli-obkDylan DPC-191/+180
interpret: make read-pointer-as-bytes a CTFE-only error with extra information Next step in the reaction to https://github.com/rust-lang/rust/issues/99923. Also teaches Miri to implicitly strip provenance in more situations when transmuting pointers to integers, which fixes https://github.com/rust-lang/miri/issues/2456. Pointer-to-int transmutation during CTFE now produces a message like this: ``` = help: this code performed an operation that depends on the underlying bytes representing a pointer = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported ``` r? ``@oli-obk``
2022-08-29Rollup merge of #99027 - tmiasko:basic-blocks, r=oli-obkMatthias Krüger-19/+14
Replace `Body::basic_blocks()` with field access Since the refactoring in #98930, it is possible to borrow the basic blocks independently from other parts of MIR by accessing the `basic_blocks` field directly. Replace unnecessary `Body::basic_blocks()` method with a direct field access, which has an additional benefit of borrowing the basic blocks only.
2022-08-28improve OFFSET_IS_ADDR docsRalf Jung-2/+6
2022-08-27interpret: make read-pointer-as-bytes *always* work in MiriRalf Jung-96/+84
and show some extra information when it happens in CTFE
2022-08-27interpret: rename relocation → provenanceRalf Jung-114/+111
2022-08-26remove now-unused ScalarMaybeUninitRalf Jung-134/+1
2022-08-26make read_immediate error immediately on uninit, so ImmTy can carry ↵Ralf Jung-17/+8
initialized Scalar
2022-08-26remove some now-unnecessary parameters from check_bytesRalf Jung-19/+4
2022-08-26Replace `Body::basic_blocks()` with field accessTomasz Miąsko-19/+14
2022-08-25Inline trivial `From<Local> for Place<'_>` implTomasz Miąsko-0/+1
2022-08-23Remove support for adding statement to all successorsTomasz Miąsko-17/+0
This feature of MIR patch system is no longer used.
2022-08-23Elide storage markers when elaborating deref projectionsTomasz Miąsko-3/+6
2022-08-19use <[u8]>::escape_ascii instead of core::ascii::escape_defaultKaDiWa-9/+1
2022-08-19Rollup merge of #100081 - RalfJung:unused-unsafe-in-unsafe-fn, r=jackh726Dylan DPC-20/+2
never consider unsafe blocks unused if they would be required with deny(unsafe_op_in_unsafe_fn) Judging from https://github.com/rust-lang/rust/issues/71668#issuecomment-1200317370 the consensus nowadays seems to be that we should never consider an unsafe block unused if it was required with `deny(unsafe_op_in_unsafe_fn)`, no matter whether that lint is actually enabled or not. So let's adjust rustc accordingly. The first commit does the change, the 2nd does some cleanup.
2022-08-18Rollup merge of #99966 - RalfJung:try-dont-panic, r=lcnrMatthias Krüger-1/+3
avoid assertion failures in try_to_scalar_int Given that this is called `try_to_scalar_int`, we probably shouldn't `assert_int` here. Similarly `try_to_bits` also doesn't `assert!` that the size is correct. Also add some `track_caller` for debugging, while we are at it. r? ```@oli-obk```
2022-08-09Add option to `mir::MutVisitor` to not invalidate CFG.Jakob Degen-63/+92
This also applies that option to some uses of the visitor
2022-08-04Rollup merge of #100095 - jackh726:early-binder, r=lcnrMatthias Krüger-0/+6
More EarlyBinder cleanups Each commit is independent r? types