Allow mutable slices in statics.

Fixes #11411
rustc: Move mut slice check to `check_static`

This is a follow-up patch that moves the mut slice check to the recently
added `check_static`

Closes #11411
Remove AtomicFlag

fixes #12943
`strdup_uniq` doesn't have to be `pub`.
Modules are either public, or private, so private modules should be stripped out
De-@ Session usage.
De-@ ty::ctxt usage.
De-@ tyencode::ctxt and related parts of astencode.
De-@ liveness.
De-@ type checking contexts.
De-@ trans contexts.
De-@ reachable.
De-@ filesearch.
De-@ CStore uses.
De-@ ParseSess uses.
De-@ resolve_lifetime.
De-@ typeck::check::method.
De-@ gather_loans.
De-@ move maps and rework parts of trans.
De-@ codemap and diagnostic.