2024-12-25 14:54:49 +08:00
|
|
|
//@ revisions: normal import_trait_associated_functions
|
|
|
|
|
#![cfg_attr(import_trait_associated_functions, feature(import_trait_associated_functions))]
|
2022-10-05 06:42:26 +00:00
|
|
|
struct Foo;
|
2024-12-25 14:54:49 +08:00
|
|
|
//[import_trait_associated_functions]~^ HELP consider importing one of these associated functions
|
|
|
|
|
//[import_trait_associated_functions]~| HELP consider importing this associated function
|
2022-10-05 06:42:26 +00:00
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
|
fn bar(self) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
let x = cmp(&1, &2);
|
|
|
|
|
//~^ ERROR cannot find function `cmp` in this scope
|
2024-12-25 14:54:49 +08:00
|
|
|
//[normal]~| HELP use the `.` operator to call the method `Ord::cmp` on `&{integer}`
|
2022-10-05 06:42:26 +00:00
|
|
|
|
|
|
|
|
let y = len([1, 2, 3]);
|
|
|
|
|
//~^ ERROR cannot find function `len` in this scope
|
2024-12-25 14:54:49 +08:00
|
|
|
//[normal]~| HELP use the `.` operator to call the method `len` on `&[{integer}]`
|
2022-10-05 06:42:26 +00:00
|
|
|
|
|
|
|
|
let z = bar(Foo);
|
|
|
|
|
//~^ ERROR cannot find function `bar` in this scope
|
|
|
|
|
//~| HELP use the `.` operator to call the method `bar` on `Foo`
|
|
|
|
|
}
|