In Rust, it is possible to force-ably allocate values on the heap using the Box type, here is an example of an i32 value allocated on the heap.
age is now a pointer to a heap allocated i32.
age is now a pointer to a heap allocated i32.
0
1
5


![fn main() {
let x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let y: Vec<i32> = x.into_iter().filter(|a| a % 2 == 0).collect();
println!("{:?}", y); // [2, 4, 6, 8, 10]
}](/pic/media%2FFmDZPlnWYA4iD1f.jpg)