librustc: Introduce a new visitor type based on traits and port syntax to it.

This is preparation for removing `@fn`.

This does *not* use default methods yet, because I don't know
whether they work. If they do, a forthcoming PR will use them.

This also changes the precedence of `as`.
librustc: Disallow "unsafe" for external functions
auto merge of #8235 : pcwalton/rust/unsafe-extern-fns, r=pcwalton

r? @brson
replace all remaining `for` with `foreach` or `do`
make `for` parse as `foreach` does

Closes #6997
rm obsolete documentation on `for`

it is documented in the container/iterator tutorial, not the basic
tutorial
fix some more for loops