You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libc::Nullable exists as an Option-equivalent that is suitable for using with liblibc without requiring libstd. It seems the appropriate type to use for nullable function pointers, e.g. Nullable<extern "C" fn (int)>. But doing this is making the implicit assumption that Nullable benefits from the null-pointer optimization, i.e. that this type has the same size as *(). I think we should statically guarantee this by adding an attribute that guarantees that Nullable<T> can only be used with a type parameter that allows it to use the null-pointer optimization. This means I can say Nullable<extern "C" fn (int)>, but I can't say Nullable<uint>, nor Nullable<*u32> (because *u32 is already nullable, and therefore the null-pointer optimization doesn't apply).
The text was updated successfully, but these errors were encountered:
The code should not attempt to obtain a snippet by capping the function
signature span with its identifier span without checking that they are
in the same context.
This is the only instance I could identify where placeholders were used
instead of the real snippet when running the CI lintcheck. Moreover, the
placeholders were not even used, as they snippet was obtained
prematurely.
Found in the context of rust-lang#13941
changelog: none
libc::Nullable
exists as anOption
-equivalent that is suitable for using withliblibc
without requiringlibstd
. It seems the appropriate type to use for nullable function pointers, e.g.Nullable<extern "C" fn (int)>
. But doing this is making the implicit assumption thatNullable
benefits from the null-pointer optimization, i.e. that this type has the same size as*()
. I think we should statically guarantee this by adding an attribute that guarantees thatNullable<T>
can only be used with a type parameter that allows it to use the null-pointer optimization. This means I can sayNullable<extern "C" fn (int)>
, but I can't sayNullable<uint>
, norNullable<*u32>
(because*u32
is already nullable, and therefore the null-pointer optimization doesn't apply).The text was updated successfully, but these errors were encountered: