Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.81.0
toolchain: stable
profile: minimal
override: true
components: llvm-tools-preview
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ corosensei = "0.2"
core_affinity = "0.8"
crossbeam-utils = "0.8"
crossbeam-skiplist = "0.1"
nix = "0.29"
nix = "0.30"
io-uring = "0.7"
windows-sys = "0.59"
anyhow = "1.0"
Expand Down
1 change: 1 addition & 0 deletions core/src/common/beans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ impl BeanFactory<'_> {
///
/// # Safety
/// Only one mutable reference can be held for a given bean at a time.
#[allow(clippy::mut_from_ref)]
#[must_use]
pub unsafe fn get_mut_bean<B>(bean_name: &str) -> Option<&mut B> {
Self::get_instance()
Expand Down
2 changes: 1 addition & 1 deletion core/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub fn page_size() -> usize {
cfg_if::cfg_if! {
if #[cfg(windows)] {
let mut info = std::mem::zeroed();
windows_sys::Win32::System::SystemInformation::GetSystemInfo(&mut info);
windows_sys::Win32::System::SystemInformation::GetSystemInfo(&raw mut info);
ret = usize::try_from(info.dwPageSize).expect("get page size failed");
} else {
ret = usize::try_from(libc::sysconf(libc::_SC_PAGESIZE)).expect("get page size failed");
Expand Down
2 changes: 1 addition & 1 deletion core/src/common/ordered_work_steal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
//本地队列超过一半,不再steal
break;
}
if std::ptr::eq(&another, &self.queue) {
if std::ptr::eq(&raw const another, &raw const self.queue) {
//不能偷自己
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/common/work_steal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl<'l, T: Debug> LocalQueue<'l, T> {
//本地队列超过一半,不再steal
break;
}
if std::ptr::eq(&another, &self.queue) {
if std::ptr::eq(&raw const another, &raw const self.queue) {
//不能偷自己
continue;
}
Expand Down
1 change: 1 addition & 0 deletions core/src/coroutine/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl<'c> CoroutineLocal<'c> {
}

/// Get a mut value ref from the coroutine local.
#[allow(clippy::mut_from_ref)]
pub fn get_mut<V>(&self, key: &'c str) -> Option<&mut V> {
self.0
.get(key)
Expand Down
6 changes: 4 additions & 2 deletions core/src/net/operator/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ impl Operator<'_> {
self,
SUPPORT_TIMEOUT_ADD,
Timeout,
Timeout::new(&timeout).build().user_data(user_data as u64)
Timeout::new(&raw const timeout)
.build()
.user_data(user_data as u64)
)
}
Ok(())
Expand All @@ -254,7 +256,7 @@ impl Operator<'_> {
self,
SUPPORT_TIMEOUT_UPDATE,
TimeoutUpdate,
TimeoutUpdate::new(user_data as u64, &timeout)
TimeoutUpdate::new(user_data as u64, &raw const timeout)
.build()
.user_data(user_data as u64)
)
Expand Down
4 changes: 2 additions & 2 deletions core/src/syscall/unix/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<I: ConnectSyscall> ConnectSyscall for NioConnectSyscall<I> {
libc::SOL_SOCKET,
libc::SO_ERROR,
std::ptr::addr_of_mut!(err).cast::<c_void>(),
&mut len,
&raw mut len,
);
}
if r != 0 {
Expand All @@ -88,7 +88,7 @@ impl<I: ConnectSyscall> ConnectSyscall for NioConnectSyscall<I> {
unsafe {
let mut address = std::mem::zeroed();
let mut address_len = socklen_t::try_from(size_of_val(&address)).expect("overflow");
r = libc::getpeername(fd, &mut address, &mut address_len);
r = libc::getpeername(fd, &raw mut address, &raw mut address_len);
}
} else if errno != Some(libc::EINTR) {
break;
Expand Down
4 changes: 2 additions & 2 deletions core/src/syscall/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ pub extern "C" fn send_time_limit(fd: c_int) -> u64 {
libc::SOL_SOCKET,
libc::SO_SNDTIMEO,
std::ptr::from_mut(&mut tv).cast(),
&mut len,
&raw mut len,
) == -1
{
let error = std::io::Error::last_os_error();
Expand Down Expand Up @@ -1056,7 +1056,7 @@ pub extern "C" fn recv_time_limit(fd: c_int) -> u64 {
libc::SOL_SOCKET,
libc::SO_RCVTIMEO,
std::ptr::from_mut(&mut tv).cast(),
&mut len,
&raw mut len,
) == -1
{
let error = std::io::Error::last_os_error();
Expand Down
2 changes: 1 addition & 1 deletion core/src/syscall/unix/recvmsg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<I: RecvmsgSyscall> RecvmsgSyscall for NioRecvmsgSyscall<I> {
msg_controllen: msghdr.msg_controllen,
msg_flags: msghdr.msg_flags,
};
r = self.inner.recvmsg(fn_ptr, fd, &mut arg, flags);
r = self.inner.recvmsg(fn_ptr, fd, &raw mut arg, flags);
if r == 0 {
std::mem::forget(vec);
if blocking {
Expand Down
2 changes: 1 addition & 1 deletion core/src/syscall/unix/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<I: SelectSyscall> SelectSyscall for NioSelectSyscall<I> {
loop {
r = self
.inner
.select(fn_ptr, nfds, readfds, writefds, errorfds, &mut o);
.select(fn_ptr, nfds, readfds, writefds, errorfds, &raw mut o);
if r != 0 || t == 0 {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/syscall/unix/sendmsg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<I: SendmsgSyscall> SendmsgSyscall for NioSendmsgSyscall<I> {
msg_controllen: msghdr.msg_controllen,
msg_flags: msghdr.msg_flags,
};
r = self.inner.sendmsg(fn_ptr, fd, &arg, flags);
r = self.inner.sendmsg(fn_ptr, fd, &raw const arg, flags);
if r != -1 {
reset_errno();
sent += libc::size_t::try_from(r).expect("r overflow");
Expand Down
4 changes: 2 additions & 2 deletions core/src/syscall/windows/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<I: ConnectSyscall> ConnectSyscall for NioConnectSyscall<I> {
SOL_SOCKET,
SO_ERROR,
std::ptr::addr_of_mut!(err).cast::<u8>(),
&mut len,
&raw mut len,
);
}
if r != 0 {
Expand All @@ -86,7 +86,7 @@ impl<I: ConnectSyscall> ConnectSyscall for NioConnectSyscall<I> {
unsafe {
let mut address = std::mem::zeroed();
let mut address_len = c_int::try_from(size_of_val(&address)).expect("overflow");
r = getpeername(fd, &mut address, &mut address_len);
r = getpeername(fd, &raw mut address, &raw mut address_len);
}
} else if errno != Some(WSAEINTR) {
break;
Expand Down
6 changes: 3 additions & 3 deletions core/src/syscall/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ extern "system" fn set_non_blocking_flag(fd: SOCKET, on: bool) -> bool {
windows_sys::Win32::Networking::WinSock::ioctlsocket(
fd,
windows_sys::Win32::Networking::WinSock::FIONBIO,
&mut argp,
&raw mut argp,
) == 0
}
}
Expand All @@ -913,7 +913,7 @@ pub extern "system" fn send_time_limit(fd: SOCKET) -> u64 {
SOL_SOCKET,
SO_SNDTIMEO,
std::ptr::from_mut(&mut ms).cast(),
&mut len,
&raw mut len,
)
} == -1
{
Expand Down Expand Up @@ -950,7 +950,7 @@ pub extern "system" fn recv_time_limit(fd: SOCKET) -> u64 {
SOL_SOCKET,
SO_RCVTIMEO,
std::ptr::from_mut(&mut ms).cast(),
&mut len,
&raw mut len,
)
} == -1
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/syscall/windows/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl<I: SelectSyscall> SelectSyscall for NioSelectSyscall<I> {
loop {
r = self
.inner
.select(fn_ptr, nfds, readfds, writefds, errorfds, &mut o);
.select(fn_ptr, nfds, readfds, writefds, errorfds, &raw mut o);
if r != 0 || t == 0 {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion open-coroutine/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ fn main() {
.arg(out_dir.clone())
.status()
{
panic!("failed to build dylib {}", e);
panic!("failed to build dylib {e}");
}
// correct dylib path
let hook_deps = out_dir
Expand Down
Loading