forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#123512 - Jules-Bertholet:ref-pat-eat-one-layer-2024, r=Nadrieril Match ergonomics 2024: Implement eat-one-layer r? `@Nadrieril` cc rust-lang#123076 `@rustbot` label A-edition-2024 A-patterns
- Loading branch information
Showing
14 changed files
with
681 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
tests/ui/match/ref_pat_eat_one_layer_2024/feature-gate-ref_pat_eat_one_layer_2024.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//@ edition: 2024 | ||
//@ compile-flags: -Zunstable-options | ||
|
||
pub fn main() { | ||
if let Some(Some(&x)) = &Some(&Some(0)) { | ||
//~^ ERROR: mismatched types | ||
let _: u32 = x; | ||
} | ||
if let Some(Some(&x)) = &Some(Some(&0)) { | ||
let _: &u32 = x; | ||
//~^ ERROR: mismatched types | ||
} | ||
if let Some(Some(&&x)) = &Some(Some(&0)) { | ||
//~^ ERROR: mismatched types | ||
let _: u32 = x; | ||
} | ||
if let Some(&Some(x)) = &Some(Some(0)) { | ||
//~^ ERROR: mismatched types | ||
let _: u32 = x; | ||
} | ||
if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) { | ||
//~^ ERROR: mismatched types | ||
let _: u32 = x; | ||
} | ||
if let Some(Some(&x)) = &Some(&Some(0)) { | ||
//~^ ERROR: mismatched types | ||
let _: u32 = x; | ||
} | ||
if let Some(&mut Some(&x)) = &Some(&mut Some(0)) { | ||
//~^ ERROR: mismatched types | ||
let _: u32 = x; | ||
} | ||
if let Some(&Some(&mut x)) = &mut Some(&Some(0)) { | ||
//~^ ERROR: mismatched types | ||
let _: u32 = x; | ||
} | ||
} |
Oops, something went wrong.