Skip to content

trait types should require explicit pointer types #3173

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

Closed
brson opened this issue Aug 10, 2012 · 2 comments
Closed

trait types should require explicit pointer types #3173

brson opened this issue Aug 10, 2012 · 2 comments
Labels
A-type-system Area: Type system

Comments

@brson
Copy link
Contributor

brson commented Aug 10, 2012

Currently when you use a trait foo as a type it really means @foo. Like closures and vectors we should have more control over memory. Being able to cast to an &foo without copying would immediately make this style of polymorphism more useful.

Under this scheme you would probably be required to write a trait type as either @foo, ~foo, or &foo, and foo would be disallowed.

Simalarly, it would be useful if you could cast from a boxed type to a boxed trait without copying. That's probably a different issue though.

@jruderman
Copy link
Contributor

Related to #3157

@nikomatsakis
Copy link
Contributor

I would go so far as to say it's a dup.

celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
We should try to produce a source location wherever possible to ease
debugging and coverage reporting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

3 participants