Skip to content

Instantly share code, notes, and snippets.

@rubber-duck
Created June 23, 2013 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubber-duck/5843227 to your computer and use it in GitHub Desktop.
Save rubber-duck/5843227 to your computer and use it in GitHub Desktop.
#[deriving(Clone)]
struct Foo<'self>
{
foo: &'self str
}
fn main() {
}
test.rs:1:11: 1:16 error: mismatched types: expected `&str` but found `&&'self str` (expected &str but found &-ptr)
test.rs:1 #[deriving(Clone)]
^~~~~
error: aborting due to previous error
#[deriving(Clone)]
struct Foo<'self> {
foo: &'self str,
}
#[doc = "Automatically derived."]
pub impl <'self> ::std::clone::Clone for Foo<'self> {
pub fn clone(&self) -> Foo<'self> {
match *self {
Foo{foo: ref __self_0_0} => Foo{foo: __self_0_0.clone(),}
}
}
}
fn main() { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment