Closed
Description
This code causes a free of garbage memory and crashes:
struct Url {
scheme: ~str,
port: Option<~str>
}
impl Url {
fn normalized_url(&self) {
match self.port {
Some(copy port) if true => {}
_ => {}
}
}
}
fn main() {
let url: Url = Url {
scheme: ~"http",
port: None,
};
url.normalized_url();
}
Doesn't seem to be related to explicit self. The pattern guard is necessary in order to cause the crash.