From d3508096faa38e549f418019bc1c7bc0a88f3f6a Mon Sep 17 00:00:00 2001 From: klensy Date: Tue, 9 Jul 2024 15:46:40 +0300 Subject: [PATCH] rustc_codegen_llvm: convert all allow(dead_code) to expect --- compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs | 6 +++--- compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs index 584d033d6bdd1..50ceb5d9caf4e 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs @@ -375,7 +375,7 @@ impl CounterMappingRegion { // This function might be used in the future; the LLVM API is still evolving, as is coverage // support. - #[allow(dead_code)] + #[expect(dead_code)] pub(crate) fn expansion_region( file_id: u32, expanded_file_id: u32, @@ -400,7 +400,7 @@ impl CounterMappingRegion { // This function might be used in the future; the LLVM API is still evolving, as is coverage // support. - #[allow(dead_code)] + #[expect(dead_code)] pub(crate) fn skipped_region( file_id: u32, start_line: u32, @@ -424,7 +424,7 @@ impl CounterMappingRegion { // This function might be used in the future; the LLVM API is still evolving, as is coverage // support. - #[allow(dead_code)] + #[expect(dead_code)] pub(crate) fn gap_region( counter: Counter, file_id: u32, diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 193fd23dd9366..7337445867217 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -22,7 +22,6 @@ pub const False: Bool = 0 as Bool; #[derive(Copy, Clone, PartialEq)] #[repr(C)] -#[allow(dead_code)] // Variants constructed by C++. pub enum LLVMRustResult { Success, Failure, @@ -147,10 +146,10 @@ pub enum UnnamedAddr { #[derive(Copy, Clone)] #[repr(C)] pub enum DLLStorageClass { - #[allow(dead_code)] + #[expect(dead_code)] Default = 0, DllImport = 1, // Function to be imported from DLL. - #[allow(dead_code)] + #[expect(dead_code)] DllExport = 2, // Function to be accessible from DLL. } @@ -385,7 +384,7 @@ impl AtomicRmwBinOp { #[derive(Copy, Clone)] #[repr(C)] pub enum AtomicOrdering { - #[allow(dead_code)] + #[expect(dead_code)] NotAtomic = 0, Unordered = 1, Monotonic = 2, @@ -539,7 +538,7 @@ pub enum CodeModel { /// LLVMRustDiagnosticKind #[derive(Copy, Clone)] #[repr(C)] -#[allow(dead_code)] // Variants constructed by C++. +#[expect(dead_code)] // Variants constructed by C++. pub enum DiagnosticKind { Other, InlineAsm, @@ -562,7 +561,6 @@ pub enum DiagnosticKind { /// LLVMRustDiagnosticLevel #[derive(Copy, Clone)] #[repr(C)] -#[allow(dead_code)] // Variants constructed by C++. pub enum DiagnosticLevel { Error, Warning,