I know that value types should be immutable, but that\'s just a suggestion, not a rule, right? So why can\'t I do something like this:
struct MyStruct
{
It's a suggestion in the sense that there's nothing stopping you from violating it, but it should really be afforded much more weight than "it's a suggestion". For instance, for the reasons you're seeing here.
Value types store the actual value in a variable, not a reference. That means that you have the value in your array, and you have a copy of that value in item, not a reference. If you were allowed to change the values in item, it would not be reflected on the value in the array since it's a completely new value. This is why it isn't allowed.
If you want to do this, you'll have to loop over the array by index and not use a temporary variable.