rust/compiler/rustc_middle/src
bors 146dafa262 Auto merge of #114208 - GKFX:offset_of_enum, r=wesleywiser
Support enum variants in offset_of!

This MR implements support for navigating through enum variants in `offset_of!`, placing the enum variant name in the second argument to `offset_of!`. The RFC placed it in the first argument, but I think it interacts better with nested field access in the second, as you can then write things like

```rust
offset_of!(Type, field.Variant.field)
```

Alternatively, a syntactic distinction could be made between variants and fields (e.g. `field::Variant.field`) but I'm not convinced this would be helpful.

[RFC 3308 # Enum Support](https://rust-lang.github.io/rfcs/3308-offset_of.html#enum-support-offset_ofsomeenumstructvariant-field_on_variant)
Tracking Issue #106655.
2023-11-01 14:17:56 +00:00
..
dep_graph Move DepKind to rustc_query_system and define it as u16 2023-09-21 17:06:14 +02:00
hir Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillot 2023-10-23 09:59:40 +00:00
hooks Turn const_caller_location from a query to a hook 2023-10-31 16:15:18 +00:00
infer Uplift Canonical to rustc_type_ir 2023-10-25 16:25:09 +00:00
middle Add method for checking if deprecation is a rustc version 2023-10-30 17:13:38 -07:00
mir Auto merge of #114208 - GKFX:offset_of_enum, r=wesleywiser 2023-11-01 14:17:56 +00:00
query Turn const_caller_location from a query to a hook 2023-10-31 16:15:18 +00:00
thir Address review comments 2023-10-16 15:58:01 +00:00
traits Make gen blocks implement the Iterator trait 2023-10-27 13:05:48 +00:00
ty Auto merge of #114208 - GKFX:offset_of_enum, r=wesleywiser 2023-11-01 14:17:56 +00:00
util Merge ExternProviders into the general Providers struct 2023-09-22 20:15:34 +00:00
arena.rs Implement Deref<LayoutS> for Layout 2023-10-02 21:31:16 +02:00
error.rs don't point at const usage site for resolution-time errors 2023-09-14 22:34:05 +02:00
lib.rs s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
lint.rs give FutureIncompatibilityReason variants more explicit names 2023-09-22 08:51:18 +02:00
macros.rs Rename CloneLiftImpls as TrivialLiftImpls. 2023-09-18 09:37:09 +10:00
metadata.rs rustc_metadata: Remove Span from ModChild 2023-04-18 17:25:04 +03:00
tests.rs
thir.rs Auto merge of #114208 - GKFX:offset_of_enum, r=wesleywiser 2023-11-01 14:17:56 +00:00
values.rs Format all the let chains in compiler 2023-10-13 08:59:36 +00:00