diff --git a/Cargo.toml b/Cargo.toml index fb53ab464f5..fe29eadbd55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,3 +30,6 @@ lto = "thin" # Similarly, speed up linking by a ton edit = { path = "./crates/edit" } stdext = { path = "./crates/stdext" } unicode-gen = { path = "./crates/unicode-gen" } + +[workspace.lints.clippy] +borrow_as_ptr = "warn" diff --git a/crates/edit/src/icu.rs b/crates/edit/src/icu.rs index 1be796019f7..909940fb673 100644 --- a/crates/edit/src/icu.rs +++ b/crates/edit/src/icu.rs @@ -218,13 +218,13 @@ impl<'pivot> Converter<'pivot> { (f.ucnv_convertEx)( /* target_cnv */ self.target, /* source_cnv */ self.source, - /* target */ &mut output_ptr, + /* target */ &raw mut output_ptr, /* target_limit */ output_end, - /* source */ &mut input_ptr, + /* source */ &raw mut input_ptr, /* source_limit */ input_end, /* pivot_start */ pivot_beg, - /* pivot_source */ &mut self.pivot_source, - /* pivot_target */ &mut self.pivot_target, + /* pivot_source */ &raw mut self.pivot_source, + /* pivot_target */ &raw mut self.pivot_target, /* pivot_limit */ pivot_end, /* reset */ self.reset, /* flush */ flush, diff --git a/crates/edit/src/sys/unix.rs b/crates/edit/src/sys/unix.rs index 71b9edc7d74..7b1a71716e8 100644 --- a/crates/edit/src/sys/unix.rs +++ b/crates/edit/src/sys/unix.rs @@ -64,7 +64,7 @@ pub fn switch_modes() -> apperr::Result<()> { // Set STATE.inject_resize to true whenever we get a SIGWINCH. let mut sigwinch_action: libc::sigaction = mem::zeroed(); sigwinch_action.sa_sigaction = sigwinch_handler as *const () as libc::sighandler_t; - check_int_return(libc::sigaction(libc::SIGWINCH, &sigwinch_action, null_mut()))?; + check_int_return(libc::sigaction(libc::SIGWINCH, &raw const sigwinch_action, null_mut()))?; // Get the original terminal modes so we can disable raw mode on exit. let mut termios = MaybeUninit::::uninit(); @@ -117,7 +117,7 @@ pub fn switch_modes() -> apperr::Result<()> { // Set the terminal to raw mode. termios.c_lflag &= !(libc::ICANON | libc::ECHO); - check_int_return(libc::tcsetattr(STATE.stdout, libc::TCSANOW, &termios))?; + check_int_return(libc::tcsetattr(STATE.stdout, libc::TCSANOW, &raw const termios))?; Ok(()) } @@ -131,7 +131,7 @@ impl Drop for Deinit { #[allow(static_mut_refs)] if let Some(termios) = STATE.stdout_initial_termios.take() { // Restore the original terminal modes. - libc::tcsetattr(STATE.stdout, libc::TCSANOW, &termios); + libc::tcsetattr(STATE.stdout, libc::TCSANOW, &raw const termios); } } } @@ -207,7 +207,7 @@ pub fn read_stdin(arena: &Arena, mut timeout: time::Duration) -> Option Context<'a, '_> { self.styled_label_add_text(text); self.styled_label_add_text("("); self.styled_label_set_attributes(Attributes::Underlined); - self.styled_label_add_text(unsafe { str_from_raw_parts(&ch, 1) }); + self.styled_label_add_text(unsafe { str_from_raw_parts(&raw const ch, 1) }); self.styled_label_set_attributes(Attributes::None); self.styled_label_add_text(")"); }