diff --git a/libgrust/libformat_parser/generic_format_parser/src/lib.rs b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
index 6a366177f252349bcf0beeed378b55a36a52e2ec..8062bf9e5cec95c60213c44e835f09afd6e8fbbc 100644
--- a/libgrust/libformat_parser/generic_format_parser/src/lib.rs
+++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
@@ -22,6 +22,22 @@ fn is_id_continue(c: char) -> bool {
     unicode_xid::UnicodeXID::is_xid_continue(c)
 }
 
+// Workaround for Ubuntu 18.04. The default Rust package is 1.65 (and unlikely to change I assume?), but the
+// generic format parser library uses `is_some_and` which was introduced in 1.70. So this is a reimplementation,
+// directly taken from the standard library sources
+trait IsSomeAnd<T> {
+    fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool;
+}
+
+impl<T> IsSomeAnd<T> for Option<T> {
+    fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool {
+        match self {
+            None => false,
+            Some(x) => f(x),
+        }
+    }
+}
+
 // use rustc_lexer::unescape;
 pub use Alignment::*;
 pub use Count::*;