-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Use the power of adding helper function to simplify code w/ Mutability
#104786
Conversation
Some changes occurred in need_type_info.rs cc @lcnr |
1aae945
to
83fac06
Compare
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
4a05732
to
7d555e1
Compare
7d555e1
to
967c07d
Compare
I'm fine with these changes, but I think that |
@compiler-errors I do think that it's much nicer that way, matching tends to be too verbose IMO. But I can revert that commit. |
I'd prefer if you did -- since it's only used in a handful of places, I'm not convinced it's as much of an ergonomic improvement compared to the other improvements in this commit stack. |
TyKind::Rptr(_, mt) if mt.ty.kind.is_implicit_self() && mt.mutbl.is_mut() => { | ||
hir::ImplicitSelfKind::MutRef | ||
} | ||
TyKind::Rptr(_, mt) if mt.ty.kind.is_implicit_self() => { |
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.
Can you match
or if
on mt.mutbl
here instead of doing this in two arms?
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.
Done
967c07d
to
fddf7f4
Compare
fddf7f4
to
5503190
Compare
@bors r+ |
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#104786 (Use the power of adding helper function to simplify code w/ `Mutability`) - rust-lang#104788 (Do not record unresolved const vars in generator interior) - rust-lang#104909 (Rename `normalize_opaque_types` to `reveal_opaque_types_in_bounds`) - rust-lang#104921 (Remove unnecessary binder from `get_impl_future_output_ty`) - rust-lang#104924 (jsondoclint: Accept trait alias is places where trait expected.) - rust-lang#104928 (rustdoc: use flexbox CSS to align sidebar button instead of position) - rust-lang#104943 (jsondoclint: Handle using enum variants and glob using enums.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…ler-errors Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
r? @compiler-errors