2014-04-24 05:19:23 +08:00
|
|
|
// Test that parameter cardinality or missing method error gets span exactly.
|
|
|
|
|
|
2017-12-10 23:29:24 +03:00
|
|
|
pub struct Foo;
|
2014-04-24 05:19:23 +08:00
|
|
|
impl Foo {
|
|
|
|
|
fn zero(self) -> Foo { self }
|
2015-01-08 21:54:35 +11:00
|
|
|
fn one(self, _: isize) -> Foo { self }
|
|
|
|
|
fn two(self, _: isize, _: isize) -> Foo { self }
|
2014-04-24 05:19:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let x = Foo;
|
|
|
|
|
x.zero(0) //~ ERROR this function takes 0 parameters but 1 parameter was supplied
|
|
|
|
|
.one() //~ ERROR this function takes 1 parameter but 0 parameters were supplied
|
|
|
|
|
.two(0); //~ ERROR this function takes 2 parameters but 1 parameter was supplied
|
|
|
|
|
|
|
|
|
|
let y = Foo;
|
|
|
|
|
y.zero()
|
2020-01-08 08:05:31 -08:00
|
|
|
.take() //~ ERROR no method named `take` found
|
2014-04-24 05:19:23 +08:00
|
|
|
.one(0);
|
|
|
|
|
}
|