third_party_rust_cxx/tests/unique_ptr.rs
David Tolnay 5d5ac057a7
Fix warning about let_underscore_drop lint removal from clippy
warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
      --> gen/build/src/lib.rs:59:5
       |
    59 |     clippy::let_underscore_drop,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
       |
       = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
     --> tests/ffi/lib.rs:5:5
      |
    5 |     clippy::let_underscore_drop,
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
     --> tests/unique_ptr.rs:1:10
      |
    1 | #![allow(clippy::let_underscore_drop)]
      |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default
2022-12-29 18:35:56 -08:00

9 lines
221 B
Rust

use cxx::{CxxString, UniquePtr};
#[test]
#[should_panic = "called deref on a null UniquePtr<CxxString>"]
fn test_deref_null() {
let unique_ptr = UniquePtr::<CxxString>::null();
let _: &CxxString = &unique_ptr;
}