Skip to content

Commit 86db51d

Browse files
committed
Bump edition to 2024
1 parent 1f74303 commit 86db51d

File tree

11 files changed

+26
-17
lines changed

11 files changed

+26
-17
lines changed

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
]
1414
repository = "https://github.com/aya-rs/bpf-linker"
1515
readme = "README.md"
16-
edition = "2021"
16+
edition.workspace = true
1717

1818
[dependencies]
1919
# cli deps
@@ -76,6 +76,9 @@ rustc-build-sysroot = []
7676
[workspace]
7777
members = ["xtask"]
7878

79+
[workspace.package]
80+
edition = "2024"
81+
7982
[workspace.dependencies]
8083
# cli deps
8184
anyhow = { version = "1.0.100", default-features = false }

src/bin/bpf-linker.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ use std::{
1616
use aya_rustc_llvm_proxy as _;
1717
use bpf_linker::{Cpu, Linker, LinkerInput, LinkerOptions, OptLevel, OutputType};
1818
use clap::{
19+
Parser,
1920
builder::{PathBufValueParser, TypedValueParser as _},
2021
error::ErrorKind,
21-
Parser,
2222
};
2323
use thiserror::Error;
24-
use tracing::{info, Level};
25-
use tracing_subscriber::{fmt::MakeWriter, prelude::*, EnvFilter};
24+
use tracing::{Level, info};
25+
use tracing_subscriber::{EnvFilter, fmt::MakeWriter, prelude::*};
2626
use tracing_tree::HierarchicalLayer;
2727

2828
#[derive(Debug, Error)]

src/linker.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,10 @@ fn create_target_machine(
643643
(c_triple, llvm::target_from_module(module))
644644
} else {
645645
// case 3.
646-
info!("detected non-bpf input target {:?} and no explicit output --target specified, selecting `bpf'", c_triple);
646+
info!(
647+
"detected non-bpf input target {:?} and no explicit output --target specified, selecting `bpf'",
648+
c_triple
649+
);
647650
let c_triple = c"bpf";
648651
(c_triple, llvm::target_from_triple(c_triple))
649652
}

src/llvm/di.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{
22
borrow::Cow,
3-
collections::{hash_map::DefaultHasher, HashMap, HashSet},
3+
collections::{HashMap, HashSet, hash_map::DefaultHasher},
44
hash::Hasher as _,
55
io::Write as _,
66
marker::PhantomData,
@@ -9,13 +9,13 @@ use std::{
99

1010
use gimli::{DW_TAG_pointer_type, DW_TAG_structure_type, DW_TAG_variant_part};
1111
use llvm_sys::{core::*, debuginfo::*, prelude::*};
12-
use tracing::{span, trace, warn, Level};
12+
use tracing::{Level, span, trace, warn};
1313

1414
use super::types::{
1515
di::DIType,
1616
ir::{Function, MDNode, Metadata, Value},
1717
};
18-
use crate::llvm::{iter::*, types::di::DISubprogram, LLVMContext, LLVMModule};
18+
use crate::llvm::{LLVMContext, LLVMModule, iter::*, types::di::DISubprogram};
1919

2020
// KSYM_NAME_LEN from linux kernel intentionally set
2121
// to lower value found across kernel versions to ensure
@@ -108,7 +108,10 @@ impl<'ctx> DISanitizer<'ctx> {
108108
.to_string();
109109
trace!(
110110
"found data carrying enum {name} ({filename}:{line}), not emitting the debug info for it",
111-
filename = file.filename().map_or( "<unknown>".into(), String::from_utf8_lossy),
111+
filename = file.filename().map_or(
112+
"<unknown>".into(),
113+
String::from_utf8_lossy
114+
),
112115
line = di_composite_type.line(),
113116
);
114117
self.skipped_types_lossy.push(name);

src/llvm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use std::{
1313
pub(crate) use di::DISanitizer;
1414
use iter::{IterModuleFunctions as _, IterModuleGlobalAliases as _, IterModuleGlobals as _};
1515
use llvm_sys::{
16+
LLVMAttributeFunctionIndex, LLVMLinkage, LLVMVisibility,
1617
bit_reader::LLVMParseBitcodeInContext2,
1718
core::{
1819
LLVMCreateMemoryBufferWithMemoryRange, LLVMDisposeMemoryBuffer, LLVMDisposeMessage,
@@ -39,7 +40,6 @@ use llvm_sys::{
3940
transforms::pass_builder::{
4041
LLVMCreatePassBuilderOptions, LLVMDisposePassBuilderOptions, LLVMRunPasses,
4142
},
42-
LLVMAttributeFunctionIndex, LLVMLinkage, LLVMVisibility,
4343
};
4444
use tracing::{debug, error};
4545
pub(crate) use types::{

src/llvm/types/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{
22
any::Any,
3-
ffi::{c_void, CStr},
3+
ffi::{CStr, c_void},
44
marker::PhantomData,
55
pin::Pin,
66
ptr,
@@ -15,7 +15,7 @@ use llvm_sys::{
1515
prelude::{LLVMContextRef, LLVMDiagnosticInfoRef},
1616
};
1717

18-
use crate::llvm::{types::module::LLVMModule, LLVMDiagnosticHandler, Message};
18+
use crate::llvm::{LLVMDiagnosticHandler, Message, types::module::LLVMModule};
1919

2020
pub(crate) struct LLVMContext {
2121
context: LLVMContextRef,

src/llvm/types/di.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use llvm_sys::{
1212
};
1313

1414
use crate::llvm::{
15-
types::ir::{MDNode, Metadata},
1615
LLVMGetMDString,
16+
types::ir::{MDNode, Metadata},
1717
};
1818

1919
fn mdstring<'a>(mdstring: LLVMValueRef) -> &'a [u8] {

src/llvm/types/ir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ use llvm_sys::{
1616
};
1717

1818
use crate::llvm::{
19+
Message,
1920
iter::IterBasicBlocks as _,
2021
symbol_name,
2122
types::di::{DICompositeType, DIDerivedType, DISubprogram, DIType},
22-
Message,
2323
};
2424

2525
pub(crate) fn replace_name(

src/llvm/types/module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use llvm_sys::{
1111
prelude::LLVMModuleRef,
1212
};
1313

14-
use crate::llvm::{types::context::LLVMContext, MemoryBuffer, Message};
14+
use crate::llvm::{MemoryBuffer, Message, types::context::LLVMContext};
1515

1616
pub(crate) struct LLVMModule<'ctx> {
1717
pub(super) module: LLVMModuleRef,

src/llvm/types/target_machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use llvm_sys::target_machine::{
66
LLVMTargetMachineEmitToMemoryBuffer, LLVMTargetMachineRef, LLVMTargetRef,
77
};
88

9-
use crate::llvm::{types::module::LLVMModule, MemoryBuffer, Message};
9+
use crate::llvm::{MemoryBuffer, Message, types::module::LLVMModule};
1010

1111
pub(crate) struct LLVMTargetMachine {
1212
target_machine: LLVMTargetMachineRef,

0 commit comments

Comments
 (0)