Jacob Lifshay
Jacob Lifshay
> This feels like the same case you present: you want the ability to both access the inner type _and_ clone the smart pointer, and simply accessing the inner type...
> One concern about making the functions inside the `unsafe extern` safe to call by default, is that it may make it easy to accidentally make some functions incorrectly safe...
> Could we write `impl SafeForFoo for type my_closure {}`? afaict that should work, we can borrow C's `sizeof` syntax and make `type ` and `type()` work as type-of.
> > > Could we write `impl SafeForFoo for type my_closure {}`? > > > > > > afaict that should work, we can borrow C's `sizeof` syntax and make...
for `Box`, we could introduce a new trait: ```rust // in std pub trait BoxDrop: Sized { fn box_drop(v: Pin); } impl BoxDrop for A { #[inline] fn box_drop(v: Pin)...
> Is there a way, rather than having to implement a trait, to instead have a single type parameterized with a function type? I thought about it, but it's very...
maybe better usage demo: ```rust // std API pub struct FFIDropper; // like C++ unique_ptr but where deleter is defined by T pub type FFIBox = Box; // user API,...
lots more discussion about `BoxDrop` and `FFIBox` and stuff here: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/BoxDrop.20proposal/near/383840871
> A second, further way to simplify the specification here and allow users to enable the niche optimization for their own types would be to define a `NonNegativeI*` (other spellings...
> > that wouldn't work for (some of) the Win32 handle types, because iirc negative handles are perfectly valid, it's just `-1` that's invalid. > > `-1` is perfectly valid....