-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Comments
[~"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).
Nominating. |
Assigning P-backcompat-lang, 1.0. |
Down with sigils! |
There's actually one more thing remaining, |
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). |
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]
Looks like #14022 is going to land, so now we just need a snapshot to finish this up. |
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]
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
Tracking issue for rust-lang/rfcs#59
The text was updated successfully, but these errors were encountered: