Skip to content

Commit 57a16a9

Browse files
authored
Update MSRV to 1.81 nightly (#19)
* Upgrade MSRV to 1.81 * Use lint expects * Link without lld + remove unsafe env var modifications
1 parent f2a377d commit 57a16a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+277
-359
lines changed

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
[alias]
22
reap-clippy = "reaper cargo clippy"
3+
4+
[target.x86_64-unknown-linux-gnu]
5+
rustflags = ["-Zlinker-features=-lld"]

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ version = "0.1.0"
1313
authors = ["Juniper Tyree <[email protected]>"]
1414
license = "MIT OR Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.79" # nightly
16+
rust-version = "1.81" # nightly
1717

1818
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1919

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/rust-cuda/ci.yml?branch=main
44
[workflow]: https://github.com/juntyr/rust-cuda/actions/workflows/ci.yml?query=branch%3Amain
55

6-
[MSRV]: https://img.shields.io/badge/MSRV-1.79.0--nightly-orange
6+
[MSRV]: https://img.shields.io/badge/MSRV-1.81.0--nightly-orange
77
[repo]: https://github.com/juntyr/rust-cuda
88

99
[Rust Doc]: https://img.shields.io/badge/docs-main-blue

examples/derive/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![deny(clippy::pedantic)]
2+
#![allow(dead_code)] // FIXME: use expect
23
#![feature(const_type_name)]
34

45
#[derive(rc::lend::LendRustToCuda)]

examples/print/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ mod cuda_prelude {
4141
#[panic_handler]
4242
fn panic(info: &::core::panic::PanicInfo) -> ! {
4343
// pretty format and print the panic message
44-
// but don't allow dynamic formatting or panic payload downcasting
45-
rust_cuda::device::utils::pretty_print_panic_info(info, false, false);
44+
// but don't allow dynamic formatting
45+
rust_cuda::device::utils::pretty_print_panic_info(info, false);
4646

4747
// Safety: no mutable data is shared with the kernel
4848
unsafe { rust_cuda::device::utils::exit() }

examples/single-source/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![deny(clippy::pedantic)]
2+
#![allow(dead_code)] // FIXME: use expect
23
#![cfg_attr(target_os = "cuda", no_std)]
34
#![cfg_attr(target_os = "cuda", feature(abi_ptx))]
45
#![cfg_attr(target_os = "cuda", feature(alloc_error_handler))]
@@ -18,7 +19,6 @@ pub struct Dummy(i32);
1819

1920
#[derive(Clone, rc::lend::LendRustToCuda)]
2021
#[cuda(crate = "rc")]
21-
#[allow(dead_code)]
2222
pub struct Wrapper<T> {
2323
#[cuda(embed)]
2424
inner: T,
@@ -67,7 +67,7 @@ pub fn kernel<
6767
let shared = rc::utils::shared::ThreadBlockShared::<[Tuple; 3]>::new_uninit();
6868
let shared2 = rc::utils::shared::ThreadBlockShared::<[Tuple; 3]>::new_uninit();
6969

70-
#[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
70+
#[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
7171
unsafe {
7272
(*shared.index_mut_unchecked(1)).0 = (f64::from(s) * 2.0) as u32;
7373
}
@@ -90,7 +90,6 @@ pub fn kernel<
9090
#[cfg(not(target_os = "cuda"))]
9191
mod host {
9292
// Link several instances of the generic CUDA kernel
93-
#[allow(dead_code)]
9493
struct KernelPtx<'a, T>(std::marker::PhantomData<&'a T>);
9594
crate::link! { impl kernel<'a, crate::Empty> for KernelPtx }
9695
crate::link! { impl kernel<'a, rc::utils::adapter::RustToCudaWithPortableBitCopySemantics<u64>> for KernelPtx }

rust-cuda-derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Juniper Tyree <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.79" # nightly
7+
rust-version = "1.81" # nightly
88

99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1010

rust-cuda-derive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! [CI Status]: https://img.shields.io/github/actions/workflow/status/juntyr/rust-cuda/ci.yml?branch=main
66
//! [workflow]: https://github.com/juntyr/rust-cuda/actions/workflows/ci.yml?query=branch%3Amain
77
//!
8-
//! [MSRV]: https://img.shields.io/badge/MSRV-1.79.0--nightly-orange
8+
//! [MSRV]: https://img.shields.io/badge/MSRV-1.81.0--nightly-orange
99
//! [repo]: https://github.com/juntyr/rust-cuda
1010
//!
1111
//! [Rust Doc]: https://img.shields.io/badge/docs-main-blue

rust-cuda-derive/src/rust_to_cuda/field_copy.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use quote::{format_ident, quote, ToTokens};
33

44
use crate::rust_to_cuda::field_ty::CudaReprFieldTy;
55

6-
#[allow(clippy::too_many_arguments, clippy::too_many_lines)]
6+
#[expect(clippy::too_many_arguments, clippy::too_many_lines)]
77
pub fn impl_field_copy_init_and_expand_alloc_type(
88
crate_path: &syn::Path,
99
field: &syn::Field,
@@ -24,17 +24,17 @@ pub fn impl_field_copy_init_and_expand_alloc_type(
2424

2525
c2r_field_initialisations: &mut Vec<TokenStream>,
2626
) -> (TokenStream, TokenStream) {
27-
#[allow(clippy::option_if_let_else)]
27+
#[expect(clippy::option_if_let_else)]
2828
let field_accessor = match &field.ident {
2929
Some(ident) => quote! { #ident },
3030
None => proc_macro2::Literal::usize_unsuffixed(field_index).to_token_stream(),
3131
};
32-
#[allow(clippy::option_if_let_else)]
32+
#[expect(clippy::option_if_let_else)]
3333
let field_repr_ident = match &field.ident {
3434
Some(ident) => format_ident!("field_{}_repr", ident),
3535
None => format_ident!("field_{}_repr", field_index),
3636
};
37-
#[allow(clippy::option_if_let_else)]
37+
#[expect(clippy::option_if_let_else)]
3838
let field_completion_ident = match &field.ident {
3939
Some(ident) => format_ident!("field_{}_completion", ident),
4040
None => format_ident!("field_{}_completion", field_index),

rust-cuda-derive/src/rust_to_cuda/field_ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use syn::{parse_quote, spanned::Spanned};
22

3-
#[allow(clippy::module_name_repetitions)]
3+
#[expect(clippy::module_name_repetitions)]
44
pub enum CudaReprFieldTy {
55
SafeDeviceCopy,
66
RustToCuda {
@@ -103,7 +103,7 @@ pub fn swap_field_type_and_filter_attrs(
103103
}
104104
});
105105

106-
#[allow(clippy::option_if_let_else)]
106+
#[expect(clippy::option_if_let_else)]
107107
let cuda_repr_field_ty = if let Some(cuda_repr_field_ty) = cuda_repr_field_ty {
108108
cuda_repr_field_ty
109109
} else {

rust-cuda-derive/src/rust_to_cuda/generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use quote::quote_spanned;
22
use syn::spanned::Spanned;
33

4-
#[allow(clippy::too_many_lines)]
4+
#[expect(clippy::too_many_lines)]
55
pub fn expand_cuda_struct_generics_where_requested_in_attrs(
66
ast: &syn::DeriveInput,
77
) -> (

rust-cuda-derive/src/rust_to_cuda/impl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use proc_macro2::TokenStream;
22
use quote::quote;
33

4-
#[allow(clippy::too_many_arguments)]
4+
#[expect(clippy::too_many_arguments)]
55
pub fn cuda_struct_declaration(
66
crate_path: &syn::Path,
77
struct_attrs_cuda: &[syn::Attribute],
@@ -23,7 +23,7 @@ pub fn cuda_struct_declaration(
2323
quote! { #[repr(C)] }
2424
};
2525

26-
#[allow(clippy::option_if_let_else)]
26+
#[expect(clippy::option_if_let_else)]
2727
let struct_fields_where_clause = if let Some(struct_semi_cuda) = struct_semi_cuda {
2828
quote!(#struct_fields_cuda #where_clause #struct_semi_cuda)
2929
} else {
@@ -44,7 +44,7 @@ pub fn cuda_struct_declaration(
4444
}
4545
}
4646

47-
#[allow(clippy::too_many_arguments)]
47+
#[expect(clippy::too_many_arguments)]
4848
pub fn rust_to_cuda_trait(
4949
crate_path: &syn::Path,
5050
struct_name: &syn::Ident,
@@ -118,7 +118,7 @@ pub fn rust_to_cuda_trait(
118118
}
119119
}
120120

121-
#[allow(clippy::too_many_arguments)]
121+
#[expect(clippy::too_many_arguments)]
122122
pub fn rust_to_cuda_async_trait(
123123
crate_path: &syn::Path,
124124
struct_name: &syn::Ident,

rust-cuda-derive/src/rust_to_cuda/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn get_cuda_repr_ident(rust_repr_ident: &proc_macro2::Ident) -> proc_macro2::Ide
1010
format_ident!("{}CudaRepresentation", rust_repr_ident)
1111
}
1212

13-
#[allow(clippy::module_name_repetitions, clippy::too_many_lines)]
13+
#[expect(clippy::module_name_repetitions, clippy::too_many_lines)]
1414
pub fn impl_rust_to_cuda(ast: &syn::DeriveInput) -> proc_macro::TokenStream {
1515
let (mut struct_fields_cuda, struct_semi_cuda) = if let syn::Data::Struct(s) = &ast.data {
1616
(s.fields.clone(), s.semi_token)

rust-cuda-kernel/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
authors = ["Juniper Tyree <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
edition = "2021"
7-
rust-version = "1.79" # nightly
7+
rust-version = "1.81" # nightly
88
links = "libnvptxcompiler_static"
99

1010
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -25,7 +25,7 @@ strip-ansi-escapes = "0.2"
2525
colored = "2.0"
2626
thiserror = "1.0"
2727
seahash = "4.1"
28-
ptx-builder = { git = "https://github.com/juntyr/rust-ptx-builder", rev = "aeb3b68" }
28+
ptx-builder = { git = "https://github.com/juntyr/rust-ptx-builder", rev = "9649e58" }
2929

3030
[build-dependencies]
3131
find_cuda_helper = "0.2"

rust-cuda-kernel/src/kernel/link/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use quote::quote;
44

55
use crate::kernel::lints::{parse_ptx_lint_level, LintLevel, PtxLint};
66

7-
#[allow(clippy::module_name_repetitions)]
87
pub(super) struct LinkKernelConfig {
98
pub(super) kernel: syn::Ident,
109
pub(super) kernel_hash: syn::Ident,
@@ -64,7 +63,6 @@ impl syn::parse::Parse for LinkKernelConfig {
6463
}
6564
}
6665

67-
#[allow(clippy::module_name_repetitions)]
6866
pub(super) struct CheckKernelConfig {
6967
pub(super) kernel: syn::Ident,
7068
pub(super) kernel_hash: syn::Ident,

rust-cuda-kernel/src/kernel/link/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ lazy_static::lazy_static! {
88
};
99
}
1010

11-
#[allow(clippy::module_name_repetitions)]
11+
#[expect(clippy::module_name_repetitions)]
1212
pub fn emit_ptx_build_error() {
1313
colored::control::set_override(true);
1414
let rendered = format!(

0 commit comments

Comments
 (0)