Skip to content

rustc: Remove ~[T] from the language #14703

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

Merged
merged 1 commit into from
Jun 12, 2014

Conversation

alexcrichton
Copy link
Member

The following features have been removed

  • box [a, b, c]
  • ~[a, b, c]
  • box [a, ..N]
  • ~[a, ..N]
  • ~[T] (as a type)
  • deprecated_owned_vector lint

All users of ~[T] should move to using Vec instead.

@sfackler
Copy link
Member

sfackler commented Jun 6, 2014

When you say that box [a, b, c] and box [a, ..N] have been removed, are they actually errors or do they just return Box<[T, ..N]> (maybe Box<&[T]>)?

@alexcrichton
Copy link
Member Author

For now they both signal a parser error, but after awhile I'd like to remove the parser hacks and allow them to become Box<[T, ..N]>. I just wanted to remove them to completely purge this type of vector from the language so we have a clean state to add it back in.

@sfackler
Copy link
Member

sfackler commented Jun 6, 2014

Sounds good to me.

@@ -1510,52 +1519,6 @@ pub fn unzip<T, U, V: Iterator<(T, U)>>(mut iter: V) -> (Vec<T>, Vec<U>) {
(ts, us)
}

/// Mechanism to convert from a `Vec<T>` to a `[T]`.
Copy link
Member

Choose a reason for hiding this comment

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

I was under the impression this was meant to be a long term thing?

Copy link
Member Author

Choose a reason for hiding this comment

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

As with Box<[T, ..N]>, I figured this could be added back in a principled manner once DST landed. Do you think we should leave the trait definition for now?

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine with it disappearing... if there's a need for it in future then it can reappear then.

@huonw
Copy link
Member

huonw commented Jun 7, 2014

Nice diffstat. ❤️

@nrc
Copy link
Member

nrc commented Jun 7, 2014

I'm in the middle of doing this properly for the DST work. I find it useful to preserve existing behaviour rather than rip it out and start again (in particular, there are bugs I've found purely because we have this stuff in the libraries and which we did not have tests for, I'm sure it will happen again). Is there any urgency for doing this right now?

@chris-morgan
Copy link
Member

@nick29581 The existence of both ~str and String and both ~[T] and Vec<T> is certainly confusing people. (More the former pair than the latter, but confusion about the latter is still certainly palpable.)

@alexcrichton
Copy link
Member Author

I'd like to take the same route as ~str and add back in Box<[T]> in a more principled fashion after some more dust has settled with Vec<T>. I'm not convinced that the public-facing api components of ~[T] are what we want to keep into the future anyway.

The following features have been removed

* box [a, b, c]
* ~[a, b, c]
* box [a, ..N]
* ~[a, ..N]
* ~[T] (as a type)
* deprecated_owned_vector lint

All users of ~[T] should move to using Vec<T> instead.
bors added a commit that referenced this pull request Jun 11, 2014
The following features have been removed

* `box [a, b, c]`
* `~[a, b, c]`
* `box [a, ..N]`
* `~[a, ..N]`
* `~[T]` (as a type)
* deprecated_owned_vector lint

All users of ~[T] should move to using Vec<T> instead.
@bors bors closed this Jun 12, 2014
@bors bors merged commit 3316b1e into rust-lang:master Jun 12, 2014
@alexcrichton alexcrichton deleted the no-more-owned-vectors branch June 13, 2014 04:16
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
…tering, r=lnicola

fix: generate delegate methods filters out functions that already exist on the struct's impls

fixes rust-lang#14703
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 this pull request may close these issues.

6 participants