Files
rust/tests/ui/drop/explicit-drop-call-error.fixed
T
Usman Akinyemi e5b42e5084 Fix E0040 suggestion for explicit Drop::drop UFCS calls
`Drop::drop(&mut f)` now correctly suggests `drop(f)` instead of
the bare `drop` with no argument.

Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
2026-05-05 01:09:33 +05:30

16 lines
245 B
Rust

//! Test error for explicit destructor method calls via UFCS
//@ run-rustfix
#![allow(dropping_references)]
struct Foo;
impl Drop for Foo {
fn drop(&mut self) {}
}
fn main() {
drop(Foo) //~ ERROR explicit use of destructor method
}