Suggest using std::mem::drop function instead of explicit destructor call

This commit is contained in:
Stanislav Tkach 2020-05-20 17:48:21 +03:00
parent 672b272077
commit 34b51187ce
7 changed files with 45 additions and 12 deletions

View file

@ -2,7 +2,10 @@ error[E0040]: explicit use of destructor method
--> $DIR/E0040.rs:13:7
|
LL | x.drop();
| ^^^^ explicit destructor calls not allowed
| ^^^^
| |
| explicit destructor calls not allowed
| help: consider using `drop` function: `drop(x)`
error: aborting due to previous error

View file

@ -2,7 +2,10 @@ error[E0040]: explicit use of destructor method
--> $DIR/explicit-call-to-dtor.rs:13:7
|
LL | x.drop();
| ^^^^ explicit destructor calls not allowed
| ^^^^
| |
| explicit destructor calls not allowed
| help: consider using `drop` function: `drop(x)`
error: aborting due to previous error

View file

@ -2,7 +2,10 @@ error[E0040]: explicit use of destructor method
--> $DIR/explicit-call-to-supertrait-dtor.rs:17:14
|
LL | self.drop();
| ^^^^ explicit destructor calls not allowed
| ^^^^
| |
| explicit destructor calls not allowed
| help: consider using `drop` function: `drop(self)`
error: aborting due to previous error

View file

@ -2,7 +2,10 @@ error[E0040]: explicit use of destructor method
--> $DIR/illegal-ufcs-drop.rs:8:5
|
LL | Drop::drop(&mut Foo)
| ^^^^^^^^^^ explicit destructor calls not allowed
| ^^^^^^^^^^
| |
| explicit destructor calls not allowed
| help: consider using `drop` function
error: aborting due to previous error