Content-Length: 24524 | pFad | https://doc.rust-lang.org/std/iter/../clone/../../../std/../error_codes/./E0435.html

E0435 - Error codes index

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error code E0435

A non-constant value was used in a constant expression.

Erroneous code example:

#![allow(unused)]
fn main() {
let foo = 42;
let a: [u8; foo]; // error: attempt to use a non-constant value in a constant
}

‘constant’ means ‘a compile-time value’.

More details can be found in the Variables and Mutability section of the book.

To fix this error, please replace the value with a constant. Example:

#![allow(unused)]
fn main() {
let a: [u8; 42]; // ok!
}

Or:

#![allow(unused)]
fn main() {
const FOO: usize = 42;
let a: [u8; FOO]; // ok!
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/iter/../clone/../../../std/../error_codes/./E0435.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy