Skip to content

It's not possible to create Paths allocation-free #18372

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
heinrich5991 opened this issue Oct 27, 2014 · 3 comments
Closed

It's not possible to create Paths allocation-free #18372

heinrich5991 opened this issue Oct 27, 2014 · 3 comments
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@heinrich5991
Copy link

  1. There is no way to create a Path object to pass to File::open statically, it's always a runtime allocation.
  2. File::open takes a Path object as reference, although it only clones it afterwards.

Solutions to this would include creating a Path DST object (possibly combined with a PathVec which can grow dynamically).

@thestinger thestinger added I-slow Issue: Problems and improvements with respect to performance of generated code. A-libs labels Oct 27, 2014
@alexcrichton
Copy link
Member

This was resolved with the new std::fs design via AsPath.

@tbu-
Copy link
Contributor

tbu- commented Feb 11, 2015

@alexcrichton The first part of the issue was resolved ("no way to pass a static path object"), but the second part wasn't ("File::open still takes the path as reference and clones it afterwards"). Should I open a new issue for it?

@alexcrichton
Copy link
Member

@tbu- If you'd like to, sure.

lnicola pushed a commit to lnicola/rust that referenced this issue Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

5 participants