-
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 lintsC-bugCategory: This is a bug.Category: This is a bug.
Description
Hey all,
With the following piece of code (rust playground):
struct Foo {}
struct Bar {}
fn hey(pouet: Vec<Bar>){}
fn main() {
let foo = vec![Foo {}];
hey(foo);
}
rustc gives me the following error
error[E0308]: mismatched types
--> a.rs:8:9
|
8 | hey(foo);
| ^^^ expected struct `Bar`, found struct `Foo`
|
= note: expected type `std::vec::Vec<Bar>`
found type `std::vec::Vec<Foo>`
= help: here are some functions which might fulfill your needs:
- .to_vec()
which doesn't make sense since .to_vec()
wouldn't in any case convert the inner type.
kennytm
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.