Bug#1066866: railway-gtk: FTBFS on i386 "type annotations needed"

Peter Green plugwash at debian.org
Thu Mar 14 17:50:53 GMT 2024


Package: railway-gtk
Version: 2.4.0-1
Severity: serious

railway-gtk FTBFS on i386 (and will probablly FTBFS on other
32-bit architectures but builds on those architectures are
currently blocked by the time64 transition).

> error[E0283]: type annotations needed for `std::option::Option<U>`
>    --> src/backend/journeys_result.rs:207:17
>     |
> 207 |             let index = list
>     |                 ^^^^^
> ...
> 215 |                 if position <= index && index < position + n_items {
>     |                             -- type must be known at this point
>     |
>     = note: multiple `impl`s satisfying `u32: PartialOrd<_>` found in the following crates: `core`, `glib`:
>             - impl PartialOrd for u32;
>             - impl PartialOrd<ULong> for u32;
> help: consider giving `index` an explicit type, where the placeholders `_` are specified
>     |
> 207 |             let index: std::option::Option<U> = list
>     |                      ++++++++++++++++++++++++

Looking at the code, I'm pretty confident that the intended type was
Option<u32>. The attached debdiff adds the annotation. I have tested
that railway-gtk builds succesfully with this patch on both i386
and amd64.
-------------- next part --------------
diff -Nru railway-gtk-2.4.0/debian/changelog railway-gtk-2.4.0/debian/changelog
--- railway-gtk-2.4.0/debian/changelog	2024-03-04 13:13:51.000000000 +0000
+++ railway-gtk-2.4.0/debian/changelog	2024-03-14 16:10:58.000000000 +0000
@@ -1,3 +1,10 @@
+railway-gtk (2.4.0-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS with "type annotation needed" error on i386.
+
+ -- Peter Michael Green <plugwash at debian.org>  Thu, 14 Mar 2024 16:10:58 +0000
+
 railway-gtk (2.4.0-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru railway-gtk-2.4.0/debian/patches/add-type-annotation.patch railway-gtk-2.4.0/debian/patches/add-type-annotation.patch
--- railway-gtk-2.4.0/debian/patches/add-type-annotation.patch	1970-01-01 00:00:00.000000000 +0000
+++ railway-gtk-2.4.0/debian/patches/add-type-annotation.patch	2024-03-14 16:10:58.000000000 +0000
@@ -0,0 +1,13 @@
+Index: railway-gtk-2.4.0/src/backend/journeys_result.rs
+===================================================================
+--- railway-gtk-2.4.0.orig/src/backend/journeys_result.rs
++++ railway-gtk-2.4.0/src/backend/journeys_result.rs
+@@ -204,7 +204,7 @@ mod imp {
+             let list = self.journeys.borrow();
+             let selection = self.selected.borrow();
+ 
+-            let index = list
++            let index: Option<u32> = list
+                 .iter()
+                 .position(|j| {
+                     j.refresh_token() == selection.as_ref().and_then(|j| j.refresh_token())
diff -Nru railway-gtk-2.4.0/debian/patches/series railway-gtk-2.4.0/debian/patches/series
--- railway-gtk-2.4.0/debian/patches/series	2024-03-04 13:13:51.000000000 +0000
+++ railway-gtk-2.4.0/debian/patches/series	2024-03-14 16:10:14.000000000 +0000
@@ -1,3 +1,4 @@
 relax-deps.diff
 disable-cargo-home-meson-build.diff
 build-set-project-name-to-railway-gtk.patch
+add-type-annotation.patch


More information about the pkg-gnome-maintainers mailing list