mirror of
https://gitee.com/openharmony/third_party_rust_serde
synced 2024-11-23 15:01:05 +00:00
Restore compatibility with rustc <1.31 in Borrowed identifier deserializer
The implied lifetime bound on T only works on 1.31+. Older versions fail with: error[E0309]: the parameter type `T` may not live long enough --> serde/src/private/de.rs:2548:37 | 2548 | pub struct Borrowed<'de, T: ?Sized>(pub &'de T); | -- ^^^^^^^^^^ | | | help: consider adding an explicit lifetime bound `T: 'de`... | note: ...so that the reference type `&'de T` does not outlive the data it points at --> serde/src/private/de.rs:2548:37 | 2548 | pub struct Borrowed<'de, T: ?Sized>(pub &'de T); | ^^^^^^^^^^
This commit is contained in:
parent
b6a2d07f26
commit
3f48ed36cc
@ -2545,7 +2545,7 @@ pub trait IdentifierDeserializer<'de, E: Error> {
|
||||
fn from(self) -> Self::Deserializer;
|
||||
}
|
||||
|
||||
pub struct Borrowed<'de, T: ?Sized>(pub &'de T);
|
||||
pub struct Borrowed<'de, T: 'de + ?Sized>(pub &'de T);
|
||||
|
||||
impl<'de, E> IdentifierDeserializer<'de, E> for u64
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user