Closed
Description
See the following code fragment:
struct Foo {
}
fn foo(&foo: Foo) { // illegal syntax
}
fn main() {
println!("Hello, world!");
}
This generates the following confusing error:
15:29:19|~/tmp/rust_compile_error (master)$ cargo build
Compiling rust_compile_error v0.1.0 (file:///Users/ekr/tmp/rust_compile_error)
error[E0308]: mismatched types
--> src/main.rs:4:8
|
4 | fn foo(&foo: Foo) {
| ^^^^ expected struct `Foo`, found reference
|
= note: expected type `Foo`
= note: found type `&_`
error: aborting due to previous error
error: Could not compile `rust_compile_error`.