Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum rust version not correct for bam. #315

Closed
TyberiusPrime opened this issue Jan 10, 2025 · 1 comment
Closed

Minimum rust version not correct for bam. #315

TyberiusPrime opened this issue Jan 10, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@TyberiusPrime
Copy link

Using rust 1.80.0, I received the following errors;

    Checking noodles-bam v0.72.0
error[E0658]: use of unstable library feature 'iter_repeat_n'
  --> /home/f/.cargo/registry/src/index.crates.io-6f17d22bba15001f/noodles-bam-0.72.0/src/record/codec/encoder/quality_scores.rs:28:20
   |
28 |         dst.extend(iter::repeat_n(MISSING, base_count));
   |                    ^^^^^^^^^^^^^^
   |
   = note: see issue #104434 <https://github.com/rust-lang/rust/issues/104434> for more information

error[E0658]: referencing statics in constants is unstable
  --> /home/f/.cargo/registry/src/index.crates.io-6f17d22bba15001f/noodles-bam-0.72.0/src/io/reader/header.rs:25:56
   |
25 |     fn read_magic_number(&mut self) -> io::Result<[u8; MAGIC_NUMBER.len()]> {
   |                                                        ^^^^^^^^^^^^
   |
   = note: see issue #119618 <https://github.com/rust-lang/rust/issues/119618> for more information
   = note: `static` and `const` variables can refer to other `const` variables. A `const` variable, however, cannot refer to a `static` variable.
   = help: to fix this, the value can be extracted to a `const` and then used.

They went away when I upgraded to 1.83.0.

I believe the declared minimum rust version is 1.70.0?
At least that's what's in the workspaces' cargo.toml, and the bam crate referes to that.

I suppose the magic number could be a constant though.

@zaeleus zaeleus added the bug Something isn't working label Jan 10, 2025
@zaeleus zaeleus self-assigned this Jan 10, 2025
zaeleus added a commit that referenced this issue Jan 10, 2025
…d function

`std::iter::repeat_n` was stabilized in Rust 1.82.0, but the current
MSRV is set to 1.70.0.

See #315.
@zaeleus
Copy link
Owner

zaeleus commented Jan 10, 2025

Thanks for reporting.

I backported std::iter::repeat_n (stabilized in Rust 1.82.0) and changed the references to statics in const contexts (1.83.0). One direct dependency bstr 1.11.3 requires Rust 1.73.0; and one indirect dependency yoke 0.7.5, 1.71.1. Therefore, I raised the MSRV of noodles to 1.73.0 in 87808fa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants