-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength #78934
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
☔ The latest upstream changes (presumably #78920) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
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.
Thanks for working on this!
I have verified everything up to 643b7d8 just moves things unmodified, except for a few pub
s and some formatting changes.
I have a few comments:
library/alloc/src/vec/mod.rs
Outdated
macro_rules! __impl_slice_eq1 { | ||
([$($vars:tt)*] $lhs:ty, $rhs:ty $(where $ty:ty: $bound:ident)?, #[$stability:meta]) => { | ||
#[$stability] | ||
impl<A, B, $($vars)*> PartialEq<$rhs> for $lhs | ||
where | ||
A: PartialEq<B>, | ||
$($ty: $bound)? | ||
{ | ||
#[inline] | ||
fn eq(&self, other: &$rhs) -> bool { self[..] == other[..] } | ||
#[inline] | ||
fn ne(&self, other: &$rhs) -> bool { self[..] != other[..] } | ||
} | ||
} | ||
} | ||
|
||
__impl_slice_eq1! { [] Vec<A>, Vec<B>, #[stable(feature = "rust1", since = "1.0.0")] } |
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 think it'd be good to keep macros like this and their list of invocations together.
Maybe instead of a macros.rs
, there could be a slice_eq.rs
or something like that.
where | ||
F: FnMut(&mut T) -> bool, | ||
{ | ||
pub(crate) vec: &'a mut Vec<T>, |
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.
@KodrAus said on zulip:
Hmm, I feel like PRs that are splitting up large modules into smaller child ones that use mostly
pub(super)
orpub(crate)
internals could be missing an opportunity to define better privacy boundaries 🤔
It'd be good to see if we can avoid making these all pub(crate)
. pub(super)
would already be a bit better, but it'd be good to check if we can make these private, possibly by adding a pub(super)
function or two, depending on what the parent module actually needs.
If that's a lot of work, it would be okay to just merge this with pub(super)
to avoid bitrot/merge conflicts, and fix it up in a smaller follow-up PR.
@@ -0,0 +1,34 @@ | |||
use crate::borrow::Cow; |
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.
It might be good to just name this file cow.rs
. I think the word Cow
is more recognizable in Rust than clone_on_write
.
It would be good if we could wait to merge the PR until #78461 has landed, as many things of |
Hi @m-ou-se thanks for your review and the comments 👍 I will take your comments onboard and fix up my PR. I will just wait until @TimDiekmann 's #78461 has been merged. @TimDiekmann any idea on the timeline or other PR's I should wait on? |
Thanks for your consideration! I don't think you have to be considerate of other PRs. Most likely |
☔ The latest upstream changes (presumably #78461) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
@m-ou-se Hey! Sorry it took me a while to get this PR updated. I followed your suggestion and used Thanks, |
☔ The latest upstream changes (presumably #73210) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
☔ The latest upstream changes (presumably #80449) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Thanks a lot for working on this! And sorry for the delay.
This looks great! I have one tiny nit:
library/alloc/src/vec/into_iter.rs
Outdated
/// This `struct` is created by the `into_iter` method on [`super::Vec`] (provided | ||
/// by the [`IntoIterator`] trait). |
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.
This link used to be [`Vec`]
. Let's keep the visible text the same:
/// This `struct` is created by the `into_iter` method on [`super::Vec`] (provided | |
/// by the [`IntoIterator`] trait). | |
/// This `struct` is created by the `into_iter` method on [`Vec`](super::Vec) | |
/// (provided by the [`IntoIterator`] trait). |
I'll just commit my suggestion and approve your PR, to not delay it any further. Hope you don't mind. :) @bors r+ |
📌 Commit 16834a8 has been approved by |
Thank you for your review and for fixing the documentation link for me! 👍 |
Rollup of 9 pull requests Successful merges: - rust-lang#78934 (refactor: removing library/alloc/src/vec/mod.rs ignore-tidy-filelength) - rust-lang#79479 (Add `Iterator::intersperse`) - rust-lang#80128 (Edit rustc_ast::ast::FieldPat docs) - rust-lang#80424 (Don't give an error when creating a file for the first time) - rust-lang#80458 (Some Promotion Refactoring) - rust-lang#80488 (Do not create dangling &T in Weak<T>::drop) - rust-lang#80491 (Miri: make size/align_of_val work for dangling raw ptrs) - rust-lang#80495 (Rename kw::Invalid -> kw::Empty) - rust-lang#80513 (Add regression test for rust-lang#80062) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
@DeveloperC286 @m-ou-se this seems to be the cause of a slight perf regression as you can see in #80814 I assume this is likely a change in inlining which often happens when moving things around. We should look into if we can gain some of that perf lost back. |
This PR removes the need for ignore-tidy-filelength for library/alloc/src/vec/mod.rs which is part of the issue #60302
It is probably easiest to review this PR by looking at it commit by commit rather than looking at the overall diff.