提交 54c98ab0 编写于 作者: I Irina Popa

rustc_codegen_llvm: fix ownership of Builder.

上级 265f2fa4
......@@ -27,14 +27,14 @@
// All Builders must have an llfn associated with them
#[must_use]
pub struct Builder<'a, 'll: 'a, 'tcx: 'll> {
pub llbuilder: &'ll llvm::Builder,
pub llbuilder: &'ll mut llvm::Builder<'ll>,
pub cx: &'a CodegenCx<'ll, 'tcx>,
}
impl Drop for Builder<'a, 'll, 'tcx> {
fn drop(&mut self) {
unsafe {
llvm::LLVMDisposeBuilder(self.llbuilder);
llvm::LLVMDisposeBuilder(&mut *(self.llbuilder as *mut _));
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册