From 70e7ea365ce633988d69e01afc997fb66eb56404 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Tue, 6 Feb 2024 20:36:02 +0100 Subject: [PATCH] chore: Fix up warnings from cargo +beta check. (#7453) With upcoming release of 1.76 I did a check of current +beta (which seems to already be at 1.77). These would cause CI pipeline failures once 1.77 is out. Release Notes: - N/A --- crates/gpui/src/platform/mac/dispatcher.rs | 9 +++++++-- crates/gpui/src/scene.rs | 3 --- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/gpui/src/platform/mac/dispatcher.rs b/crates/gpui/src/platform/mac/dispatcher.rs index 72daa8c4404f52836d45ad39517b9b4bb3db57dd..46afc14ba836ca78c66e3c6d35957064344a4dfb 100644 --- a/crates/gpui/src/platform/mac/dispatcher.rs +++ b/crates/gpui/src/platform/mac/dispatcher.rs @@ -11,7 +11,12 @@ use objc::{ }; use parking::{Parker, Unparker}; use parking_lot::Mutex; -use std::{ffi::c_void, ptr::NonNull, sync::Arc, time::Duration}; +use std::{ + ffi::c_void, + ptr::{addr_of, NonNull}, + sync::Arc, + time::Duration, +}; /// All items in the generated file are marked as pub, so we're gonna wrap it in a separate mod to prevent /// these pub items from leaking into public API. @@ -21,7 +26,7 @@ pub(crate) mod dispatch_sys { use dispatch_sys::*; pub(crate) fn dispatch_get_main_queue() -> dispatch_queue_t { - unsafe { &_dispatch_main_q as *const _ as dispatch_queue_t } + unsafe { addr_of!(_dispatch_main_q) as *const _ as dispatch_queue_t } } pub(crate) struct MacDispatcher { diff --git a/crates/gpui/src/scene.rs b/crates/gpui/src/scene.rs index 70e24030b1db92a5d3bfafbbe766a59e5b5fdad9..d5d717e278f3a9d0eeb01488091b491e9efe1bca 100644 --- a/crates/gpui/src/scene.rs +++ b/crates/gpui/src/scene.rs @@ -863,6 +863,3 @@ impl PathVertex { } } } - -#[derive(Copy, Clone, Debug)] -pub(crate) struct AtlasId(pub(crate) usize);