Implement TC's match ergonomics 2024 proposal
Under gate `ref_pat_eat_one_layer_2024_structural`. Enabling `ref_pat_eat_one_layer_2024` at the same time allows the union of what the individual gates allow.
This commit is contained in:
parent
4bc39f028d
commit
372847dd44
11 changed files with 459 additions and 81 deletions
|
@ -711,6 +711,7 @@ pub enum ByRef {
|
|||
}
|
||||
|
||||
impl ByRef {
|
||||
#[must_use]
|
||||
pub fn cap_ref_mutability(mut self, mutbl: Mutability) -> Self {
|
||||
if let ByRef::Yes(old_mutbl) = &mut self {
|
||||
*old_mutbl = cmp::min(*old_mutbl, mutbl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue