rust/tests/ui/methods/method-not-found-but-doc-alias.stderr
Robin Schroer f908f0be5a
Consider doc(alias) when providing typo suggestions
This means that

```rust
impl Foo {
    #[doc(alias = "quux")]
    fn bar(&self) {}
}

fn main() {
    (Foo {}).quux();
}
```

will suggest `bar`. This currently uses the "there is a method with a
similar name" help text, because the point where we choose and emit a
suggestion is different from where we gather the suggestions. Changes
have mainly been made to the latter.

The selection code will now fall back to aliased candidates, but
generally only if there is no candidate that matches based on the
existing Levenshtein methodology.

Fixes #83968.
2023-01-23 10:07:10 +09:00

13 lines
410 B
Plaintext

error[E0599]: no method named `quux` found for struct `Foo` in the current scope
--> $DIR/method-not-found-but-doc-alias.rs:9:9
|
LL | struct Foo;
| ---------- method `quux` not found for this struct
...
LL | Foo.quux();
| ^^^^ help: there is a method with a similar name: `bar`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.