Re: [libvirt-rust PATCH 1/1] Make creating safe wrapper from raw pointer unsafe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 30, 2019 at 12:10:49PM +0200, Martin Kletzander wrote:
> On Wed, Sep 25, 2019 at 04:36:16PM +0000, Linus Färnstrand wrote:
> > Giving an invalid pointer to the safe wrapper types causes
> > undefined behavior when methods are later called on said wrapper
> > 
> > Properly document safety contract of using unsafe constructor
> > ---
> 

> Ideally it should not be exposed at all because there already is a
> method for getting the proper structure.  And that method (or those
> methods) already use ::new() so with this patch it just fails.
> Tests, examples, etc.  Instead of fixing that I would, probably,
> just not expose them.  I don't see a reason for them being public.

Yes I'm agree, they should just not be public.

s.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux