Skip to content

Update opaque-types-type-alias-impl-trait.md #2429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smanilov
Copy link
Contributor

@smanilov smanilov commented May 30, 2025

  1. Clarify that there is a single concrete type for an opaque type
  2. Clarify that defining a type alias to an opaque type is an unstable feature
  3. Add complete example
  4. Clarify that defining an associate type as opaque is an unstable
    feature
  5. Add another complete example

I struggled quite a bit with this one and chatbots failed to help, so I'm pretty confident a complete example is warranted here 😅

I'm a little concerned that the #[define_opaque(Foo)] annotation is needed on the standalone function, but not on the member function (method). Could this be a bug?

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label May 30, 2025
@smanilov smanilov force-pushed the patch-18 branch 2 times, most recently from 31613b1 to 758b47b Compare May 30, 2025 12:48
1. Clarify that there is a single concrete type for an opaque type
2. Clarify that defining a type alias to an opaque type is an unstable feature
3. Add complete example
4. Clarify that defining an associate type as opaque is an unstable
   feature
5. Add another complete example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content T-types Relevant to types team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants