-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
Description
trait Foo {}
impl Foo for int {}
fn main() {
let ~x = ~1 as ~Foo;
let &x = &1 as &Foo;
}trait-object-pattern.rs:5:9: 5:11 error: mismatched types: expected `~Foo:Send` but found a ~-box pattern
trait-object-pattern.rs:5 let ~x = ~1 as ~Foo;
^~
trait-object-pattern.rs:6:9: 6:11 error: mismatched types: expected `&Foo<no-bounds>` but found an &-pointer pattern
trait-object-pattern.rs:6 let &x = &1 as &Foo;
^~
The error message doesn't make it obvious what the type mismatch is, since ~Foo:Send certainly appears to satisfy a ~-box pattern.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints