rust/tests/ui/drop/explicit-call-to-dtor.fixed
reddevilmidzy a4a79500b5 Cleaned up some tests
fix explicit-call-to-dtor.rs
fix explicit-call-to-supertrait-dtor.rs
merge issues/issue-17740.rs with lifetimes/explicit-self-lifetime-mismatch.rs
merge bare-fn-start.rs and trait-fn.rs into invalid-self-argument.rs
add comment tests/ui/traits/catch-unwind-cell-interior-mut
2025-12-01 19:51:20 +09:00

16 lines
250 B
Rust

//@ run-rustfix
struct Foo {
x: isize,
}
impl Drop for Foo {
fn drop(&mut self) {
println!("kaboom");
}
}
fn main() {
let x = Foo { x: 3 };
println!("{}", x.x);
drop(x); //~ ERROR explicit use of destructor method
}