mirror of
https://github.com/rust-lang/rust.git
synced 2025-12-03 13:38:22 +00:00
26 lines
469 B
Rust
26 lines
469 B
Rust
//@ run-rustfix
|
|
//@ edition:2018
|
|
//@ check-pass
|
|
#![feature(ergonomic_clones)]
|
|
#![warn(rust_2021_compatibility)]
|
|
#![allow(incomplete_features)]
|
|
|
|
#[derive(Debug)]
|
|
struct Foo(i32);
|
|
impl Drop for Foo {
|
|
fn drop(&mut self) {
|
|
println!("{:?} dropped", self.0);
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let a = (Foo(0), Foo(1));
|
|
let f = use || {
|
|
//~^ HELP: add a dummy
|
|
//~| WARNING: drop order
|
|
let x = a.0;
|
|
println!("{:?}", x);
|
|
};
|
|
f();
|
|
}
|