1
Fork 0

Remove ExprSlice by hacking the compiler

[breaking-change]

The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
This commit is contained in:
Nick Cameron 2014-12-19 11:47:48 +13:00
parent ed8f503911
commit 4e2afb0052
18 changed files with 244 additions and 309 deletions

View file

@ -1384,12 +1384,6 @@ pub fn noop_fold_expr<T: Folder>(Expr {id, node, span}: Expr, folder: &mut T) ->
ExprIndex(el, er) => {
ExprIndex(folder.fold_expr(el), folder.fold_expr(er))
}
ExprSlice(e, e1, e2, m) => {
ExprSlice(folder.fold_expr(e),
e1.map(|x| folder.fold_expr(x)),
e2.map(|x| folder.fold_expr(x)),
m)
}
ExprRange(e1, e2) => {
ExprRange(e1.map(|x| folder.fold_expr(x)),
e2.map(|x| folder.fold_expr(x)))