@@ -698,12 +698,9 @@ unsafe extern "C" {
698698pub ( crate ) type DiagnosticHandlerTy = unsafe extern "C" fn ( & DiagnosticInfo , * mut c_void ) ;
699699
700700pub ( crate ) mod debuginfo {
701- use std:: ptr;
702-
703701 use bitflags:: bitflags;
704702
705703 use super :: { InvariantOpaque , Metadata } ;
706- use crate :: llvm:: { self , Module } ;
707704
708705 /// Opaque target type for references to an LLVM debuginfo builder.
709706 ///
@@ -716,33 +713,6 @@ pub(crate) mod debuginfo {
716713 #[ repr( C ) ]
717714 pub ( crate ) struct DIBuilder < ' ll > ( InvariantOpaque < ' ll > ) ;
718715
719- /// Owning pointer to a `DIBuilder<'ll>` that will dispose of the builder
720- /// when dropped. Use `.as_ref()` to get the underlying `&DIBuilder`
721- /// needed for debuginfo FFI calls.
722- pub ( crate ) struct DIBuilderBox < ' ll > {
723- raw : ptr:: NonNull < DIBuilder < ' ll > > ,
724- }
725-
726- impl < ' ll > DIBuilderBox < ' ll > {
727- pub ( crate ) fn new ( llmod : & ' ll Module ) -> Self {
728- let raw = unsafe { llvm:: LLVMCreateDIBuilder ( llmod) } ;
729- let raw = ptr:: NonNull :: new ( raw) . unwrap ( ) ;
730- Self { raw }
731- }
732-
733- pub ( crate ) fn as_ref ( & self ) -> & DIBuilder < ' ll > {
734- // SAFETY: This is an owning pointer, so `&DIBuilder` is valid
735- // for as long as `&self` is.
736- unsafe { self . raw . as_ref ( ) }
737- }
738- }
739-
740- impl < ' ll > Drop for DIBuilderBox < ' ll > {
741- fn drop ( & mut self ) {
742- unsafe { llvm:: LLVMDisposeDIBuilder ( self . raw ) } ;
743- }
744- }
745-
746716 pub ( crate ) type DIDescriptor = Metadata ;
747717 pub ( crate ) type DILocation = Metadata ;
748718 pub ( crate ) type DIScope = DIDescriptor ;
0 commit comments