-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Merge ast::Mutability
and mir::Mutability
#67355
Conversation
This comment has been minimized.
This comment has been minimized.
N.B. This will break Clippy so merging should wait a bit. |
@@ -2101,8 +2101,8 @@ impl Clean<Item> for doctree::Constant<'_> { | |||
impl Clean<Mutability> for hir::Mutability { | |||
fn clean(&self, _: &DocContext<'_>) -> Mutability { | |||
match self { | |||
&hir::Mutability::Mutable => Mutable, |
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.
why has rustdoc its own mutability enum?
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.
Something rustdoc-wants-to-be-more-independent something something, cc @GuillaumeGomez
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.
We do it for all hir types. If it can be removed, everyone will be happy though. ;)
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.
Don't see why it couldn't be removed; should be quite easy.
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 didn't look (and still haven't) so I don't know if it's possible or not. The idea behind clean
rustdoc types is to provide a type with direct access to what rustdoc needs. If the rustdoc type doesn't provide anything more than the original, then it can (and should) be removed. Might be worth opening an issue about this.
@@ -1083,7 +1083,7 @@ impl<'a> State<'a> { | |||
} | |||
ast::ForeignItemKind::Static(ref t, m) => { | |||
self.head(visibility_qualified(&item.vis, "static")); | |||
if m == ast::Mutability::Mutable { | |||
if m == ast::Mutability::Mut { |
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.
all these comparisons make me wonder if we should have is_mut()
and is_immut()
helper methods
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 would suggest just nixing PartialEq
by using the beautiful if let
instead.
@bors r+ @rust-lang/clippy (trivial) but a lot of breakage incoming |
📌 Commit 9fa6f34d3ec540efd6e7465c0af54d47911c809e has been approved by |
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
This comment has been minimized.
This comment has been minimized.
2. mir::Mutability -> ast::Mutability.
@bors r=oli-obk |
📌 Commit 6d7c6d7 has been approved by |
🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened |
Merge `ast::Mutability` and `mir::Mutability` r? @oli-obk
Rollup of 7 pull requests Successful merges: - #67059 (Fix too restrictive checks on Drop impls) - #67355 (Merge `ast::Mutability` and `mir::Mutability`) - #67393 (Enable opting out of specific default LLVM arguments.) - #67422 (Cleanup err codes) - #67462 (Make ptr::slice_from_raw_parts a const fn available under a feature flag) - #67467 (Test slice patterns more) - #67478 (Fix src/libcore/str/mod.rs doc comments) Failed merges: r? @ghost
rustup "Merge `ast::Mutability` and `mir::Mutability`" cc rust-lang/rust#67355 changelog: none
rustup "Merge `ast::Mutability` and `mir::Mutability`" cc rust-lang/rust#67355 changelog: none
`Mutability` variants were renamed to `Not` and `Mut` rust-lang/rust#67355
r? @oli-obk