fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
403 B29 linesraw
1// run-rustfix
2
3#![allow(dropping_references)]
4
5struct Foo {
6    x: isize
7}
8
9#[allow(drop_bounds)]
10trait Bar: Drop {
11    fn blah(&self);
12}
13
14impl Drop for Foo {
15    fn drop(&mut self) {
16        println!("kaboom");
17    }
18}
19
20impl Bar for Foo {
21    fn blah(&self) {
22        drop(self);    //~ ERROR explicit use of destructor method
23    }
24}
25
26fn main() {
27    let x = Foo { x: 3 };
28    println!("{}", x.x);
29}