diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 132e1f9e8fd93..b0b2b0028080e 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -161,6 +161,7 @@ pub enum DLLStorageClass { #[derive(Copy, Clone, Debug)] pub enum AttributeKind { AlwaysInline = 0, + #[allow(dead_code)] ByVal = 1, Cold = 2, InlineHint = 3, @@ -176,7 +177,9 @@ pub enum AttributeKind { OptimizeForSize = 13, ReadOnly = 14, SExt = 15, + #[allow(dead_code)] StructRet = 16, + #[allow(dead_code)] UWTable = 17, ZExt = 18, InReg = 19, @@ -184,7 +187,9 @@ pub enum AttributeKind { SanitizeAddress = 21, SanitizeMemory = 22, NonLazyBind = 23, + #[allow(dead_code)] OptimizeNone = 24, + #[allow(dead_code)] ReadNone = 26, SanitizeHWAddress = 28, WillReturn = 29, @@ -195,6 +200,7 @@ pub enum AttributeKind { SanitizeMemTag = 34, NoCfCheck = 35, ShadowCallStack = 36, + #[allow(dead_code)] AllocSize = 37, AllocatedPointer = 38, AllocAlign = 39, @@ -289,6 +295,7 @@ impl RealPredicate { /// LLVMTypeKind #[derive(Copy, Clone, PartialEq, Debug)] #[repr(C)] +#[allow(dead_code)] pub enum TypeKind { Void = 0, Half = 1, @@ -598,6 +605,7 @@ pub enum ThreadLocalMode { /// LLVMRustTailCallKind #[derive(Copy, Clone)] #[repr(C)] +#[allow(dead_code)] pub enum TailCallKind { None, Tail, @@ -662,9 +670,6 @@ extern "C" { pub struct Builder<'a>(InvariantOpaque<'a>); #[repr(C)] pub struct PassManager<'a>(InvariantOpaque<'a>); -extern "C" { - pub type Pass; -} extern "C" { pub type TargetMachine; } @@ -696,7 +701,6 @@ extern "C" { } pub type DiagnosticHandlerTy = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void); -pub type InlineAsmDiagHandlerTy = unsafe extern "C" fn(&SMDiagnostic, *const c_void, c_uint); pub mod debuginfo { use super::{InvariantOpaque, Metadata}; @@ -804,6 +808,7 @@ pub mod debuginfo { #[repr(C)] pub enum DebugNameTableKind { Default, + #[allow(dead_code)] Gnu, None, } @@ -1563,6 +1568,8 @@ extern "C" { Name: *const c_char, NameLen: size_t, ) -> Option<&Value>; + + #[allow(dead_code)] pub fn LLVMRustSetTailCallKind(CallInst: &Value, TKC: TailCallKind); // Operations on attributes diff --git a/compiler/rustc_codegen_llvm/src/llvm/mod.rs b/compiler/rustc_codegen_llvm/src/llvm/mod.rs index 6ab1eea959761..e5d5442f39695 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/mod.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/mod.rs @@ -21,7 +21,7 @@ pub mod archive_ro; pub mod diagnostic; mod ffi; -pub use self::ffi::*; +pub(crate) use self::ffi::*; impl LLVMRustResult { pub fn into_result(self) -> Result<(), ()> { diff --git a/compiler/rustc_codegen_llvm/src/type_.rs b/compiler/rustc_codegen_llvm/src/type_.rs index f1141c57cedd7..131a026e52c52 100644 --- a/compiler/rustc_codegen_llvm/src/type_.rs +++ b/compiler/rustc_codegen_llvm/src/type_.rs @@ -1,4 +1,4 @@ -pub use crate::llvm::Type; +pub(crate) use crate::llvm::Type; use crate::abi::{FnAbiLlvmExt, LlvmType}; use crate::common; diff --git a/compiler/rustc_codegen_llvm/src/value.rs b/compiler/rustc_codegen_llvm/src/value.rs index 1338a229566c8..26de430d8a43c 100644 --- a/compiler/rustc_codegen_llvm/src/value.rs +++ b/compiler/rustc_codegen_llvm/src/value.rs @@ -1,4 +1,4 @@ -pub use crate::llvm::Value; +pub(crate) use crate::llvm::Value; use crate::llvm;