rust/src/test/ui/issues/issue-60057.rs
Mark Rousskov b7f20d06ea Provide a span if main function is not present in crate
Unfortunately, the diagnotic machinery does not cope well with an empty
span which can happen if the crate is empty, in which case we merely set
a spanless note.
2019-09-14 11:27:45 -04:00

20 lines
333 B
Rust

struct A {
banana: u8,
}
impl A {
fn new(peach: u8) -> A {
A {
banana: banana //~ ERROR cannot find value `banana` in this scope
}
}
fn foo(&self, peach: u8) -> A {
A {
banana: banana //~ ERROR cannot find value `banana` in this scope
}
}
}
fn main() {}