GuillaumeGomez / rust-GSL

A GSL (the GNU Scientific Library) binding for Rust
190 stars 46 forks source link

Remove cblas::Index #148

Closed Chris00 closed 5 months ago

Chris00 commented 5 months ago

In the standard library, “search” functions return usize. I have done the same in cblas, which fixes the error discussed in an earlier PR.

GuillaumeGomez commented 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
Chris00 commented 5 months ago

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.

GuillaumeGomez commented 5 months ago

A fix for a later time then. Thanks for this fix!