audio: Replace inferred array lengths with BUFFER_SIZE#38564
audio: Replace inferred array lengths with BUFFER_SIZE#38564atomkernel0 wants to merge 1 commit intozed-industries:mainfrom atomkernel0:fix/stable-array-length
BUFFER_SIZE#38564Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @atomkernel0 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
BUFFER_SIZE
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
We already build on Rust stable, so this seems like something specific to your environment.
I see you're building with Rust 1.88, but we have Rust 1.89 in our Line 2 in ffa23d2 What happens if you build on Rust 1.89? Edit: It looks like |
|
Going to close this, as the feature has been stabilized in Rust 1.89, and that is the minimum version of Rust we support building Zed with. |
…able Rust On stable Rust, using \`_\` to infer array lengths in type position is not stabilized (E0658). This change replaces the inferred lengths with explicit BUFFER_SIZE in audio.rs, matching the const generic used by the buffer processing. No functional changes; fixes build on stable. Refs: rust-lang/rust#85077.
Summary
Fix stable Rust builds (E0658) by replacing
_-inferred array lengths with explicitBUFFER_SIZEincrates/audio/src/audio.rs. No behavior changes.Context
Stable Rust doesn’t allow
_as an array length in type position (E0658; see rust-lang/rust#85077), causing two compile errors inaudio.rs.I got these two compilation errors :
BUFFER_SIZEmatches the surrounding const generics:inspect_buffer::<BUFFER_SIZE, _>(...)process_buffer::<BUFFER_SIZE, _>(...)Testing
Built successfully on stable:
Impact
Build-only fix; no functional changes.
Release notes
Fix: Restore stable Rust build by replacing
_array lengths withBUFFER_SIZEincrates/audio/src/audio.rs(E0658).