Improve error message for passing mutable argument by reference

This commit is contained in:
Tim Chevalier 2012-03-15 17:15:56 -07:00
parent 48ccb3fbfd
commit e3222e9905

View File

@ -288,7 +288,7 @@ fn is_illegal_to_modify_def(cx: @ctx, def: def, msg: msg) -> option<str> {
}
def_arg(_, m) {
alt ty::resolved_mode(cx.tcx, m) {
by_ref | by_val { some("argument") }
by_ref | by_val { some("argument of enclosing function") }
by_mutbl_ref | by_move | by_copy { none }
}
}