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

alloc::range::RangeArgument → core::ops::RangeBounds #2552

Closed
SimonSapin opened this issue Mar 19, 2018 · 2 comments · Fixed by #2589
Closed

alloc::range::RangeArgument → core::ops::RangeBounds #2552

SimonSapin opened this issue Mar 19, 2018 · 2 comments · Fixed by #2589

Comments

@SimonSapin
Copy link
Contributor

rust-lang/rust#49163 proposes renaming and moving this trait, and Clippy contains:

src/tools/clippy/tests/ui/needless_pass_by_value.rs
118:// whitelist RangeArgument
119:fn range<T: ::std::collections::range::RangeArgument<usize>>(range: T) {

src/tools/clippy/clippy_lints/src/utils/paths.rs
58:pub const RANGE_ARGUMENT_TRAIT: [&str; 3] = ["alloc", "range", "RangeArgument"];

The former will likely only cause a deprecation warning, but the latter line might need to be updated top preserve lint behavior.

@SimonSapin
Copy link
Contributor Author

(That PR has not landed or been reviewed yet, though.)

@Manishearth
Copy link
Member

#2589

bors added a commit to rust-lang/rust that referenced this issue Mar 29, 2018
Rename RangeArgument to RangeBounds, move it and Bound to libcore

As proposed in the tracking issue: #30877

Changes to *stable* items:

* `core::ops::Bound` / `std::ops::Bound` is new
* `std::collections::Bound` is a deprecated reexport of it (does this actually cause a warning?)

Changes to *unstable* items

* `alloc::Bound` is gone
* `alloc::range::RangeArgument` is moved to `core::ops::RangeBounds` / `std::ops::RangeBounds`
* `alloc::range` is gone
* `std::collections::range::RangeArgument` is deprecated reexport, to be removed later
* `std::collections::range` is deprecated, to be removed later
* `impl RangeBounds<T> for Range{,From,To,Inclusive,ToInclusive}<&T>` are added

The idea of replacing this trait with a type to be used with `Into<_>` is left for future consideration / work.

(Fixes rust-lang/rust-clippy#2552.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants