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:
piegames
2021-11-17 18:18:53 +01:00
parent 3f4f25a2d7
commit 4fd6f95f4f
+1 -25
View File
@@ -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")]