Skip to content
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

Reintroduce Ref lifetime type parameter #3448

Merged
merged 7 commits into from
Jan 16, 2025
Merged

Reintroduce Ref lifetime type parameter #3448

merged 7 commits into from
Jan 16, 2025

Conversation

kennykerr
Copy link
Collaborator

@kennykerr kennykerr commented Jan 15, 2025

Now that C++ delegates use Ref and OutRef to properly handle lifetime and ownership for callbacks (#3447), it became evident that Ref really should have a lifetime type parameter (#3433). Otherwise its impossible to safely construct a Ref on the call side. This does however mean that Ref can't be used as a type alias inside a trait (#3435) but since this was only being used for WinRT generics, it seems reasonable to favor making Ref safer over generic code that very few will encounter.

@kennykerr
Copy link
Collaborator Author

Note to self: GATs may be able to give us the best of both worlds.

@kennykerr kennykerr merged commit 021257c into master Jan 16, 2025
75 checks passed
@kennykerr kennykerr deleted the ref-lifetime branch January 16, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant