File tree Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Expand file tree Collapse file tree 1 file changed +1
-19
lines changed Original file line number Diff line number Diff line change @@ -27,25 +27,7 @@ use error::PointerError;
2727#[ cfg( all( feature = "std" , feature = "lender" ) ) ]
2828mod lender;
2929
30- #[ inline]
31- fn validate_pointer_is_not_null < T > ( pointer : * const T ) -> Result < ( ) , PointerError > {
32- if pointer. is_null ( ) {
33- log:: error!( "Using a NULL pointer as an opaque pointer to Rust's data" ) ;
34- return Err ( PointerError :: Null ) ;
35- }
36- return Ok ( ( ) ) ;
37- }
38-
39- #[ inline]
40- fn validate_pointer < T > ( pointer : * const T ) -> Result < ( ) , PointerError > {
41- validate_pointer_is_not_null ( pointer) ?;
42- #[ cfg( all( feature = "std" , feature = "lender" ) ) ]
43- if !lender:: is_lent ( pointer) {
44- log:: error!( "Using an invalid pointer as an opaque pointer to Rust's data" ) ;
45- return Err ( PointerError :: Invalid ) ;
46- }
47- return Ok ( ( ) ) ;
48- }
30+ mod validation;
4931
5032/// Get a heap-allocated raw pointer without ownership.
5133///
You can’t perform that action at this time.
0 commit comments