Skip to content

Issue with suggestion for Clone #27165

Description

@areteCocoa

I wrote an implementation for Clone but forgot to import it. Here's the error I got initially:

src/server/service.rs:123:67: 123:74 error: no method named `clone` found for type `server::service::OpenTime` in the current scope
src/server/service.rs:123             s.open_times.insert(key.clone().to_string(), (*value).clone());
                                                                                            ^~~~~~~
note: in expansion of for loop expansion
src/server/service.rs:122:9: 124:10 note: expansion site
src/server/service.rs:123:67: 123:74 help: items from traits can only be used if the trait is implemented and in scope; the following trait defines an item `clone`, perhaps you need to implement it:
src/server/service.rs:123:67: 123:74 help: candidate #1: `core::clone::Clone`

After importing core, this came next:

src/server/service.rs:8:1: 8:19 error: use of unstable library feature 'core'
src/server/service.rs:8 extern crate core;

It's a bit misleading to suggest core and not the std library version of it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions