]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Fix nightly rustc warnings
authorKushal Pal <kushalpal109@gmail.com>
Mon, 24 Jun 2024 12:07:30 +0000 (12:07 +0000)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 17 Mar 2025 15:35:52 +0000 (16:35 +0100)
libgrust/ChangeLog:

* libformat_parser/Cargo.toml:
Used crate-type instead of depricated crate_type.
* libformat_parser/generic_format_parser/src/lib.rs:
Remove dead code.
* libformat_parser/src/lib.rs: Likewise.

Signed-off-by: Kushal Pal <kushalpal109@gmail.com>
libgrust/libformat_parser/Cargo.toml
libgrust/libformat_parser/generic_format_parser/src/lib.rs
libgrust/libformat_parser/src/lib.rs

index 3c214915d31e4db633dcd47f572a38231793e4a4..39c017d249b79b7a1f816d6afa62ce10507ebf4a 100644 (file)
@@ -14,7 +14,7 @@ libc = "0.2"
 generic_format_parser = { path = "generic_format_parser" }
 
 [lib]
-crate_type = ["staticlib", "rlib"]
+crate-type = ["staticlib", "rlib"]
 
 [[bin]]
 name = "format_parser_test"
index e255bf16908fb969133f41c426c774fea7a643c3..25f6b0ead170d81ae8cf3f5678a5dd2279597ee4 100644 (file)
@@ -22,22 +22,6 @@ 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::*;
index 0769577740f4c3a168cad85ede0701f550b41e65..f4670bf9b1f76fd766957ae7b7f934674351022b 100644 (file)
@@ -5,16 +5,6 @@
 
 use std::ffi::CStr;
 
-trait StringLeakExt {
-    fn leak<'a>(self) -> &'a mut str;
-}
-
-impl StringLeakExt for String {
-    fn leak<'a>(self) -> &'a mut str {
-        Box::leak(self.into_boxed_str())
-    }
-}
-
 trait IntoFFI<T> {
     fn into_ffi(self) -> T;
 }
@@ -98,10 +88,6 @@ mod ffi {
     //     InlineAsm,
     // }
 
-    #[derive(Copy, Clone)]
-    #[repr(C)]
-    struct InnerOffset(usize);
-
     /// A piece is a portion of the format string which represents the next part
     /// to emit. These are emitted as a stream by the `Parser` class.
     #[derive(Debug, Clone, PartialEq)]