mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 02:27:39 +03:00
e5b42e5084
`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>
16 lines
245 B
Rust
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
|
|
}
|