Stream: general

Topic: impl-From-Arc-for-NonNull


Dale Wijnand (Dec 19 2018 at 17:34, on Zulip):

Hey. So I'm trying to author a PR that implements From<Arc<T>> for NonNull<T> (and same for Rc). But with Arc and Rc in liballoc, how do I implement libcore's NonNull? Tried in both src/libcore/ptr.rs and src/liballoc/arc.rs but neither seems to work. Any ideas?

gnzlbg (Dec 19 2018 at 18:16, on Zulip):

I'd guess you'd need some of the coherency extensions for that to work

Dale Wijnand (Dec 19 2018 at 20:35, on Zulip):

Tell me more :slight_smile: What are those? How do I get my hands on them?

Jake Goulding (Dec 19 2018 at 20:37, on Zulip):

One example is RFC 2451

Dale Wijnand (Dec 19 2018 at 21:07, on Zulip):

That's just a proposal, though, isn't it?

Dale Wijnand (Dec 19 2018 at 21:13, on Zulip):

In terms of feedback loop, if I'm editing src/liballoc and writing tests in src/liballoc/tests, what's the optimal ./x.py test command to run? I wonder if I can keep stages if I'm just changing the std lib and so what the full command should be.

RalfJ (Dec 19 2018 at 21:45, on Zulip):

I'd use ./x.py --stage 0 test src/liballoc --no-doc

RalfJ (Dec 19 2018 at 21:45, on Zulip):

if you want to further only execute some tests, say for box, add --test-args box

Dale Wijnand (Dec 19 2018 at 22:10, on Zulip):

thanks!

Dale Wijnand (Dec 19 2018 at 22:12, on Zulip):

Good to know I can use the stage 0 compiler.

Jake Goulding (Dec 20 2018 at 00:57, on Zulip):

That's just a proposal, though, isn't it?

It's an accepted RFC which provides a link at the top to the Rust tracking issue which itself mentions a PR implementing it. I'd say more than a proposal.

Jake Goulding (Dec 20 2018 at 00:58, on Zulip):

But if you wanted to use it today, you'd have to pull down that branch and compile it yourself

Dale Wijnand (Dec 20 2018 at 02:17, on Zulip):

Thanks. I didn't see the backlink from the tracking issue. But it not being merged means I can't yet use it for my PR to liballoc.

Dale Wijnand (Dec 20 2018 at 02:17, on Zulip):

Anyways I was able to implement Into instead of From, and submit the PR

gnzlbg (Dec 20 2018 at 15:11, on Zulip):

@Dale Wijnand I meant RFC 2451, i don't think they are implemented yet.

Last update: Nov 22 2019 at 00:20UTC