2016-11-30 16:35:25 -06:00
|
|
|
// Make sure associated items are recommended only in appropriate contexts.
|
|
|
|
|
|
|
|
struct S {
|
|
|
|
field: u8,
|
|
|
|
}
|
|
|
|
|
|
|
|
trait Tr {
|
|
|
|
fn method(&self);
|
|
|
|
type Type;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Tr for S {
|
|
|
|
type Type = u8;
|
|
|
|
|
|
|
|
fn method(&self) {
|
|
|
|
let _: field;
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find type `field`
|
2016-11-30 16:35:25 -06:00
|
|
|
let field(..);
|
2019-10-14 19:20:50 -05:00
|
|
|
//~^ ERROR cannot find tuple struct or tuple variant `field`
|
2016-11-30 16:35:25 -06:00
|
|
|
field;
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find value `field`
|
2016-11-30 16:35:25 -06:00
|
|
|
|
|
|
|
let _: Type;
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find type `Type`
|
2016-11-30 16:35:25 -06:00
|
|
|
let Type(..);
|
2019-10-14 19:20:50 -05:00
|
|
|
//~^ ERROR cannot find tuple struct or tuple variant `Type`
|
2016-11-30 16:35:25 -06:00
|
|
|
Type;
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find value `Type`
|
2016-11-30 16:35:25 -06:00
|
|
|
|
|
|
|
let _: method;
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find type `method`
|
2016-11-30 16:35:25 -06:00
|
|
|
let method(..);
|
2019-10-14 19:20:50 -05:00
|
|
|
//~^ ERROR cannot find tuple struct or tuple variant `method`
|
2016-11-30 16:35:25 -06:00
|
|
|
method;
|
2017-11-20 06:13:27 -06:00
|
|
|
//~^ ERROR cannot find value `method`
|
2016-11-30 16:35:25 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|