diff --git a/src/libsyntax/ptr.rs b/src/libsyntax/ptr.rs index bb1744e2df169..3effe53cd29b0 100644 --- a/src/libsyntax/ptr.rs +++ b/src/libsyntax/ptr.rs @@ -101,6 +101,7 @@ impl P { // Recreate self from the raw pointer. Some(P { ptr: Box::from_raw(p) }) } else { + drop(Box::from_raw(p)); None } }