We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In 0.12 the following code is valid:
static ARRAYLEN: uint = 5; fn main() { let x: [u8, ..ARRAYLEN] = [0, ..ARRAYLEN]; }
However in the current nightly build, rustc gives this error:
rustc
arraytest.rs:4:12: 4:28 error: expected constant expr for vector length: non-constant path in constant expr arraytest.rs:4 let x: [u8, ..ARRAYLEN] = [0, ..ARRAYLEN];
This seems like a regression, since ARRAYLEN has an immutable value known at compile time, it should be possible to use it to initialize an array.
ARRAYLEN
The text was updated successfully, but these errors were encountered:
Replace static by const.
Sorry, something went wrong.
Thanks @mahkoh, I didn't realize the syntax had changed. Closing this.
Auto merge of rust-lang#17958 - Veykril:deref-chain-method-completion…
bdee5c9
…s, r=Veykril fix: Fix trait method completions not acknowledging Deref impls
No branches or pull requests
In 0.12 the following code is valid:
However in the current nightly build,
rustc
gives this error:This seems like a regression, since
ARRAYLEN
has an immutable value known at compile time, it should be possible to use it to initialize an array.The text was updated successfully, but these errors were encountered: