Intermediate
Rust
Q86 / 100
What is Rust's associated const in a trait?
Correct! Well done.
Incorrect.
The correct answer is B) A trait item that is a compile-time constant value each implementing type must provide
B
Correct Answer
A trait item that is a compile-time constant value each implementing type must provide
Explanation
trait HasMax { const MAX: u32; } impl HasMax for u8 { const MAX: u32 = 255; } provides a per-type compile-time constant.
Progress
86/100