-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-syntaxextArea: Syntax extensionsArea: Syntax extensions
Description
Compiling the following:
struct Foo {
foo: bool,
}
#[deriving(Clone)]
struct Bar {
foo: Foo,
}
fn main() {
let a = Bar { foo: Foo { foo: true }};
a.clone();
}
produces
clonespan.rs:5:11: 5:16 error: mismatched types: expected `Foo` but found `&Foo` (expected struct Foo but found &-ptr)
clonespan.rs:5 #[deriving(Clone)]
^~~~~
The real error is that Foo
doesn't implement Clone
. The span should also probably point to Foo
in the definition for Bar
instead of to the deriving line.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-syntaxextArea: Syntax extensionsArea: Syntax extensions