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

DST: trait objects should automatically implement the trait #19187

Closed
aturon opened this issue Nov 21, 2014 · 6 comments
Closed

DST: trait objects should automatically implement the trait #19187

aturon opened this issue Nov 21, 2014 · 6 comments
Assignees
Labels
A-dst Area: Dynamically Sized Types A-traits Area: Trait system

Comments

@aturon
Copy link
Member

aturon commented Nov 21, 2014

This is a planned part of DST. Example from RFC:

fn foo<Sized? T: SomeTrait>(y: &T) { ... }

fn bar(x: &SomeTrait) {
    foo(x)
}

should be permitted even if there is no explicit impl of SomeTrait for &SomeTrait.

@aturon
Copy link
Member Author

aturon commented Nov 21, 2014

cc @nick29581

@nrc nrc mentioned this issue Nov 21, 2014
23 tasks
@kmcallister kmcallister added A-traits Area: Trait system A-dst Area: Dynamically Sized Types labels Nov 23, 2014
@nrc
Copy link
Member

nrc commented Nov 23, 2014

cc @nikomatsakis (last I heard he was starting to implement this)

@eddyb
Copy link
Member

eddyb commented Nov 30, 2014

This seems perilous, especially around corner cases like Any.
Has there been an explanation for how this feature can be implemented so it isn't prone to creating unsoundness?

@aturon
Copy link
Member Author

aturon commented Dec 1, 2014

@eddyb Can you elaborate? This was part of the motivation for the "object safety" RFC I mentioned, which should also guarantee that this can only be done in appropriate cases.

@nikomatsakis nikomatsakis self-assigned this Dec 15, 2014
@nikomatsakis
Copy link
Contributor

I'm working on this, yes.

@nikomatsakis
Copy link
Contributor

This was implemented in #20341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dst Area: Dynamically Sized Types A-traits Area: Trait system
Projects
None yet
Development

No branches or pull requests

5 participants