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
Closed

Remove ~, add Box #13885

alexcrichton opened this issue May 2, 2014 · 6 comments
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented.
Milestone

Comments

@alexcrichton
Copy link
Member

Tracking issue for rust-lang/rfcs#59

renato-zannon added a commit to renato-zannon/rust-bindgen that referenced this issue May 2, 2014
[~"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
Copy link
Member Author

Nominating.

@pnkfelix
Copy link
Member

Assigning P-backcompat-lang, 1.0.

@pnkfelix pnkfelix added this to the 1.0 milestone May 22, 2014
@sfackler
Copy link
Member

sfackler commented Jul 3, 2014

Down with sigils!

@sfackler sfackler closed this as completed Jul 3, 2014
@alexcrichton
Copy link
Member Author

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
Copy link
Contributor

pcwalton 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 17, 2014
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
Copy link
Contributor

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
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]
arcnmx pushed a commit to arcnmx/rust that referenced this issue Jan 9, 2023
Skip lifetime elision on fn pointers and fn trait types

These currently don't work correctly, so it's better to not render them at all there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-RFC-approved Blocker: Approved by a merged RFC but not yet implemented.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants