Skip to content

Commit

Permalink
rustc_codegen_llvm: convert all allow(dead_code) to expect
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Jul 9, 2024
1 parent 4080aa2 commit d350809
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
10 changes: 4 additions & 6 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit d350809

Please sign in to comment.