Date: Tue, 17 Dec 2019 06:40:51 +0000 (UTC) From: Tobias Kortkamp <tobik@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r520307 - head/multimedia/termplay/files Message-ID: <201912170640.xBH6epLk016543@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tobik Date: Tue Dec 17 06:40:51 2019 New Revision: 520307 URL: https://svnweb.freebsd.org/changeset/ports/520307 Log: multimedia/termplay: Unbreak build with Rust 1.40.0 (D22843) error[E0596]: cannot borrow `**func` as mutable, as it is behind a `*const` pointer --> .../cargo-crates/gstreamer-0.11.2/src/iterator.rs:439:8 | 435 | let func = func as *const &mut (FnMut(T) -> bool); | ---- help: consider changing this to be a mutable pointer: `*mut &mut dyn std::ops::FnMut(T) -> bool` ... 439 | if (*func)(value) { | ^^^^^^^ `func` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `**func` as mutable, as it is behind a `*const` pointer --> .../cargo-crates/gstreamer-0.11.2/src/iterator.rs:455:5 | 451 | let func = func as *const &mut (FnMut(T)); | ---- help: consider changing this to be a mutable pointer: `*mut &mut dyn std::ops::FnMut(T)` ... 455 | (*func)(value); | ^^^^^^^ `func` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable error[E0596]: cannot borrow `**func` as mutable, as it is behind a `*const` pointer --> .../cargo-crates/gstreamer-0.11.2/src/iterator.rs:473:11 | 467 | let func = func as *const &mut (FnMut(U, T) -> Result<U, U>); | ---- help: consider changing this to be a mutable pointer: `*mut &mut dyn std::ops::FnMut(U, T) -> std::result::Result<U, U>` ... 473 | match (*func)(accum.take().unwrap(), value) { | ^^^^^^^ `func` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable error: aborting due to 3 previous errors Added: head/multimedia/termplay/files/ head/multimedia/termplay/files/patch-cargo-crates_gstreamer-0.11.2_src_iterator.rs (contents, props changed) Added: head/multimedia/termplay/files/patch-cargo-crates_gstreamer-0.11.2_src_iterator.rs ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/multimedia/termplay/files/patch-cargo-crates_gstreamer-0.11.2_src_iterator.rs Tue Dec 17 06:40:51 2019 (r520307) @@ -0,0 +1,38 @@ +From dba110e8ad255f7327d9f70cd7565917a303df12 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com> +Date: Wed, 8 Aug 2018 09:16:18 +0200 +Subject: [PATCH] Fix build with two-phase-borrows/NLL + +--- + gstreamer/src/iterator.rs | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- cargo-crates/gstreamer-0.11.2/src/iterator.rs.orig 2019-12-17 06:25:59 UTC ++++ cargo-crates/gstreamer-0.11.2/src/iterator.rs +@@ -432,7 +432,7 @@ where + callback_guard!(); + let value = value as *const gobject_ffi::GValue; + +- let func = func as *const &mut (FnMut(T) -> bool); ++ let func = func as *mut &mut (FnMut(T) -> bool); + let value = &*(value as *const glib::Value); + let value = value.get::<T>().unwrap(); + +@@ -448,7 +448,7 @@ where + for<'a> T: FromValueOptional<'a> + 'static, + { + callback_guard!(); +- let func = func as *const &mut (FnMut(T)); ++ let func = func as *mut &mut (FnMut(T)); + let value = &*(value as *const glib::Value); + let value = value.get::<T>().unwrap(); + +@@ -464,7 +464,7 @@ where + for<'a> T: FromValueOptional<'a> + 'static, + { + callback_guard!(); +- let func = func as *const &mut (FnMut(U, T) -> Result<U, U>); ++ let func = func as *mut &mut (FnMut(U, T) -> Result<U, U>); + let value = &*(value as *const glib::Value); + let value = value.get::<T>().unwrap(); +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912170640.xBH6epLk016543>