Stream: t-compiler/wg-rls-2.0

Topic: NonZeroLayout: is this too heavyhanded?


Christopher Durham (Feb 20 2020 at 18:49, on Zulip):

Raising requirements to the type level is generally a good thing. But especially given that manual allocation is inherently an unsafe operation, I'm wondering if it's a bit heavy-handed and not really necessary.

Rust does pride itself on zero-cost abstractions and pick-your-costs, but moreso than that, I think Rust also is useful because it is _safe by default_. IOW, the first API you tend to reach for should be the safest to use; for the case of allocators, that would mean requiring them to handle zero-sized allocations transparently, rather than pushing that to the user.

Going through the list of Alloc-friends traits in alloc-wg, per that concept, the available methods that could reasonably need to handle zero-sized "allocations", or can pretend they don't exist would be:

i.e. all of them could fairly reasonably be expected to work transparently with zero sized allocations.

Emil Lauridsen (Feb 20 2020 at 18:52, on Zulip):

Might've posted this in the wrong stream :)

Christopher Durham (Feb 20 2020 at 18:52, on Zulip):

How did this happen :P

Christopher Durham (Feb 20 2020 at 18:52, on Zulip):

I am too unfamiliar with Zulip apparently...

Christopher Durham (Feb 20 2020 at 18:54, on Zulip):

Really, when my narrow is t-libs/wg-allocators, <kbd>New topic</kbd> really should default to being in that stream

std::Veetaha (Feb 20 2020 at 18:56, on Zulip):

Hi m8, great to see you again!

Christopher Durham (Feb 20 2020 at 19:16, on Zulip):

Yeah I don't keep up with Zulip enough

matklad (Feb 20 2020 at 23:48, on Zulip):

@Christopher Durham hey, do you want to push for alloc_layout_extras to be stabilized? :D

I am slowly doing that rowan refactoring, and I could use a way to allocate stuff without doing all the layout calculations wrongly myself

Christopher Durham (Feb 20 2020 at 23:49, on Zulip):

@matklad just use pointer-utils now that it's published :P

But yeah, alloc_layout_extras seems worth to push to stabilize

Christopher Durham (Feb 20 2020 at 23:50, on Zulip):

And honestly just give me an actual target of what to do and I'll probably nerd snipe myself into banging it out

matklad (Feb 21 2020 at 00:03, on Zulip):

I sort-of lean towards vendoring the exact combo of union of tagged DST arcs into rowan

matklad (Feb 21 2020 at 00:03, on Zulip):

As we maybe might want to swticht to u32 ref count without weekrefs as well

matklad (Feb 21 2020 at 00:04, on Zulip):

I've started https://github.com/rust-analyzer/bonsai a while back, which I think is even sort-of works, except for the bit where I need to cacl the layout :D

Christopher Durham (Feb 21 2020 at 00:31, on Zulip):

I'll take a look at bonsai and push for alloc_layout_extras I guess

Last update: Oct 28 2020 at 18:00UTC