Skip to content

Commit 90717eb

Browse files
committed
Update MSRV to 1.79
1 parent 44cd71b commit 90717eb

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

Cargo.toml

+1-1
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.78" # nightly
16+
rust-version = "1.79" # nightly
1717

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

rust-cuda-derive/src/kernel/wrapper/generate/cpu_linker_macro/kernel_func.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn generate_raw_func_input_wrap(
119119
// Safety: `#pat_box` contains exactly the device copy of `#pat`
120120
let __result = (|#pat| { #inner })(unsafe {
121121
rust_cuda::host::HostAndDeviceConstRef::new(
122-
&#pat_box, rust_cuda::utils::device_copy::SafeDeviceCopyWrapper::from_ref(#pat)
122+
&#pat_box, rust_cuda::utils::device_copy::SafeDeviceCopyWrapper::from_ref(#pat)
123123
)
124124
});
125125

@@ -133,7 +133,12 @@ fn generate_raw_func_input_wrap(
133133
// then passing these changes on is safe (and expected)
134134
// * If any mutations occured outside interior mutability,
135135
// then UB occurred, in the kernel (we're not the cause)
136-
#pat_box.copy_to(unsafe { &mut *(#pat as *const _ as *mut _) })?;
136+
// * SafeDeviceCopyWrapper is a newtype wrapper
137+
#pat_box.copy_to(unsafe {
138+
&mut *::core::ptr::from_ref(#pat)
139+
.cast::<rust_cuda::utils::device_copy::SafeDeviceCopyWrapper<_>>()
140+
.cast_mut()
141+
})?;
137142
}
138143

139144
::core::mem::drop(#pat_box);

rust-cuda-derive/src/kernel/wrapper/generate/cpu_linker_macro/kernel_func_raw/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub(super) fn quote_kernel_func_raw(
100100
unsafe { stream.launch(function, grid, block, shared_memory_size,
101101
&[
102102
#(
103-
&#func_params as *const _ as *mut ::std::ffi::c_void
103+
::core::ptr::from_ref(&#func_params).cast_mut().cast::<::std::ffi::c_void>()
104104
),*
105105
]
106106
) }?;

rust-cuda-ptx-jit/src/device.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ macro_rules! PtxJITConstLoad {
66
unsafe {
77
::core::arch::asm!(
88
concat!("// <rust-cuda-ptx-jit-const-load-{}-", $index, "> //"),
9-
in(reg32) *($reference as *const _ as *const u32),
9+
in(reg32) *::core::ptr::from_ref($reference).cast::<u32>(),
1010
)
1111
}
1212
};

rust-cuda-ptx-jit/src/host/arguments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ macro_rules! compilePtxJITwithArguments {
4242
// Muncher recursive case: much one `ConstLoad[$expr]` (some `ConstLoad[$expr]`s already)
4343
(@munch Some $compiler:ident $(. $path:ident)+ => [, ConstLoad [ $head:expr ] $($tail:tt)*] => $($exprs:expr),*) => {
4444
$crate::compilePtxJITwithArguments!(@munch Some $compiler$(.$path)+ => [$($tail)*] => $($exprs,)* Some(unsafe {
45-
::std::slice::from_raw_parts($head as *const _ as *const u8, ::std::mem::size_of_val($head))
45+
::std::slice::from_raw_parts(::std::ptr::from_ref($head).cast::<u8>(), ::std::mem::size_of_val($head))
4646
}))
4747
};
4848
}

rust-toolchain

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
# Pin to final 1.78.0 nightly
3-
channel = "nightly-2024-03-17"
2+
# Pin to final 1.79.0 nightly
3+
channel = "nightly-2024-04-28"
44
components = [ "cargo", "rustfmt", "clippy" ]
55
targets = [ "x86_64-unknown-linux-gnu", "nvptx64-nvidia-cuda" ]

src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![deny(clippy::pedantic)]
22
#![allow(clippy::useless_attribute)]
33
#![cfg_attr(not(feature = "host"), no_std)]
4-
#![feature(associated_type_bounds)]
54
#![feature(auto_traits)]
65
#![feature(negative_impls)]
76
#![cfg_attr(

0 commit comments

Comments
 (0)