Closed Chris00 closed 5 months ago
CI failure looks pretty bad:
2024-03-23T22:25:03.4472449Z Compiling gsl-examples v0.4.6 (/__w/rust-GSL/rust-GSL/examples)
2024-03-23T22:25:03.5968476Z Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.16s
2024-03-23T22:25:03.5976407Z Running `target/debug/combination`
2024-03-23T22:25:03.5999577Z thread 'main' panicked at library/core/src/panicking.rs:152:5:
2024-03-23T22:25:03.6000089Z All subsets of {0,1,2,3} by size:
2024-03-23T22:25:03.6001077Z unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
2024-03-23T22:25:03.6002069Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
On 23 March 2024 at 23:48 +01, Guillaume Gomez @.***> wrote:
CI failure looks pretty bad: […] unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed
isize::MAX
Indeed! Again, this is totally unrelated to my changes in cblas
. I took a look but the pointer is aligned and self.k() == 0
, so it does not exceed isize::MAX
.
A fix for a later time then. Thanks for this fix!
In the standard library, “search” functions return
usize
. I have done the same incblas
, which fixes the error discussed in an earlier PR.