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 2b06611 commit 2e3a3a2Copy full SHA for 2e3a3a2
crates/ide-diagnostics/src/handlers/unresolved_method.rs
@@ -331,7 +331,35 @@ fn main() {
331
}
332
333
#[test]
334
- fn test_add_method_fix() {
+ fn test_add_method_fix_ref_self() {
335
+ check_fix(
336
+ r#"
337
+struct Dolphin;
338
+
339
+impl Dolphin {
340
+ fn do_trick(&self) {}
341
+}
342
343
+#[allow(unused)]
344
+fn say_hi_to(dolphin: &Dolphin) {
345
+ println!("hello, {}", dolphin.name$0());
346
+}"#,
347
348
349
350
351
352
+ fn name(&self) { todo!() }
353
354
355
356
+ println!("hello, {}", dolphin.name());
357
358
+ );
359
+ }
360
361
+ #[test]
362
+ fn test_add_method_fix_self() {
363
check_fix(
364
r#"
365
struct Tiger;
0 commit comments