-
Notifications
You must be signed in to change notification settings - Fork 100
Description
Hello hdf5-rust maintainers,
I am working on a compiler patch that automatically inserts checks for null pointers and null-backed references in debug mode (rust-lang/rust#134424). As part of my change I noticed that it breaks your crates' test-suite.
As part of the hdf5_types::imple_tuple!
macro you create a reference backed by a null pointer, which is UB. The related code snippet is this one: https://github.com/aldanor/hdf5-rust/blob/master/hdf5-types/src/h5type.rs#L287-L332 and the line containing the problem is let &$($s)*(.., ref f, $(impl_tuple!(@second $tt _),)*) = unsafe { &*$origin };
.
For more on why this is instant UB, please see the discussion here.
Please note that the tests will start failing as soon as this is enabled in the compiler. This is just a heads-up!