rust/src/test/compile-fail/staticness-mismatch.rs
Tim Chevalier 82017b8416 Make staticness mismatch a fatal error
Exit with a fatal error, instead of recording a non-fatal error,
when we encounter an impl method that's static when its corresponding
trait method isn't (or vice versa). This is because code later on in
the typechecker will expect the staticness of the two methods to be
consistent and ICE otherwise.

r=nmatsakis

Closes #3969
2012-11-15 18:14:13 -08:00

11 lines
164 B
Rust

trait foo {
static fn bar();
}
impl int: foo {
fn bar() {} //~ ERROR method `bar` is declared as static in its trait, but not in its impl
}
fn main() {}