We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 486710c commit 2896849Copy full SHA for 2896849
crates/ide-diagnostics/src/handlers/unresolved_method.rs
@@ -334,7 +334,35 @@ fn main() {
334
}
335
336
#[test]
337
- fn test_add_method_fix() {
+ fn test_add_method_fix_ref_self() {
338
+ check_fix(
339
+ r#"
340
+struct Dolphin;
341
+
342
+impl Dolphin {
343
+ fn do_trick(&self) {}
344
+}
345
346
+#[allow(unused)]
347
+fn say_hi_to(dolphin: &Dolphin) {
348
+ println!("hello, {}", dolphin.name$0());
349
+}"#,
350
351
352
353
354
355
+ fn name(&self) { todo!() }
356
357
358
359
+ println!("hello, {}", dolphin.name());
360
361
+ );
362
+ }
363
364
+ #[test]
365
+ fn test_add_method_fix_self() {
366
check_fix(
367
r#"
368
struct Tiger;
0 commit comments