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

"explicit destructor calls not allowed" error message #72322

Closed
stanislav-tkach opened this issue May 18, 2020 · 1 comment · Fixed by #72383
Closed

"explicit destructor calls not allowed" error message #72322

stanislav-tkach opened this issue May 18, 2020 · 1 comment · Fixed by #72383
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@stanislav-tkach
Copy link
Contributor

Many of rustc errors contain a hint on how to fix them, but not this one. For example:

9 |     s.drop();
  |       ^^^^ explicit destructor calls not allowed

I suppose the error message can be more friendly by suggesting to use drop(s) instead of s.drop().

@csmoe csmoe added A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` labels May 18, 2020
@estebank estebank added D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 18, 2020
@stanislav-tkach
Copy link
Contributor Author

I would like to try to address this issue.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue May 29, 2020
Suggest using std::mem::drop function instead of explicit destructor call

I would prefer to give a better suggestion that includes code example, but I'm currently stuck on getting the correct span for that.

Closes rust-lang#72322.
@bors bors closed this as completed in 9c1f203 May 29, 2020
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 A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` D-papercut Diagnostics: An error or lint that needs small tweaks. 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.

3 participants