Skip to content

0.17.1

Latest

Choose a tag to compare

@akern40 akern40 released this 02 Nov 22:20
· 2 commits to master since this release
0.17.1
66dc0e1

Version 0.17.1 provides a patch to fix the originally-unsound implementation of the new array reference types.

The reference types are now all unsized. Practically speaking, this has one major implication: writing functions and traits that accept RawRef and LayoutRef will now need a + ?Sized bound to work ergonomically with ArrayRef. For example, the release notes for 0.17.0 said

Reading / Writing Shape: LayoutRef<A, D>

LayoutRef lets functions view or modify shape/stride information without touching data.
This replaces verbose signatures like:

fn alter_view<S>(a: &mut ArrayBase<S, Ix1>)
where S: Data<Elem = f64>;

Use AsRef / AsMut for best compatibility:

fn alter_shape<T>(a: &mut T)
where T: AsMut<LayoutRef<f64>>;

However, these functions now need an additional bound to allow for callers to pass in &ArrayRef types:

fn alter_shape<T>(a: &mut T)
where T: AsMut<LayoutRef<f64>> + ?Sized; // Added bound here

A huge thank you to Sarah Quiñones (@sarah-quinones) for catching the original unsound bug and helping to fix it. She does truly excellent work with faer-rs; check it out!