Files
rust/tests/ui/drop/explicit-drop-call-error.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
256 B
Rust
Raw Normal View History

2025-06-09 02:16:25 +05:00
//! 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::drop(&mut Foo) //~ ERROR explicit use of destructor method
}