iterate only over immutable vectors; use newer region notation
Unfortunately, right now iterating over const vectors is not safe. This is because the callback expects an *immutable* reference (in region terms: &T), not a const reference (&const T). This was not being caught by the type system due to the use of unsafe operations. To fix this, we need to either (1) find a way to parameterize over mutability or (2) add each_const, each_mut etc
Showing
想要评论请 注册 或 登录