-
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
Move replace and swap to std::mem. Get rid of std::util #11956
Conversation
Everywhere except |
Sure thing. Will do. |
Fixed and rebased, please review the change. |
I'm slightly uncomfortable with how this turned out, having all these magical functions in scope automatically seems... interesting. I'd be curious what others think about this, but regardless I'll add this to the meeting agenda. |
Exactly! It does look a little bit strange to have functions come from nowhere. At the very least the |
@alexcrichton |
What's the verdict then? |
@brson and I were discussing this the other day, and we came to the conclusion that As a consequence, I would be in favor of this. |
There are a few things that are now hidden away in intrinsics that we might drop into @thestinger I'm curious what you think. |
Oh, I didn't realize this branch dealt with both |
IMHO moving
We may want to change that a little bit if those functions are going to be landed there. |
Rebased again and got rid of |
As mentioned #11956 (comment) I've taken some of the most commonly-used intrinsics and put them in a more logical place, reduced the amount of code looking in `unstable::intrinsics`. r? @thestinger
r+ from me, but I'd like another confirmation on destruction of |
r? @thestinger |
Needs a rebase. |
Also, it would be good to update the PR description with the final outcome of this re-organisation, because @bors copies that text into the git history. |
Rebased and the PR description updated. Please re-review. |
I accidentally found that some commits, e.g. #12143, had been lost in the various rebases of this patch. Please advise how to proceed. |
Turns out it needs yet another rebase. I'll inform this thread when it is done. |
The rebase is done. Hope this time it'll make to the master. |
match self { | ||
// Nothing to match on | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize you simply moved this implementation, but I don't understand the point of uninhabited()
. When would you ever call it? I don't see any calls in the rust repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly don't know. I'd suggest to handle it in another (new) ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the IRC conversation, and the fact that there are no callers in the rust repo, I would suggest deleting this method outright. It doesn't seem useful, and the docstring is certainly wrong. It can be re-added if someone comes up with a reason for its existence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll do it.
As part of this PR, I think
|
Looks good at this point, r+ from me, except I think that 3 of the last 4 commits (removing |
So they were squashed. |
Also move Void to std::any, move drop to std::mem and reexport in prelude.
Closes #7556. Also move ``std::util::Void`` to ``std::any::Void``. It makes more sense to me.
…arenthesis, r=Alexendoo [`doc_markdown`] Recognize words followed by empty parentheses `()` for quoting *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: [`doc_markdown`] Recognize words followed by empty parentheses for quoting, e.g. `func()`. --- Developers often write function/method names with trailing `()`, but `doc_markdown` lint did not consider that. Old clippy suggestion was not very good: ```patch -/// There is no try (do() or do_not()). +/// There is no try (do() or `do_not`()). ``` New behavior recognizes function names such as `do()` even they contain no `_`/`::`; and backticks are suggested outside of the `()`: ```patch -/// There is no try (do() or do_not()). +/// There is no try (`do()` or `do_not()`). ```
Closes #7556.
Also move
std::util::Void
tostd::any::Void
. It makes more sense to me.