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

RFC for pre-1.0 prelude additions #1030

Merged
merged 1 commit into from
Apr 17, 2015

Conversation

aturon
Copy link
Member

@aturon aturon commented Apr 3, 2015

Add Default, IntoIterator and ToOwned trait to the prelude.

Rendered

Closes #942

@aturon
Copy link
Member Author

aturon commented Apr 3, 2015

cc @alexcrichton


* Add `Default`, `IntoIterator` and `ToOwned` trait to the prelude.

* Deprecate inherent `into_iter` methods.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to consider removing these methods entirely actually as it's difficult to call a trait method instead of an inherent method sometimes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, otherwise it would be quite painful to avoid the deprecation warnings.

That makes this even more of a "technically breaking" change, but again I suspect no code will actually break. Maybe a good trial for @brson's tool!

@nikomatsakis
Copy link
Contributor

We should definitely hold off on deprecating the IntoIter types, imo, not only until <Vec<T>>::IntoIter works but also until they can be imported into scope. I'm fine with adding IntoIter and Default to the prelude.

@strega-nil
Copy link

I agree with adding Default to the prelude.

@alexcrichton
Copy link
Member

The discussion here has been pretty light, but the response has been positive and many of these have been desired before. These are unlikely to break much code and we can cherry-pick into beta to facilitate the process as well. As a result, I've now merged this!

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 17, 2015
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes rust-lang#24538
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 17, 2015
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes rust-lang#24538
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 17, 2015
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes rust-lang#24538
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 17, 2015
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes rust-lang#24538
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 21, 2015
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes rust-lang#24538
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 22, 2015
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes rust-lang#24538
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 23, 2015
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes rust-lang#24538
cuviper pushed a commit to cuviper/rayon that referenced this pull request Mar 28, 2017
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes #24538
cuviper pushed a commit to cuviper/rayon that referenced this pull request Mar 28, 2017
This is an implementation of [RFC 1030][rfc] which adds these traits to the
prelude and additionally removes all inherent `into_iter` methods on collections
in favor of the trait implementation (which is now accessible by default).

[rfc]: rust-lang/rfcs#1030

This is technically a breaking change due to the prelude additions and removal
of inherent methods, but it is expected that essentially no code breaks in
practice.

[breaking-change]
Closes #24538
@Centril Centril added A-traits-libstd Standard library trait related proposals & ideas A-prelude Proposals relating to the prelude. labels Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-prelude Proposals relating to the prelude. A-traits-libstd Standard library trait related proposals & ideas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Eliminate redundant into_iter() functions in favor of IntoIterator
5 participants