Skip to content

Commit d350809

Browse files
committed
rustc_codegen_llvm: convert all allow(dead_code) to expect
1 parent 4080aa2 commit d350809

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

compiler/rustc_codegen_llvm/src/coverageinfo/ffi.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl CounterMappingRegion {
375375

376376
// This function might be used in the future; the LLVM API is still evolving, as is coverage
377377
// support.
378-
#[allow(dead_code)]
378+
#[expect(dead_code)]
379379
pub(crate) fn expansion_region(
380380
file_id: u32,
381381
expanded_file_id: u32,
@@ -400,7 +400,7 @@ impl CounterMappingRegion {
400400

401401
// This function might be used in the future; the LLVM API is still evolving, as is coverage
402402
// support.
403-
#[allow(dead_code)]
403+
#[expect(dead_code)]
404404
pub(crate) fn skipped_region(
405405
file_id: u32,
406406
start_line: u32,
@@ -424,7 +424,7 @@ impl CounterMappingRegion {
424424

425425
// This function might be used in the future; the LLVM API is still evolving, as is coverage
426426
// support.
427-
#[allow(dead_code)]
427+
#[expect(dead_code)]
428428
pub(crate) fn gap_region(
429429
counter: Counter,
430430
file_id: u32,

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub const False: Bool = 0 as Bool;
2222

2323
#[derive(Copy, Clone, PartialEq)]
2424
#[repr(C)]
25-
#[allow(dead_code)] // Variants constructed by C++.
2625
pub enum LLVMRustResult {
2726
Success,
2827
Failure,
@@ -147,10 +146,10 @@ pub enum UnnamedAddr {
147146
#[derive(Copy, Clone)]
148147
#[repr(C)]
149148
pub enum DLLStorageClass {
150-
#[allow(dead_code)]
149+
#[expect(dead_code)]
151150
Default = 0,
152151
DllImport = 1, // Function to be imported from DLL.
153-
#[allow(dead_code)]
152+
#[expect(dead_code)]
154153
DllExport = 2, // Function to be accessible from DLL.
155154
}
156155

@@ -385,7 +384,7 @@ impl AtomicRmwBinOp {
385384
#[derive(Copy, Clone)]
386385
#[repr(C)]
387386
pub enum AtomicOrdering {
388-
#[allow(dead_code)]
387+
#[expect(dead_code)]
389388
NotAtomic = 0,
390389
Unordered = 1,
391390
Monotonic = 2,
@@ -539,7 +538,7 @@ pub enum CodeModel {
539538
/// LLVMRustDiagnosticKind
540539
#[derive(Copy, Clone)]
541540
#[repr(C)]
542-
#[allow(dead_code)] // Variants constructed by C++.
541+
#[expect(dead_code)] // Variants constructed by C++.
543542
pub enum DiagnosticKind {
544543
Other,
545544
InlineAsm,
@@ -562,7 +561,6 @@ pub enum DiagnosticKind {
562561
/// LLVMRustDiagnosticLevel
563562
#[derive(Copy, Clone)]
564563
#[repr(C)]
565-
#[allow(dead_code)] // Variants constructed by C++.
566564
pub enum DiagnosticLevel {
567565
Error,
568566
Warning,

0 commit comments

Comments
 (0)