Sign in
android
/
toolchain
/
rustc
/
ff3f07ae99a30006dd85b9d73084edd9355c9db6
/
.
/
src
/
test
/
ui
/
lifetimes
/
lifetime-errors
/
ex1-return-one-existing-name-early-bound-in-struct.rs
blob: 35f70dd1982f3fe70d2863555544051c5627da0c [
file
] [
log
] [
blame
]
#[
derive
(
Clone
)]
enum
Foo
<
'
a
>
{
Bar
(&
'
a str
),
}
impl
<
'a> Foo<'
a
>
{
fn
bar
(&
self
,
other
:
Foo
)
->
Foo
<
'
a
>
{
match
*
self
{
Foo
::
Bar
(
s
)
=>
{
if
s
==
"test"
{
other
//~ ERROR explicit lifetime
}
else
{
self
.
clone
()
}
}
}
}
}
fn
main
()
{
}