1
Fork 0

Auto merge of #127008 - Jules-Bertholet:tc-ergonomics, r=Nadrieril

Match ergonomics 2024: Implement TC's match ergonomics 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. `@traviscross`

r? `@Nadrieril`

cc https://github.com/rust-lang/rust/issues/123076

`@rustbot` label A-edition-2024 A-patterns
This commit is contained in:
bors 2024-07-05 09:10:17 +00:00
commit 2ad6630673
12 changed files with 466 additions and 88 deletions

View file

@ -714,6 +714,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);