rustc: move the check_loop pass earlier.

This pass is purely AST based, and by running it earlier we emit more
useful error messages, e.g. type inference fails in the case of `let r =
break;` with few constraints on `r`, but its more useful to be told that
the `break` is outside a loop (rather than a type error) when it is.

Closes #13292.
Removed cmath and instrinsic wrapper.
auto merge of #13330 : huonw/rust/loop-error, r=alexcrichton

rustc: move the check_loop pass earlier.

This pass is purely AST based, and by running it earlier we emit more
useful error messages, e.g. type inference fails in the case of 
`let r = break;` with few constraints on `r`, but it's more useful to be told that
the `break` is outside the loop (rather than a type error) when it is.

Closes #13292.
auto merge of #13331 : pongad/rust/remove-wrapper, r=thestinger

Fixes #12713
syntax: add a custom owned smart pointer in ptr::P.
syntax: ast: replace @T with P<T>.
syntax: fold: use move semantics for efficient folding.
syntax: ast_map: use raw pointers into the AST.
syntax: fix fallout from using ptr::P.
syntax: tests: fix fallout from using ptr::P.
rustc: fix fallout from using ptr::P.
rustdoc: fix fallout from using ptr::P.
syntax: implement in-place folding of P<T> and Vec<T>.