]> git.lizzy.rs Git - rust.git/blob - tests/ui/explicit/explicit-call-to-supertrait-dtor.rs
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / ui / explicit / explicit-call-to-supertrait-dtor.rs
1 // run-rustfix
2 struct Foo {
3     x: isize
4 }
5
6 #[allow(drop_bounds)]
7 trait Bar: Drop {
8     fn blah(&self);
9 }
10
11 impl Drop for Foo {
12     fn drop(&mut self) {
13         println!("kaboom");
14     }
15 }
16
17 impl Bar for Foo {
18     fn blah(&self) {
19         self.drop();    //~ ERROR explicit use of destructor method
20     }
21 }
22
23 fn main() {
24     let x = Foo { x: 3 };
25     println!("{}", x.x);
26 }