Prepare for strict provenance in the Default
implementations.
#34
Labels
enhancement
New feature or request
go ahead
Reviewed, implementation can start
good first issue
Good for newcomers
help wanted
Extra attention is needed
Strict provenance is an attempt on bringing sanity to pointers. It is tracked here. We are already enabling Miri's
-Zmiri-strict-provenance
flag to catch mistakes, which is pretty useful, since the API dabbles with raw pointers. It caught theDefault
bug in the first place #11 .Miri checks now fail, since the fix for #11 introduced an integer-to-pointer cast in https://github.com/V0ldek/aligners/blob/main/src/bytes.rs#L264. This should be relatively easy to fix -- just use conditional compilation with
cfg
to see if thestrict_provenance
feature is enabled, and if yes use the new API. When SP is stabilised, this will be the new implementation anyway.This is the only place in which we do magic with raw integers, since it's a zero-sized allocation, which AFAIK has to be magic.
The text was updated successfully, but these errors were encountered: