aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pal <kushalpal109@gmail.com>2024-06-24 12:07:30 +0000
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-17 16:35:52 +0100
commitd9167a76f4dc2d3060becb8a8fa47d49d827d213 (patch)
tree4518a7ede3f848d2b56570fb71f5d28f0afc5186
parent29f847e8b8cf21c12d07f2eec6a53f8bccdffeac (diff)
downloadgcc-d9167a76f4dc2d3060becb8a8fa47d49d827d213.zip
gcc-d9167a76f4dc2d3060becb8a8fa47d49d827d213.tar.gz
gcc-d9167a76f4dc2d3060becb8a8fa47d49d827d213.tar.bz2
gccrs: Fix nightly rustc warnings
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>
-rw-r--r--libgrust/libformat_parser/Cargo.toml2
-rw-r--r--libgrust/libformat_parser/generic_format_parser/src/lib.rs16
-rw-r--r--libgrust/libformat_parser/src/lib.rs14
3 files changed, 1 insertions, 31 deletions
diff --git a/libgrust/libformat_parser/Cargo.toml b/libgrust/libformat_parser/Cargo.toml
index 3c21491..39c017d 100644
--- a/libgrust/libformat_parser/Cargo.toml
+++ b/libgrust/libformat_parser/Cargo.toml
@@ -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"
diff --git a/libgrust/libformat_parser/generic_format_parser/src/lib.rs b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
index e255bf1..25f6b0e 100644
--- a/libgrust/libformat_parser/generic_format_parser/src/lib.rs
+++ b/libgrust/libformat_parser/generic_format_parser/src/lib.rs
@@ -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::*;
diff --git a/libgrust/libformat_parser/src/lib.rs b/libgrust/libformat_parser/src/lib.rs
index 0769577..f4670bf 100644
--- a/libgrust/libformat_parser/src/lib.rs
+++ b/libgrust/libformat_parser/src/lib.rs
@@ -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)]