rust/compiler/stable_mir/src
bors 698fcc8219 Auto merge of #117517 - klinvill:smir-projections, r=ouz-a
Add richer structure for Stable MIR Projections

Resolves https://github.com/rust-lang/project-stable-mir/issues/49.

Projections in Stable MIR are currently just strings. This PR replaces that representation with a richer structure, namely projections become vectors of `ProjectionElem`s, just as in MIR. The `ProjectionElem` enum is heavily based off of the MIR `ProjectionElem`.

This PR is a draft since there are several outstanding issues to resolve, including:

- How should `UserTypeProjection`s be represented in Stable MIR? In MIR, the projections are just a vector of `ProjectionElem<(),()>`, meaning `ProjectionElem`s that don't have Local or Type arguments (for `Index`, `Field`, etc. objects). Should `UserTypeProjection`s be represented this way in Stable MIR as well? Or is there a more user-friendly representation that wouldn't drag along all the `ProjectionElem` variants that presumably can't appear?
- What is the expected behavior of a `Place`'s `ty` function? Should it resolve down the chain of projections so that something like `*_1.f` would return the type referenced by field `f`?
- Tests should be added for `UserTypeProjection`
2023-11-15 06:05:54 +00:00
..
mir Make UserTypeProjection projections Opaque 2023-11-14 19:19:35 -07:00
error.rs Add stable Instance::body() and RustcInternal trait 2023-10-19 17:12:26 -07:00
lib.rs Add a stable MIR visitor 2023-10-30 13:11:14 -07:00
mir.rs Add a stable MIR visitor 2023-10-30 13:11:14 -07:00
ty.rs Auto merge of #117787 - ouz-a:smir_coroutinewitness, r=celinval 2023-11-14 13:10:25 +00:00
visitor.rs add CoroutineWitness to covered types 2023-11-10 17:02:08 +03:00