Closed
Description
struct A { x: uint }
impl Drop for A {
fn finalize(&self) {}
}
fn main() {
let a = A { x: 0 };
let x = &a.x;
match a {
A { x : ref x } => {}
}
}
dtor-struct.rs:13:8: 13:26 error: deconstructing struct not allowed in pattern (it has a destructor)
dtor-struct.rs:13 A { x : ref x } => {}
^~~~~~~~~~~~~~~~~~
error: aborting due to previous error
The let
and match
seem to be morally identical, but one is invalid. (Making the match
form valid makes syntax extensions/macros easier.)
(Caused #6341.)
Metadata
Metadata
Assignees
Labels
No labels