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

vec::init and tail should return slices #3593

Closed
brson opened this issue Sep 26, 2012 · 4 comments
Closed

vec::init and tail should return slices #3593

brson opened this issue Sep 26, 2012 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone

Comments

@brson
Copy link
Contributor

brson commented Sep 26, 2012

Right now they return a new vector.

@ghost
Copy link

ghost commented Oct 25, 2012

Can you say a bit more about this? I see from the code they return the result of calling the slice function but that does indeed appear to copy the vector. Do you mean that they should return a view?

@brson
Copy link
Contributor Author

brson commented Oct 25, 2012

The word 'slice' here is overloaded. &[T] is a 'slice' and the slice function is old and, imo, incorrectly returns new vectors instead of slices.

To be fair though, some people have advocated using 'view' to mean &[T] and leaving slice as is. I think that is a minority opinion though. In either case, I think init and tail should return &[T].

@sanxiyn
Copy link
Member

sanxiyn commented Mar 11, 2013

Did #5213 fix this?

@erickt
Copy link
Contributor

erickt commented Mar 11, 2013

@sanxiyn: Yep! Closing...

@erickt erickt closed this as completed Mar 11, 2013
bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue May 11, 2024
rename 'extern-so' to 'native-lib'

Calling "extern" functions is not super clear IMO (extern to what), but saying that we are calling "native" functions from inside the interpreter makes it very clear I think.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants