Skip to content

#[deriving(Clone)] doesn't work for structs with borrowed pointers #18405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stepancheg opened this issue Oct 28, 2014 · 1 comment
Closed

#[deriving(Clone)] doesn't work for structs with borrowed pointers #18405

stepancheg opened this issue Oct 28, 2014 · 1 comment

Comments

@stepancheg
Copy link
Contributor

Code:

#[deriving(Clone)]
struct Foo<'a> {
    s: &'a String,
}

Compiler produces the message:

tmp.rs:3:5: 3:18 error: mismatched types: expected `&collections::string::String`, found `collections::string::String` (expected &-ptr, found struct collections::string::String)
tmp.rs:3     s: &'a String,
             ^~~~~~~~~~~~~
note: in expansion of #[deriving]
tmp.rs:1:1: 1:19 note: expansion site
error: aborting due to previous error
@stepancheg stepancheg changed the title deriving(Clone) doesn't work for structs with borrowed pointers #[deriving(Clone)] doesn't work for structs with borrowed pointers Oct 28, 2014
@huonw
Copy link
Member

huonw commented Oct 28, 2014

Dupe of #15689. Thanks for filing!

@huonw huonw closed this as completed Oct 28, 2014
lnicola added a commit to lnicola/rust that referenced this issue Oct 29, 2024
internal: Update changelog generation for merge queues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants