The value for the constraint "i"must be a compile-time constant, and you supply it with what is not. If you move the addition to Rust, you can use case as well as constant using restrictions "ri".
Whether something can be permanent for the purpose of the built-in assembler, optimization parameters can influence.