# \[Pre-RFC\] Scoped \`impl Trait for Type\`

**URL:** <https://internals.rust-lang.org/t/pre-rfc-scoped-impl-trait-for-type/19923>\
**Category:** language design\
**Created:** [November 26, 2023, 4:59am UTC](https://internals.rust-lang.org/t/pre-rfc-scoped-impl-trait-for-type/19923 "2023-11-26T04:59:26Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![Tamschi](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/tamschi/32/11541_2.png) [@Tamschi](https://internals.rust-lang.org/u/Tamschi)\
**Post date:** [March 7, 2024, 8:08am UTC](https://internals.rust-lang.org/t/pre-rfc-scoped-impl-trait-for-type/19923/29 "2024-03-07T08:08:31Z")

</div>

Hello! I'm still working on this.  
(I took a holiday break, then unrelatedly got sick, then was extremely busy for a while.)

I pushed another update (v5, [diff](https://github.com/Tamschi/rust-rfcs/commit/483f22a34b5adaecef8715a09f1cd630320ea051)) that (hopefully) clarifies when monomorphisation happens and when it does not.

Changes:

- Added section ["(Pending changes to this draft)"](https://github.com/Tamschi/rust-rfcs/blob/483f22a34b5adaecef8715a09f1cd630320ea051/text/0000-scoped-impl-trait-for-type.md#pending-changes-to-this-draft), since I haven't gotten around to inserting explicit binding yet but want to clarify that it's coming to the draft.
- Revised ["`TypeId` of generic type parameters' opaque types"](https://github.com/Tamschi/rust-rfcs/blob/483f22a34b5adaecef8715a09f1cd630320ea051/text/0000-scoped-impl-trait-for-type.md#typeid-of-generic-type-parameters-opaque-types) as tuples are implementation-invariant.
- Replaced section "Contextual monomorphisation of generic implementations and generic functions" with sections ["Binding choice by implementations' bounds"](https://github.com/Tamschi/rust-rfcs/blob/483f22a34b5adaecef8715a09f1cd630320ea051/text/0000-scoped-impl-trait-for-type.md#binding-choice-by-implementations-bounds) and ["Binding and generics"](https://github.com/Tamschi/rust-rfcs/blob/483f22a34b5adaecef8715a09f1cd630320ea051/text/0000-scoped-impl-trait-for-type.md#binding-and-generics).
- Added sections ["Marking a generic as implementation-invariant is a breaking change"](https://github.com/Tamschi/rust-rfcs/blob/483f22a34b5adaecef8715a09f1cd630320ea051/text/0000-scoped-impl-trait-for-type.md#marking-a-generic-as-implementation-invariant-is-a-breaking-change) and ["Efficient compilation"](https://github.com/Tamschi/rust-rfcs/blob/483f22a34b5adaecef8715a09f1cd630320ea051/text/0000-scoped-impl-trait-for-type.md#efficient-compilation).
- Renamed future possibilities section "Scoped bounds as contextual alternative to sealed traits" to ["Sealed trait bounds"](https://github.com/Tamschi/rust-rfcs/blob/483f22a34b5adaecef8715a09f1cd630320ea051/text/0000-scoped-impl-trait-for-type.md#sealed-trait-bounds).
- Added future possibilities section ["Reusable limited-access APIs"](https://github.com/Tamschi/rust-rfcs/blob/483f22a34b5adaecef8715a09f1cd630320ea051/text/0000-scoped-impl-trait-for-type.md#reusable-limited-access-apis).
- a range of smaller adjustments to wording and formatting

I will likely still need a few weeks to work explicit binding into the proposal properly though, since I still have a stack of pending organisational work sitting next to me here. That said, this version of the draft should be consistent (as far as I can tell, which is to say it's ready to have holes poked into it again).

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-scoped-impl-trait-for-type/19923)._
