summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2025-04-04 10:09:48 +0200
committerDavid Lönnhager <david.l@mullvad.net>2025-04-10 08:45:28 +0200
commit218e47d24bbf0c69f648f0ec039c11c12f65cd69 (patch)
tree3bff113ceb4b51dcfebaaa8f9e228c1491fda158
parenta64a885ae56d39ce4213077283409891d5aa2e94 (diff)
downloadmullvadvpn-218e47d24bbf0c69f648f0ec039c11c12f65cd69.tar.xz
mullvadvpn-218e47d24bbf0c69f648f0ec039c11c12f65cd69.zip
Fix some compilation errors on macOS for Rust 2024
-rw-r--r--mullvad-daemon/src/macos_launch_daemon.rs2
-rw-r--r--mullvad-daemon/src/migrations/v10.rs2
-rw-r--r--mullvad-daemon/src/relay_list/mod.rs19
-rw-r--r--talpid-core/src/split_tunnel/macos/tun.rs2
-rw-r--r--talpid-routing/src/unix/mod.rs2
5 files changed, 16 insertions, 11 deletions
diff --git a/mullvad-daemon/src/macos_launch_daemon.rs b/mullvad-daemon/src/macos_launch_daemon.rs
index 4b7a6c5efa..df82983797 100644
--- a/mullvad-daemon/src/macos_launch_daemon.rs
+++ b/mullvad-daemon/src/macos_launch_daemon.rs
@@ -15,7 +15,7 @@ type Id = *mut AnyObject;
// Framework that contains `SMAppService`.
#[link(name = "ServiceManagement", kind = "framework")]
-extern "C" {}
+unsafe extern "C" {}
/// Returned by `[NSProcessInfo operatingSystemVersion]`. Contains the current
#[repr(C)]
diff --git a/mullvad-daemon/src/migrations/v10.rs b/mullvad-daemon/src/migrations/v10.rs
index 2b713b97ab..6fba7d9d5d 100644
--- a/mullvad-daemon/src/migrations/v10.rs
+++ b/mullvad-daemon/src/migrations/v10.rs
@@ -62,7 +62,7 @@ fn migrate_tunnel_type_inner(normal: &mut serde_json::Value) -> Result<()> {
}
// Migrate '"only": { "tunnel_protocol": $tunnel_protocol }'
// to '"tunnel_protocol": $tunnel_protocol'
- Some(serde_json::Value::Object(ref mut constraint)) => {
+ Some(serde_json::Value::Object(constraint)) => {
if let Some(tunnel_type) = constraint.get("only") {
let tunnel_type: TunnelType = serde_json::from_value(tunnel_type.clone())
.map_err(|_| Error::InvalidSettingsContent)?;
diff --git a/mullvad-daemon/src/relay_list/mod.rs b/mullvad-daemon/src/relay_list/mod.rs
index ee5781aff0..a508226807 100644
--- a/mullvad-daemon/src/relay_list/mod.rs
+++ b/mullvad-daemon/src/relay_list/mod.rs
@@ -167,14 +167,19 @@ impl RelayListUpdater {
proxy: RelayListProxy,
tag: Option<String>,
) -> impl Future<Output = Result<Option<RelayList>, mullvad_api::Error>> + use<> {
- let download_futures = move || {
+ async fn download_future(
+ api_handle: ApiAvailability,
+ proxy: RelayListProxy,
+ tag: Option<String>,
+ ) -> Result<Option<RelayList>, mullvad_api::Error> {
let available = api_handle.wait_background();
- let req = proxy.relay_list(tag.clone());
- async move {
- available.await?;
- req.await.map_err(mullvad_api::Error::from)
- }
- };
+ let req = proxy.relay_list(tag);
+ available.await?;
+ req.await.map_err(mullvad_api::Error::from)
+ }
+
+ let download_futures =
+ move || download_future(api_handle.clone(), proxy.clone(), tag.clone());
retry_future(
download_futures,
diff --git a/talpid-core/src/split_tunnel/macos/tun.rs b/talpid-core/src/split_tunnel/macos/tun.rs
index 2533e8a360..a9444c015a 100644
--- a/talpid-core/src/split_tunnel/macos/tun.rs
+++ b/talpid-core/src/split_tunnel/macos/tun.rs
@@ -818,7 +818,7 @@ fn fix_ipv6_checksums(
/// exist, the function will not fail, but the stream will never return anything.
fn capture_outbound_packets(
utun_iface: &str,
-) -> Result<impl Stream<Item = Result<PktapPacket, Error>> + Send, Error> {
+) -> Result<impl Stream<Item = Result<PktapPacket, Error>> + Send + use<>, Error> {
// We want to create a pktap "pseudo-device" and capture data on it using a bpf device.
// This provides packet data plus a pktap header including process information.
// libpcap will do the heavy lifting for us if we simply request a "pktap" device.
diff --git a/talpid-routing/src/unix/mod.rs b/talpid-routing/src/unix/mod.rs
index 551f572b9f..1a7a9361bc 100644
--- a/talpid-routing/src/unix/mod.rs
+++ b/talpid-routing/src/unix/mod.rs
@@ -265,7 +265,7 @@ impl RouteManagerHandle {
#[cfg(target_os = "macos")]
pub async fn default_route_listener(
&self,
- ) -> Result<impl Stream<Item = DefaultRouteEvent>, Error> {
+ ) -> Result<impl Stream<Item = DefaultRouteEvent> + use<>, Error> {
let (response_tx, response_rx) = oneshot::channel();
self.tx
.unbounded_send(RouteManagerCommand::NewDefaultRouteListener(response_tx))