mirror of
https://github.com/openharmony/third_party_rust_log.git
synced 2026-07-19 19:43:45 -04:00
fixup! Add Log implementation on foreign types
Removes the Pin implementation again, because of the MSRV of the crate beeing too low
This commit is contained in:
+1
-25
@@ -1283,24 +1283,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<P, T> Log for std::pin::Pin<P>
|
||||
where
|
||||
P: std::ops::Deref<Target = T> + std::marker::Send + std::marker::Sync,
|
||||
T: Log + ?Sized,
|
||||
{
|
||||
fn enabled(&self, metadata: &Metadata) -> bool {
|
||||
(**self).enabled(metadata)
|
||||
}
|
||||
|
||||
fn log(&self, record: &Record) {
|
||||
(**self).log(record)
|
||||
}
|
||||
fn flush(&self) {
|
||||
(**self).flush()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<T> Log for std::sync::Arc<T>
|
||||
where
|
||||
@@ -1900,7 +1882,7 @@ mod tests {
|
||||
fn test_foreign_impl() {
|
||||
use super::Log;
|
||||
#[cfg(feature = "std")]
|
||||
use std::{pin::Pin, sync::Arc};
|
||||
use std::sync::Arc;
|
||||
|
||||
fn assert_is_log<T: Log + ?Sized>() {}
|
||||
|
||||
@@ -1909,9 +1891,6 @@ mod tests {
|
||||
#[cfg(feature = "std")]
|
||||
assert_is_log::<Box<dyn Log>>();
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
assert_is_log::<Pin<Box<dyn Log>>>();
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
assert_is_log::<Arc<dyn Log>>();
|
||||
|
||||
@@ -1921,9 +1900,6 @@ mod tests {
|
||||
#[cfg(feature = "std")]
|
||||
assert_is_log::<Box<T>>();
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
assert_is_log::<Pin<Box<T>>>();
|
||||
|
||||
assert_is_log::<&T>();
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
|
||||
Reference in New Issue
Block a user