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

Remove ~, add Box #13885

Closed
alexcrichton opened this issue May 2, 2014 · 6 comments

Comments

Projects
None yet
4 participants
@alexcrichton
Copy link
Member

commented May 2, 2014

Tracking issue for rust-lang/rfcs#59

renato-zannon added a commit to renato-zannon/rust-bindgen that referenced this issue May 2, 2014

Fix build on 0.11pre: Change ~"foo" to "foo".to_owned()
[~"string" and &"string" literals are gone](rust-lang/rust#13877), and were
replaced by "string".to_owned() and just "string", respectively. This commit was made by a simple
`sed` to convert the existing instances of ~"string" on the codebase.

For reference, the command used was this:

    sed -e 's/~\("[^"]*"\)/\1.to_owned()/g' -i *.rs

That wouldn't work if for strings that contain the `\"` escape in them, but this codebase had none.

Similar work is likely to be necessary after [~T is substituted by
Box<T>](rust-lang/rust#13885).

bors added a commit that referenced this issue May 3, 2014

@alexcrichton

This comment has been minimized.

Copy link
Member Author

commented May 21, 2014

Nominating.

@pnkfelix

This comment has been minimized.

Copy link
Member

commented May 22, 2014

Assigning P-backcompat-lang, 1.0.

@pnkfelix pnkfelix added this to the 1.0 milestone May 22, 2014

@sfackler

This comment has been minimized.

Copy link
Member

commented Jul 3, 2014

Down with sigils!

@sfackler sfackler closed this Jul 3, 2014

@alexcrichton

This comment has been minimized.

Copy link
Member Author

commented Jul 3, 2014

There's actually one more thing remaining, ~self, and I believe @pcwalton wanted to keep this open to track the progress on that (but we're almost there!)

@alexcrichton alexcrichton reopened this Jul 3, 2014

@pcwalton

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2014

Yes, this is not totally done yet. I have a patch that needs to wait on deciding what to do with regions that don't have their variance inferred yet (but I think I know what I want to do).

pcwalton added a commit to pcwalton/rust that referenced this issue Jul 8, 2014

librustc: Implement the fully-expanded, UFCS form of explicit self.
This makes two changes to region inference: (1) it allows region
inference to relate early-bound regions; and (2) it allows regions to be
related before variance runs. The former is needed because there is no
relation between the two regions before region substitution happens,
while the latter is needed because type collection has to run before
variance. We assume that, before variance is inferred, that lifetimes
are invariant. This is a conservative overapproximation.

This relates to rust-lang#13885. This does not remove `~self` from the language
yet, however.

[breaking-change]

pcwalton added a commit to pcwalton/rust that referenced this issue Jul 8, 2014

librustc: Implement the fully-expanded, UFCS form of explicit self.
This makes two changes to region inference: (1) it allows region
inference to relate early-bound regions; and (2) it allows regions to be
related before variance runs. The former is needed because there is no
relation between the two regions before region substitution happens,
while the latter is needed because type collection has to run before
variance. We assume that, before variance is inferred, that lifetimes
are invariant. This is a conservative overapproximation.

This relates to rust-lang#13885. This does not remove `~self` from the language
yet, however.

[breaking-change]

pcwalton added a commit to pcwalton/rust that referenced this issue Jul 17, 2014

librustc: Implement the fully-expanded, UFCS form of explicit self.
This makes two changes to region inference: (1) it allows region
inference to relate early-bound regions; and (2) it allows regions to be
related before variance runs. The former is needed because there is no
relation between the two regions before region substitution happens,
while the latter is needed because type collection has to run before
variance. We assume that, before variance is inferred, that lifetimes
are invariant. This is a conservative overapproximation.

This relates to rust-lang#13885. This does not remove `~self` from the language
yet, however.

[breaking-change]

pcwalton added a commit to pcwalton/rust that referenced this issue Jul 17, 2014

librustc: Implement the fully-expanded, UFCS form of explicit self.
This makes two changes to region inference: (1) it allows region
inference to relate early-bound regions; and (2) it allows regions to be
related before variance runs. The former is needed because there is no
relation between the two regions before region substitution happens,
while the latter is needed because type collection has to run before
variance. We assume that, before variance is inferred, that lifetimes
are invariant. This is a conservative overapproximation.

This relates to rust-lang#13885. This does not remove `~self` from the language
yet, however.

[breaking-change]
@pcwalton

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2014

Looks like #14022 is going to land, so now we just need a snapshot to finish this up.

pcwalton added a commit to pcwalton/rust that referenced this issue Jul 23, 2014

libsyntax: Remove `~self` and `mut ~self` from the language.
This eliminates the last vestige of the `~` syntax.

Instead of `~self`, write `self: Box<TypeOfSelf>`; instead of `mut
~self`, write `mut self: Box<TypeOfSelf>`, replacing `TypeOfSelf` with
the self-type parameter as specified in the implementation.

Closes rust-lang#13885.

[breaking-change]

@pcwalton pcwalton closed this in bb165eb Jul 24, 2014

Gankro added a commit to Gankro/rust that referenced this issue Jul 28, 2014

libsyntax: Remove `~self` and `mut ~self` from the language.
This eliminates the last vestige of the `~` syntax.

Instead of `~self`, write `self: Box<TypeOfSelf>`; instead of `mut
~self`, write `mut self: Box<TypeOfSelf>`, replacing `TypeOfSelf` with
the self-type parameter as specified in the implementation.

Closes rust-lang#13885.

[breaking-change]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.