We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
rustc_arena
ref
1 parent 616df0f commit a603635Copy full SHA for a603635
compiler/rustc_arena/src/tests.rs
@@ -52,19 +52,15 @@ fn test_arena_alloc_nested() {
52
53
impl<'a> Wrap<'a> {
54
fn alloc_inner<F: Fn() -> Inner>(&self, f: F) -> &Inner {
55
- let r: &EI<'_> = self.0.alloc(EI::I(f()));
56
- if let &EI::I(ref i) = r {
57
- i
58
- } else {
59
- panic!("mismatch");
+ match self.0.alloc(EI::I(f())) {
+ EI::I(i) => i,
+ _ => panic!("mismatch"),
60
}
61
62
fn alloc_outer<F: Fn() -> Outer<'a>>(&self, f: F) -> &Outer<'_> {
63
- let r: &EI<'_> = self.0.alloc(EI::O(f()));
64
- if let &EI::O(ref o) = r {
65
- o
66
67
+ match self.0.alloc(EI::O(f())) {
+ EI::O(o) => o,
68
69
70
0 commit comments