about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-29 05:45:18 +0000
committerbors <bors@rust-lang.org>2023-09-29 05:45:18 +0000
commitc1f86f0bc87eaa0cf16bcf3de38793096ec4db94 (patch)
tree8c53814c0bb97c458d5ea39098283691f08a1b0c /tests
parenta327e753bc873d5f5dc1820151a6cdf3dac0a39c (diff)
parentd00c7e78ea9e887e7e7d04dbe6c233444f4e6295 (diff)
downloadrust-c1f86f0bc87eaa0cf16bcf3de38793096ec4db94.tar.gz
rust-c1f86f0bc87eaa0cf16bcf3de38793096ec4db94.zip
Auto merge of #116089 - estebank:issue-115992-2, r=compiler-errors
When suggesting `self.x` for `S { x }`, use `S { x: self.x }`

Fix #115992.

r? `@compiler-errors`

Follow up to #116086.
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/resolve/associated-fn-called-as-fn.stderr14
-rw-r--r--tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs3
-rw-r--r--tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.stderr26
-rw-r--r--tests/ui/resolve/issue-14254.stderr98
-rw-r--r--tests/ui/resolve/issue-2356.stderr38
-rw-r--r--tests/ui/resolve/issue-60057.stderr12
-rw-r--r--tests/ui/resolve/resolve-assoc-suggestions.stderr21
-rw-r--r--tests/ui/resolve/resolve-speculative-adjustment.stderr14
-rw-r--r--tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr26
-rw-r--r--tests/ui/resolve/unresolved_static_type_field.stderr5
-rw-r--r--tests/ui/self/class-missing-self.stderr7
-rw-r--r--tests/ui/suggestions/assoc-type-in-method-return.stderr7
12 files changed, 218 insertions, 53 deletions
diff --git a/tests/ui/resolve/associated-fn-called-as-fn.stderr b/tests/ui/resolve/associated-fn-called-as-fn.stderr
index fbdea30d551..7d28b959a1a 100644
--- a/tests/ui/resolve/associated-fn-called-as-fn.stderr
+++ b/tests/ui/resolve/associated-fn-called-as-fn.stderr
@@ -2,13 +2,23 @@ error[E0425]: cannot find function `collect_primary` in this scope
   --> $DIR/associated-fn-called-as-fn.rs:6:30
    |
 LL |                 '0'..='9' => collect_primary(&c),
-   |                              ^^^^^^^^^^^^^^^ help: you might have meant to call the associated function: `Self::collect_primary`
+   |                              ^^^^^^^^^^^^^^^
+   |
+help: you might have meant to call the associated function
+   |
+LL |                 '0'..='9' => Self::collect_primary(&c),
+   |                              ++++++
 
 error[E0425]: cannot find function `collect_primary` in this scope
   --> $DIR/associated-fn-called-as-fn.rs:23:30
    |
 LL |                 '0'..='9' => collect_primary(&c),
-   |                              ^^^^^^^^^^^^^^^ help: you might have meant to call the associated function: `Self::collect_primary`
+   |                              ^^^^^^^^^^^^^^^
+   |
+help: you might have meant to call the associated function
+   |
+LL |                 '0'..='9' => Self::collect_primary(&c),
+   |                              ++++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs b/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs
index 9e72c36151e..b5f13959081 100644
--- a/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs
+++ b/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.rs
@@ -11,5 +11,8 @@ impl Foo {
         field; //~ ERROR cannot find value `field` in this scope
         Foo { field } //~ ERROR cannot find value `field` in this scope
     }
+    fn clone(&self) -> Foo {
+        Foo { field } //~ ERROR cannot find value `field` in this scope
+    }
 }
 fn main() {}
diff --git a/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.stderr b/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.stderr
index 2eb3861e5f1..3c44c1c249c 100644
--- a/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.stderr
+++ b/tests/ui/resolve/field-and-method-in-self-not-available-in-assoc-fn.stderr
@@ -1,21 +1,41 @@
 error[E0425]: cannot find value `field` in this scope
   --> $DIR/field-and-method-in-self-not-available-in-assoc-fn.rs:11:9
    |
+LL |     field: u32,
+   |     ---------- a field by that name exists in `Self`
+...
 LL |     fn field(&self) -> u32 {
    |        ----- a method by that name is available on `Self` here
 ...
 LL |         field;
-   |         ^^^^^ a field by this name exists in `Self`
+   |         ^^^^^
 
 error[E0425]: cannot find value `field` in this scope
   --> $DIR/field-and-method-in-self-not-available-in-assoc-fn.rs:12:15
    |
+LL |     field: u32,
+   |     ---------- a field by that name exists in `Self`
+...
 LL |     fn field(&self) -> u32 {
    |        ----- a method by that name is available on `Self` here
 ...
 LL |         Foo { field }
-   |               ^^^^^ a field by this name exists in `Self`
+   |               ^^^^^
+
+error[E0425]: cannot find value `field` in this scope
+  --> $DIR/field-and-method-in-self-not-available-in-assoc-fn.rs:15:15
+   |
+LL |     fn field(&self) -> u32 {
+   |        ----- a method by that name is available on `Self` here
+...
+LL |         Foo { field }
+   |               ^^^^^
+   |
+help: you might have meant to use the available field
+   |
+LL |         Foo { field: self.field }
+   |               ++++++++++++
 
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0425`.
diff --git a/tests/ui/resolve/issue-14254.stderr b/tests/ui/resolve/issue-14254.stderr
index 690a40f7edd..9284b4babc5 100644
--- a/tests/ui/resolve/issue-14254.stderr
+++ b/tests/ui/resolve/issue-14254.stderr
@@ -8,13 +8,23 @@ error[E0425]: cannot find value `x` in this scope
   --> $DIR/issue-14254.rs:30:9
    |
 LL |         x;
-   |         ^ help: you might have meant to use the available field: `self.x`
+   |         ^
+   |
+help: you might have meant to use the available field
+   |
+LL |         self.x;
+   |         +++++
 
 error[E0425]: cannot find value `y` in this scope
   --> $DIR/issue-14254.rs:32:9
    |
 LL |         y;
-   |         ^ help: you might have meant to use the available field: `self.y`
+   |         ^
+   |
+help: you might have meant to use the available field
+   |
+LL |         self.y;
+   |         +++++
 
 error[E0425]: cannot find value `a` in this scope
   --> $DIR/issue-14254.rs:34:9
@@ -31,7 +41,7 @@ LL |         bah;
 help: you might have meant to refer to the associated function
    |
 LL |         Self::bah;
-   |         ~~~~~~~~~
+   |         ++++++
 
 error[E0425]: cannot find value `b` in this scope
   --> $DIR/issue-14254.rs:38:9
@@ -43,13 +53,23 @@ error[E0425]: cannot find value `x` in this scope
   --> $DIR/issue-14254.rs:47:9
    |
 LL |         x;
-   |         ^ help: you might have meant to use the available field: `self.x`
+   |         ^
+   |
+help: you might have meant to use the available field
+   |
+LL |         self.x;
+   |         +++++
 
 error[E0425]: cannot find value `y` in this scope
   --> $DIR/issue-14254.rs:49:9
    |
 LL |         y;
-   |         ^ help: you might have meant to use the available field: `self.y`
+   |         ^
+   |
+help: you might have meant to use the available field
+   |
+LL |         self.y;
+   |         +++++
 
 error[E0425]: cannot find value `a` in this scope
   --> $DIR/issue-14254.rs:51:9
@@ -66,7 +86,7 @@ LL |         bah;
 help: you might have meant to refer to the associated function
    |
 LL |         Self::bah;
-   |         ~~~~~~~~~
+   |         ++++++
 
 error[E0425]: cannot find value `b` in this scope
   --> $DIR/issue-14254.rs:55:9
@@ -83,7 +103,7 @@ LL |         bah;
 help: you might have meant to refer to the associated function
    |
 LL |         Self::bah;
-   |         ~~~~~~~~~
+   |         ++++++
 
 error[E0425]: cannot find value `bah` in this scope
   --> $DIR/issue-14254.rs:73:9
@@ -94,7 +114,7 @@ LL |         bah;
 help: you might have meant to refer to the associated function
    |
 LL |         Self::bah;
-   |         ~~~~~~~~~
+   |         ++++++
 
 error[E0425]: cannot find value `bah` in this scope
   --> $DIR/issue-14254.rs:82:9
@@ -105,7 +125,7 @@ LL |         bah;
 help: you might have meant to refer to the associated function
    |
 LL |         Self::bah;
-   |         ~~~~~~~~~
+   |         ++++++
 
 error[E0425]: cannot find value `bah` in this scope
   --> $DIR/issue-14254.rs:91:9
@@ -116,7 +136,7 @@ LL |         bah;
 help: you might have meant to refer to the associated function
    |
 LL |         Self::bah;
-   |         ~~~~~~~~~
+   |         ++++++
 
 error[E0425]: cannot find value `bah` in this scope
   --> $DIR/issue-14254.rs:100:9
@@ -127,55 +147,95 @@ LL |         bah;
 help: you might have meant to refer to the associated function
    |
 LL |         Self::bah;
-   |         ~~~~~~~~~
+   |         ++++++
 
 error[E0425]: cannot find function `baz` in this scope
   --> $DIR/issue-14254.rs:19:9
    |
 LL |         baz();
-   |         ^^^ help: you might have meant to call the method: `self.baz`
+   |         ^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.baz();
+   |         +++++
 
 error[E0425]: cannot find function `baz` in this scope
   --> $DIR/issue-14254.rs:28:9
    |
 LL |         baz();
-   |         ^^^ help: you might have meant to call the method: `self.baz`
+   |         ^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.baz();
+   |         +++++
 
 error[E0425]: cannot find function `baz` in this scope
   --> $DIR/issue-14254.rs:45:9
    |
 LL |         baz();
-   |         ^^^ help: you might have meant to call the method: `self.baz`
+   |         ^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.baz();
+   |         +++++
 
 error[E0425]: cannot find function `baz` in this scope
   --> $DIR/issue-14254.rs:62:9
    |
 LL |         baz();
-   |         ^^^ help: you might have meant to call the method: `self.baz`
+   |         ^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.baz();
+   |         +++++
 
 error[E0425]: cannot find function `baz` in this scope
   --> $DIR/issue-14254.rs:71:9
    |
 LL |         baz();
-   |         ^^^ help: you might have meant to call the method: `self.baz`
+   |         ^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.baz();
+   |         +++++
 
 error[E0425]: cannot find function `baz` in this scope
   --> $DIR/issue-14254.rs:80:9
    |
 LL |         baz();
-   |         ^^^ help: you might have meant to call the method: `self.baz`
+   |         ^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.baz();
+   |         +++++
 
 error[E0425]: cannot find function `baz` in this scope
   --> $DIR/issue-14254.rs:89:9
    |
 LL |         baz();
-   |         ^^^ help: you might have meant to call the method: `self.baz`
+   |         ^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.baz();
+   |         +++++
 
 error[E0425]: cannot find function `baz` in this scope
   --> $DIR/issue-14254.rs:98:9
    |
 LL |         baz();
-   |         ^^^ help: you might have meant to call the method: `self.baz`
+   |         ^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.baz();
+   |         +++++
 
 error: aborting due to 24 previous errors
 
diff --git a/tests/ui/resolve/issue-2356.stderr b/tests/ui/resolve/issue-2356.stderr
index 273e8b2a661..5f75ae98870 100644
--- a/tests/ui/resolve/issue-2356.stderr
+++ b/tests/ui/resolve/issue-2356.stderr
@@ -1,8 +1,11 @@
 error[E0425]: cannot find value `whiskers` in this scope
   --> $DIR/issue-2356.rs:39:5
    |
+LL |   whiskers: isize,
+   |   --------------- a field by that name exists in `Self`
+...
 LL |     whiskers -= other;
-   |     ^^^^^^^^ a field by this name exists in `Self`
+   |     ^^^^^^^^
 
 error[E0424]: expected value, found module `self`
   --> $DIR/issue-2356.rs:65:8
@@ -21,13 +24,21 @@ error[E0425]: cannot find value `whiskers` in this scope
   --> $DIR/issue-2356.rs:79:5
    |
 LL |     whiskers = 0;
-   |     ^^^^^^^^ help: you might have meant to use the available field: `self.whiskers`
+   |     ^^^^^^^^
+   |
+help: you might have meant to use the available field
+   |
+LL |     self.whiskers = 0;
+   |     +++++
 
 error[E0425]: cannot find value `whiskers` in this scope
   --> $DIR/issue-2356.rs:84:5
    |
+LL |   whiskers: isize,
+   |   --------------- a field by that name exists in `Self`
+...
 LL |     whiskers = 4;
-   |     ^^^^^^^^ a field by this name exists in `Self`
+   |     ^^^^^^^^
 
 error[E0424]: expected value, found module `self`
   --> $DIR/issue-2356.rs:92:5
@@ -47,19 +58,34 @@ error[E0425]: cannot find function `clone` in this scope
   --> $DIR/issue-2356.rs:24:5
    |
 LL |     clone();
-   |     ^^^^^ help: you might have meant to call the method: `self.clone`
+   |     ^^^^^
+   |
+help: you might have meant to call the method
+   |
+LL |     self.clone();
+   |     +++++
 
 error[E0425]: cannot find function `default` in this scope
   --> $DIR/issue-2356.rs:31:5
    |
 LL |     default();
-   |     ^^^^^^^ help: you might have meant to call the associated function: `Self::default`
+   |     ^^^^^^^
+   |
+help: you might have meant to call the associated function
+   |
+LL |     Self::default();
+   |     ++++++
 
 error[E0425]: cannot find function `shave` in this scope
   --> $DIR/issue-2356.rs:41:5
    |
 LL |     shave(4);
-   |     ^^^^^ help: you might have meant to call the associated function: `Self::shave`
+   |     ^^^^^
+   |
+help: you might have meant to call the associated function
+   |
+LL |     Self::shave(4);
+   |     ++++++
 
 error[E0425]: cannot find function `purr` in this scope
   --> $DIR/issue-2356.rs:43:5
diff --git a/tests/ui/resolve/issue-60057.stderr b/tests/ui/resolve/issue-60057.stderr
index 4d915fcd9fe..a2ab8644353 100644
--- a/tests/ui/resolve/issue-60057.stderr
+++ b/tests/ui/resolve/issue-60057.stderr
@@ -1,14 +1,22 @@
 error[E0425]: cannot find value `banana` in this scope
   --> $DIR/issue-60057.rs:8:21
    |
+LL |     banana: u8,
+   |     ---------- a field by that name exists in `Self`
+...
 LL |             banana: banana
-   |                     ^^^^^^ a field by this name exists in `Self`
+   |                     ^^^^^^
 
 error[E0425]: cannot find value `banana` in this scope
   --> $DIR/issue-60057.rs:14:21
    |
 LL |             banana: banana
-   |                     ^^^^^^ help: you might have meant to use the available field: `self.banana`
+   |                     ^^^^^^
+   |
+help: you might have meant to use the available field
+   |
+LL |             banana: self.banana
+   |                     +++++
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/resolve/resolve-assoc-suggestions.stderr b/tests/ui/resolve/resolve-assoc-suggestions.stderr
index 8def9aa2025..3d9d4ffaa10 100644
--- a/tests/ui/resolve/resolve-assoc-suggestions.stderr
+++ b/tests/ui/resolve/resolve-assoc-suggestions.stderr
@@ -14,13 +14,23 @@ error[E0425]: cannot find value `field` in this scope
   --> $DIR/resolve-assoc-suggestions.rs:20:9
    |
 LL |         field;
-   |         ^^^^^ help: you might have meant to use the available field: `self.field`
+   |         ^^^^^
+   |
+help: you might have meant to use the available field
+   |
+LL |         self.field;
+   |         +++++
 
 error[E0412]: cannot find type `Type` in this scope
   --> $DIR/resolve-assoc-suggestions.rs:23:16
    |
 LL |         let _: Type;
-   |                ^^^^ help: you might have meant to use the associated type: `Self::Type`
+   |                ^^^^
+   |
+help: you might have meant to use the associated type
+   |
+LL |         let _: Self::Type;
+   |                ++++++
 
 error[E0531]: cannot find tuple struct or tuple variant `Type` in this scope
   --> $DIR/resolve-assoc-suggestions.rs:25:13
@@ -50,7 +60,12 @@ error[E0425]: cannot find value `method` in this scope
   --> $DIR/resolve-assoc-suggestions.rs:34:9
    |
 LL |         method;
-   |         ^^^^^^ help: you might have meant to refer to the method: `self.method`
+   |         ^^^^^^
+   |
+help: you might have meant to refer to the method
+   |
+LL |         self.method;
+   |         +++++
 
 error: aborting due to 9 previous errors
 
diff --git a/tests/ui/resolve/resolve-speculative-adjustment.stderr b/tests/ui/resolve/resolve-speculative-adjustment.stderr
index be11a7ebeca..fb15472bdae 100644
--- a/tests/ui/resolve/resolve-speculative-adjustment.stderr
+++ b/tests/ui/resolve/resolve-speculative-adjustment.stderr
@@ -8,13 +8,23 @@ error[E0425]: cannot find value `field` in this scope
   --> $DIR/resolve-speculative-adjustment.rs:23:9
    |
 LL |         field;
-   |         ^^^^^ help: you might have meant to use the available field: `self.field`
+   |         ^^^^^
+   |
+help: you might have meant to use the available field
+   |
+LL |         self.field;
+   |         +++++
 
 error[E0425]: cannot find function `method` in this scope
   --> $DIR/resolve-speculative-adjustment.rs:25:9
    |
 LL |         method();
-   |         ^^^^^^ help: you might have meant to call the method: `self.method`
+   |         ^^^^^^
+   |
+help: you might have meant to call the method
+   |
+LL |         self.method();
+   |         +++++
 
 error[E0425]: cannot find function `method` in this scope
   --> $DIR/resolve-speculative-adjustment.rs:19:13
diff --git a/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr b/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
index f32e0404e46..0306c8af87d 100644
--- a/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
+++ b/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
@@ -1,20 +1,20 @@
 error[E0425]: cannot find value `config` in this scope
   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:7:16
    |
+LL |     config: String,
+   |     -------------- a field by that name exists in `Self`
+...
 LL |         Self { config }
-   |                ^^^^^^
-   |                |
-   |                a field by this name exists in `Self`
-   |                help: a local variable with a similar name exists: `cofig`
+   |                ^^^^^^ help: a local variable with a similar name exists: `cofig`
 
 error[E0425]: cannot find value `config` in this scope
   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:11:20
    |
+LL |     config: String,
+   |     -------------- a field by that name exists in `Self`
+...
 LL |         println!("{config}");
-   |                    ^^^^^^
-   |                    |
-   |                    a field by this name exists in `Self`
-   |                    help: a local variable with a similar name exists: `cofig`
+   |                    ^^^^^^ help: a local variable with a similar name exists: `cofig`
 
 error[E0425]: cannot find value `config` in this scope
   --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:15:20
@@ -25,7 +25,7 @@ LL |         println!("{config}");
 help: you might have meant to use the available field
    |
 LL |         println!("{self.config}");
-   |                    ~~~~~~~~~~~
+   |                    +++++
 help: a local variable with a similar name exists
    |
 LL |         println!("{cofig}");
@@ -43,7 +43,7 @@ LL | fn ba() {}
 help: you might have meant to refer to the associated function
    |
 LL |         Self::bah;
-   |         ~~~~~~~~~
+   |         ++++++
 help: a function with a similar name exists
    |
 LL |         ba;
@@ -61,7 +61,7 @@ LL | const BARR: u32 = 3;
 help: you might have meant to use the associated `const`
    |
 LL |         Self::BAR;
-   |         ~~~~~~~~~
+   |         ++++++
 help: a constant with a similar name exists
    |
 LL |         BARR;
@@ -79,7 +79,7 @@ LL | type Bar = String;
 help: you might have meant to use the associated type
    |
 LL |         let foo: Self::Baz = "".to_string();
-   |                  ~~~~~~~~~
+   |                  ++++++
 help: a type alias with a similar name exists
    |
 LL |         let foo: Bar = "".to_string();
@@ -97,7 +97,7 @@ LL | fn ba() {}
 help: you might have meant to call the method
    |
 LL |         self.baz();
-   |         ~~~~~~~~
+   |         +++++
 help: a function with a similar name exists
    |
 LL |         ba();
diff --git a/tests/ui/resolve/unresolved_static_type_field.stderr b/tests/ui/resolve/unresolved_static_type_field.stderr
index 06926b53ddd..035dc9b9656 100644
--- a/tests/ui/resolve/unresolved_static_type_field.stderr
+++ b/tests/ui/resolve/unresolved_static_type_field.stderr
@@ -1,8 +1,11 @@
 error[E0425]: cannot find value `cx` in this scope
   --> $DIR/unresolved_static_type_field.rs:9:11
    |
+LL |     cx: bool,
+   |     -------- a field by that name exists in `Self`
+...
 LL |         f(cx);
-   |           ^^ a field by this name exists in `Self`
+   |           ^^
 
 error: aborting due to previous error
 
diff --git a/tests/ui/self/class-missing-self.stderr b/tests/ui/self/class-missing-self.stderr
index 08493b4f9a2..ca7a896200f 100644
--- a/tests/ui/self/class-missing-self.stderr
+++ b/tests/ui/self/class-missing-self.stderr
@@ -2,7 +2,12 @@ error[E0425]: cannot find value `meows` in this scope
   --> $DIR/class-missing-self.rs:9:7
    |
 LL |       meows += 1;
-   |       ^^^^^ help: you might have meant to use the available field: `self.meows`
+   |       ^^^^^
+   |
+help: you might have meant to use the available field
+   |
+LL |       self.meows += 1;
+   |       +++++
 
 error[E0425]: cannot find function `sleep` in this scope
   --> $DIR/class-missing-self.rs:10:7
diff --git a/tests/ui/suggestions/assoc-type-in-method-return.stderr b/tests/ui/suggestions/assoc-type-in-method-return.stderr
index 202e4a16ead..df3828ad411 100644
--- a/tests/ui/suggestions/assoc-type-in-method-return.stderr
+++ b/tests/ui/suggestions/assoc-type-in-method-return.stderr
@@ -2,7 +2,12 @@ error[E0412]: cannot find type `Bla` in this scope
   --> $DIR/assoc-type-in-method-return.rs:3:25
    |
 LL |     fn to_bla(&self) -> Bla;
-   |                         ^^^ help: you might have meant to use the associated type: `Self::Bla`
+   |                         ^^^
+   |
+help: you might have meant to use the associated type
+   |
+LL |     fn to_bla(&self) -> Self::Bla;
+   |                         ++++++
 
 error: aborting due to previous error