-
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
Removed ~str pattern #12756
Removed ~str pattern #12756
Conversation
Can we have a longer commit message? e.g. explaining a bit about why this is disappearing. |
Updated. |
The commit message isn't quite accurate. To the best of my knowledge we will never get matching on This is the commit message that I was thinking of:
cc @pcwalton |
I was talking to eddyb over the IRC and that's the impression I got. Of course, I might have just misunderstood him. I'll update the commit message once we get confirmation from @pcwalton |
The `~str` type is not long for this world as it will be superseded by the soon-to-come DST changes for the language. The new type will be `~Str`, and matching over the allocation will no longer be supported. Matching on `&str` will continue to work, in both a pre and post DST world.
@alexcrichton Changed commit message and rebased! |
match-drop-strs-issue-4541.rs deleted as it's the same with issue-4541.rs
…xendoo Avoid emitting `assigning_clones` when cloned data borrows from the place to clone into Fixes rust-lang#12444 Fixes rust-lang#12460 Fixes rust-lang#12749 Fixes rust-lang#12757 Fixes rust-lang#12929 I think the documentation for the function should describe what- and how this is fixing the issues well. It avoids emitting a warning when the data being cloned borrows from the place to clone into, which is information that we can get from `PossibleBorrowerMap`. Unfortunately, it is a tiny bit tedious to match on the MIR like that and I'm not sure if this is possibly relying a bit too much on the exact MIR lowering for assignments. Things left to do: - [x] Handle place projections (or verify that they work as expected) - [x] Handle non-`Drop` types changelog: [`assigning_clones`]: avoid warning when the suggestion would lead to a borrow-check error
match-drop-strs-issue-4541.rs deleted as it's the same with issue-4541.rs