Drop a reference does nothing

https://doc.rust-lang.org/std/mem/fn.drop.html

> This function is not magic; it is literally defined as
> pub fn drop<T>(_x: T) { }
> Because _x is moved into the function, it is automatically dropped before the function returns.

warning: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
   --> tests/test_class.rs:471:9
    |
471 |         drop(inst);
    |         ^^^^^^^^^^
    |
    = note: #[warn(drop_ref)] on by default
note: argument has type &GCIntegration
   --> tests/test_class.rs:471:14
    |
471 |         drop(inst);
    |              ^^^^
    = help: for further information visit
    https://github.com/Manishearth/rust-clippy/wiki#drop_ref
This commit is contained in:
messense 2017-07-18 22:35:05 +08:00
parent 39a78aa407
commit 512bd6a332
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
1 changed files with 0 additions and 1 deletions

View File

@ -468,7 +468,6 @@ fn gc_integration() {
token: t}).unwrap();
*inst.self_ref.borrow_mut() = inst.into();
drop(inst);
}
let gil = Python::acquire_gil();