mozilla/rust — pull request #12108 by huonw (2014-02-08 11:27:54+00:00)
Title: Rename assert to enforce, add debug_assert

Currently `assert!` is used to enforce invariants, not just doing sanity checks that get removed in release builds (unlike traditional asserts). This changeset renames them to `enforce` (and `assert_eq` to `enforce_eq`), and adds `debug_assert` and `debug_assert_eq` for assertions that are only active for `--cfg debug`.

Closes #12049.

General points:
- `debug_assert` etc. are never automatically activated, since not even `-Z extra-debug-info` sets `--cfg debug` (I did not add any use of them to the codebase, and am happy to remove the addition if people think we should work out a better arrangement)
- This is very easy to rebase (since the renaming is entirely automated), and so can wait until other manual harder-to-rebase patches land (in particular, I'm thinking of @pcwalton's vector patch).