Skip to content

publicly export constraint::Constraint but seal it#35

Open
changhe3 wants to merge 2 commits into
olson-sean-k:masterfrom
changhe3:sealed_constraint_trait
Open

publicly export constraint::Constraint but seal it#35
changhe3 wants to merge 2 commits into
olson-sean-k:masterfrom
changhe3:sealed_constraint_trait

Conversation

@changhe3

@changhe3 changhe3 commented Sep 7, 2021

Copy link
Copy Markdown

Currently you cannot meaningfully implement trait or inherent implementations with respect to Proxy<T, P> since you cannot name P: Constraint<T>. By sealing it, only the crate itself can directly implement the Constraint trait, but everyone else can write things like:

impl<T, P: Constraint<T>> SomeTrait<Proxy<T, P>> for MyStruct {}

@changhe3 changhe3 marked this pull request as ready for review September 7, 2021 18:28
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