rust/tests/ui-fulldeps
Matthias Krüger 67d8999d17
Rollup merge of #118516 - celinval:smir-variants, r=ouz-a
Add ADT variant infomation to StableMIR and finish implementing TyKind::internal()

Introduce a `VariantDef` type and a mechanism to retrieve the definition from an `AdtDef`.

The `VariantDef` representation itself is just a combination of `AdtDef` and `VariantIdx`, which allow us to retrieve further information of a variant. I don't think we need to cache extra information for now, and we can translate on an on demand manner. I am  leaving the fields public today due to https://github.com/rust-lang/project-stable-mir/issues/56, but they shouldn't. For this PR, I've only added a method to retrieve the variant name, and its fields. I also added an implementation of `RustcInternal` that allow users to retrieve more information using Rust internal APIs.

I have also finished the implementation of `RustcInternal` for `TyKind` which fixes https://github.com/rust-lang/project-stable-mir/issues/46.

## Motivation

Both of these changes are needed in order to properly interpret things like projections. For example,
- The variant definition is used to find out which variant we are downcasting to.
- Being able to create `Ty` from `TyKind` helps for example processing each stage of a projection, like the code in `place.ty()`.
2023-12-06 17:21:58 +01:00
..
auxiliary Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
fluent-messages Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
internal-lints Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
mod_dir_simple Move /src/test to /tests 2023-01-11 09:32:08 +00:00
session-diagnostic Use rustc_fluent_macro::fluent_messages! directly. 2023-11-26 08:38:40 +11:00
stable-mir Change ty_with_args to return Ty instead of Result 2023-12-05 12:03:44 -08:00
compiler-calls.rs Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
deriving-global.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
deriving-hygiene.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_tarena_sound_drop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck-tarena-cycle-checked.rs Bless ui-fulldeps 2023-11-24 21:56:22 +01:00
dropck-tarena-cycle-checked.stderr Bless ui-fulldeps 2023-11-24 21:56:22 +01:00
dropck-tarena-unsound-drop.rs Bless ui-fulldeps 2023-11-24 21:56:22 +01:00
dropck-tarena-unsound-drop.stderr Bless ui-fulldeps 2023-11-24 21:56:22 +01:00
empty-struct-braces-derive.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
hash-stable-is-unstable.rs Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
hash-stable-is-unstable.stderr Support x test --stage 1 ui-fulldeps 2023-04-17 22:40:31 -05:00
lint-pass-macros.rs Remove rustc_lint_defs::lint_array 2023-09-28 23:01:25 +02:00
missing-rustc-driver-error.rs Don't depend on crate names in tests/ui-fulldeps/missing-rustc-driver-error.rs 2023-07-11 22:30:28 -05:00
missing-rustc-driver-error.stderr Don't depend on crate names in tests/ui-fulldeps/missing-rustc-driver-error.rs 2023-07-11 22:30:28 -05:00
mod_dir_path_canonicalized.rs various: translation resources from cg backend 2023-02-22 09:15:54 +00:00
pathless-extern-unstable.rs Bless ui-fulldeps 2023-11-24 21:56:22 +01:00
pathless-extern-unstable.stderr Bless ui-fulldeps 2023-11-24 21:56:22 +01:00
pprust-expr-roundtrip.rs Fix some broken tests 2023-12-04 13:03:41 -08:00
regions-mock-tcx.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
rustc_encodable_hygiene.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00