Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor suggestion of alternative function when a name is incorrect #109291

Closed
Wilfred opened this issue Mar 18, 2023 · 0 comments · Fixed by #109395
Closed

Poor suggestion of alternative function when a name is incorrect #109291

Wilfred opened this issue Mar 18, 2023 · 0 comments · Fixed by #109395
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Wilfred
Copy link
Contributor

Wilfred commented Mar 18, 2023

Code

println!("Custom backtrace: {}", std::backtrace::Backtrace::forced_capture());

Current output

error[E0599]: no function or associated item named `forced_capture` found for struct `Backtrace` in the current scope
  --> src/line_parser.rs:19:65
   |
19 |     println!("Custom backtrace: {}", std::backtrace::Backtrace::forced_capture());
   |                                                                 ^^^^^^^^^^^^^^
   |                                                                 |
   |                                                                 function or associated item not found in `Backtrace`
   |                                                                 help: there is an associated function with a similar name: `capture`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `difftastic` due to previous error

Desired output

It would be better to suggest force_capture rather than capture, as that was the function I was looking for.

Rationale and extra context

No response

Other cases

No response

Anything else?

No response

@Wilfred Wilfred added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 18, 2023
@chenyukang chenyukang self-assigned this Mar 18, 2023
@Wilfred Wilfred changed the title Poor suggestion of alternative function when a name is correct Poor suggestion of alternative function when a name is incorrect Mar 29, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 6, 2023
…gillot

Fix issue when there are multiple candidates for edit_distance_with_substrings

Fixes rust-lang#109291
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 6, 2023
…gillot

Fix issue when there are multiple candidates for edit_distance_with_substrings

Fixes rust-lang#109291
@bors bors closed this as completed in 3e21d68 Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants