-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Incorrect let_underscore_drop warning on type without Drop implementation #130430
Comments
Well, even if the Is there a more practical code example for why you'd want to suppress this error? The example you gave is a bit artificial, so it's a hard to motivate why we'd want to suppress this code since it really could be rewritten to be clearer. |
@rustbot claim |
…,fee1-dead Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation Closes: rust-lang#130430 r? rust-lang/diagnostics
…,fee1-dead Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation Closes: rust-lang#130430 r? rust-lang/diagnostics
…,fee1-dead Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation Closes: rust-lang#130430 r? rust-lang/diagnostics
…,fee1-dead Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation Closes: rust-lang#130430 r? rust-lang/diagnostics
…,fee1-dead Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation Closes: rust-lang#130430 r? rust-lang/diagnostics
…,fee1-dead Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation Closes: rust-lang#130430 r? rust-lang/diagnostics
Rollup merge of rust-lang#130833 - makai410:master, r=compiler-errors,fee1-dead Fix the misleading diagnostic for `let_underscore_drop` on type without `Drop` implementation Closes: rust-lang#130430 r? rust-lang/diagnostics
I tried this code:
I got this warning:
However, there is no
Drop
impl on the type, so the error message is misleading.It is true however that there is a destructor, as defined here: https://doc.rust-lang.org/stable/std/ops/trait.Drop.html
That being said, it's insiginificant for all underlying types (only
#[may_dangle]
destructor ofVec
andCopy
type in theVec
), so ideally the warning still wouldn't even show.Meta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: