Skip to content

Commit d6fb70a

Browse files
Docs. Last commit before removing tuple_tree and all related tuple internal macro machinery
1 parent 5719891 commit d6fb70a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ let _ = unsafe_mut!(pt);
259259
let mut b: bool = true;
260260
let pt: *mut bool = &mut b as *mut bool;
261261

262+
let _: &mut dyn Display = unsafe_mut!(pt);
262263
let _: &dyn Display = unsafe_mut!(pt);
263264
```
264265

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ macro_rules! unsafe_fn {
150150
// 1. the result can be used as a value in an outer expression, and
151151
// 2. local variables don't conflict with the outer scope
152152
{
153+
//@TODO remove accessors. Instead:
154+
// - if false {...}: assign the tuple. Then unreachable!();
155+
// - else {...}: original full call.
153156
let (tuple_tree, fun) = ($crate::unsafe_fn_internal_build_tuple_tree!{ $($arg),+ }, $fn);
154157

155158
$crate::unsafe_fn_internal_build_accessors_and_call! {
@@ -408,8 +411,10 @@ macro_rules! unsafe_mut {
408411
}};
409412
}
410413

411-
#[doc(hidden)]
412414
/// This is an "early" type check for [unsafe_val], so that the user knows to use [unsafe_val] with [core::marker::Copy] types only.
415+
///
416+
/// NOT a part of public API!
417+
#[doc(hidden)]
413418
pub const fn expect_copy_ptr<T: Copy>(_: *const T) {}
414419

415420
/// Get a (copy of) value from where the pointer points. For [core::marker::Copy] types only.

0 commit comments

Comments
 (0)