Files
rust/compiler
Jonathan Brouwer 8d19cc0dfa Rollup merge of #162881 - Zalathar:impl-decoder, r=nnethercote
Simplify the macro for forwarding Decoder methods

The old name `implement_ty_decoder!` historically made some sense, but nowadays is quite misleading for a macro that only forwards Decoder methods.

Requiring the caller to provide the `impl` block makes the calling code clearer, while also reducing the complexity of dealing with generics. The downside is a little less context at the macro-definition site, which seems fine.

The closure-like syntax allows for arbitrary expressions involving `self`, without running into hygiene problems and without requiring separate closures for `&self` and `&mut self` methods. It also works well with IDE hover hints.

---

A follow-up commit then removes Deref/DerefMut from MetadataDecodeContext, which was made possible by the main commit.

---

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
2026-09-17 16:51:02 +02:00
..
2026-09-15 23:07:25 +02:00
2026-09-17 06:52:28 +02:00
2026-09-17 06:52:28 +02:00