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

RangeBounds<T> impl for Range*<&T> is missing ?Sized #64027

Closed
talchas opened this issue Aug 30, 2019 · 4 comments
Closed

RangeBounds<T> impl for Range*<&T> is missing ?Sized #64027

talchas opened this issue Aug 30, 2019 · 4 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@talchas
Copy link

talchas commented Aug 30, 2019

Much like the impl for (Bounds<&T>, Bounds<&T>), impl<T> RangeBounds<T> for RangeFrom<&T> { could use a T: ?Sized. This would allow

let map = BTreeMap::<String, i32>::new()
map.range::<str, _>("a"..);

to compile the way it does when using Bound. (Unfortunately I think the turbofish is still needed, and I don't see any better way to use range on a String)

(Range and RangeTo of course also would want this)

@kungfukennyg
Copy link
Contributor

This sounds straightforward -- would this be a good issue for someone relatively new to contributing?

@Mark-Simulacrum
Copy link
Member

Yes, I think a PR here is the best way to go, probably we'd want to add ?Sized to all the RangeBounds impls

@Mark-Simulacrum Mark-Simulacrum added C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Aug 31, 2019
@scottmcm scottmcm added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Sep 2, 2019
@ThatsNoMoon
Copy link

Based on the reception to #64327, should this be closed? I ran into this trying to use BTreeMap::range, but it doesn't seem like this implementation is practical/desired.

@Dylan-DPC
Copy link
Member

Closing this based on the comments in #64327

@Dylan-DPC Dylan-DPC closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants