2014-04-23 16:19:23 -05:00
|
|
|
// Test that parameter cardinality or missing method error gets span exactly.
|
|
|
|
|
2017-12-10 14:29:24 -06:00
|
|
|
pub struct Foo;
|
2014-04-23 16:19:23 -05:00
|
|
|
impl Foo {
|
|
|
|
fn zero(self) -> Foo { self }
|
2015-01-08 04:54:35 -06:00
|
|
|
fn one(self, _: isize) -> Foo { self }
|
|
|
|
fn two(self, _: isize, _: isize) -> Foo { self }
|
2020-02-05 23:08:07 -06:00
|
|
|
fn three<T>(self, _: T, _: T, _: T) -> Foo { self }
|
2014-04-23 16:19:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = Foo;
|
2023-01-04 21:02:10 -06:00
|
|
|
x.zero(0) //~ ERROR this method takes 0 arguments but 1 argument was supplied
|
|
|
|
.one() //~ ERROR this method takes 1 argument but 0 arguments were supplied
|
|
|
|
.two(0); //~ ERROR this method takes 2 arguments but 1 argument was supplied
|
2014-04-23 16:19:23 -05:00
|
|
|
|
|
|
|
let y = Foo;
|
|
|
|
y.zero()
|
2022-03-08 12:04:20 -06:00
|
|
|
.take() //~ ERROR not an iterator
|
2014-04-23 16:19:23 -05:00
|
|
|
.one(0);
|
2023-01-04 21:02:10 -06:00
|
|
|
y.three::<usize>(); //~ ERROR this method takes 3 arguments but 0 arguments were supplied
|
2014-04-23 16:19:23 -05:00
|
|
|
}
|