]>
git.proxmox.com Git - rustc.git/blob - tests/ui/traits/auxiliary/issue_89119_intercrate_caching.rs
1 // This is the auxiliary crate for the regression test for issue #89119, minimized
2 // from `zvariant-2.8.0`.
4 use std
::convert
::TryFrom
;
7 pub struct Str
<'a
>(Cow
<'a
, str>);
9 pub fn to_owned(&self) -> Str
<'
static> {
16 Value(Box
<Value
<'a
>>),
19 pub fn to_owned(&self) -> Value
<'
static> {
21 Value
::Str(v
) => Value
::Str(v
.to_owned()),
23 let o
= OwnedValue
::from(&**v
);
24 Value
::Value(Box
::new(o
.into_inner()))
30 struct OwnedValue(Value
<'
static>);
32 pub(crate) fn into_inner(self) -> Value
<'
static> {
36 impl<'a
, T
> TryFrom
<OwnedValue
> for Vec
<T
>
38 T
: TryFrom
<Value
<'a
>, Error
= ()>,
41 fn try_from(_
: OwnedValue
) -> Result
<Self, Self::Error
> {
45 impl TryFrom
<OwnedValue
> for Vec
<OwnedValue
> {
47 fn try_from(_
: OwnedValue
) -> Result
<Self, Self::Error
> {
51 impl<'a
> From
<Value
<'a
>> for OwnedValue
{
52 fn from(_
: Value
<'a
>) -> Self {
56 impl<'a
> From
<&Value
<'a
>> for OwnedValue
{
57 fn from(_
: &Value
<'a
>) -> Self {