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

Specifying a type to use for parameter-less "static" default methods in a trait #17

Closed
SimonSapin opened this issue Sep 2, 2013 · 3 comments · Fixed by #58
Closed

Comments

@SimonSapin
Copy link
Member

<T> in this line is no longer valid in Rust master:
https://github.com/mozilla-servo/rust-core-foundation/blob/1f43d00330/base.rs#L57

Having a dummy parameter of type Option<Self> could work, but refactoring across repositories this will be a pain. (Not to mention how ugly it is.)

SimonSapin added a commit to SimonSapin/rust-core-foundation that referenced this issue Sep 3, 2013
@SimonSapin
Copy link
Member Author

The #18 pull request uses that work around for now.

Possibly related:

rust-lang/rust#6894
rust-lang/rust#8888

@zummenix
Copy link
Contributor

Now this is possible to remove dummy parameter in type_id function:

fn type_id(dummy: Option<Self>) -> CFTypeID;

I was thinking about deprecation of this function and adding new one but I can't to come up with new name.

@SimonSapin
Copy link
Member Author

I don’t think we’re making any API stability promises for this library. Feel free to just remove the dummy parameter. If you also want to patch Servo and related libraries to use this change, that’d be great!

zummenix added a commit to zummenix/rust-core-foundation that referenced this issue Feb 18, 2015
Closes servo#17
Now call like:
`let id = <CFBoolean as TCFType<_>>::type_id();`

[breaking-change]
jdm pushed a commit that referenced this issue Feb 1, 2018
Introduce a more convenient notation and embrace dynamic typing.
jdm pushed a commit that referenced this issue Feb 1, 2018
Build with make instead of rustpkg.
jdm pushed a commit that referenced this issue Feb 1, 2018
jdm pushed a commit that referenced this issue Feb 1, 2018
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 a pull request may close this issue.

2 participants