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