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

Require all Proxied types to be Sized. #17310

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Conversation

copybara-service[bot]
Copy link

Require all Proxied types to be Sized.

This is currently true and required by the IntoProxied trait. In Rust all type parameters are explicitly marked Sized, except for Self [1]. By marking Proxied as Sized we can write IntoProxied<Self> in generic code without having to add 'where Self: Sized` clauses.

An implication of this change is that Proxied can no longer be used from a trait object i.e. let x: dyn &Proxied = &foo will not compile. We are not anticipating such use cases at this point.

[1] https://doc.rust-lang.org/std/marker/trait.Sized.html

This is currently true and required by the IntoProxied trait. In Rust all type parameters are explicitly marked `Sized`, except for `Self` [1]. By marking `Proxied` as `Sized` we can write `IntoProxied<Self>` in generic code without having to add 'where Self: Sized` clauses.

An implication of this change is that Proxied can no longer be used from a trait object i.e. `let x: dyn &Proxied = &foo` will not compile. We are not anticipating such use cases at this point.

[1] https://doc.rust-lang.org/std/marker/trait.Sized.html

PiperOrigin-RevId: 649010900
@copybara-service copybara-service bot merged commit 73db255 into main Jul 3, 2024
@copybara-service copybara-service bot deleted the test_648705298 branch July 3, 2024 10:29
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