Add defun motions for rust-mode.

Specifically, we can now use:
+ beginning-of-defun
+ end-of-defun
+ mark-defun

where "defun" means a Rust item.

+ Add tests in rust-mode-tests.el
+ Fix indentation in rust-mode-tests.el
+ Add support for trait to Imenu
Add missing .com
auto merge of #10873 : pradeep90/rust/rust-mode-changes, r=pcwalton

Specifically, we can now use:
+ beginning-of-defun
+ end-of-defun
+ mark-defun

where "defun" means a Rust item.

+ Add tests in rust-mode-tests.el
+ Fix indentation in rust-mode-tests.el
+ Add support for trait to Imenu
Add some more commentary to FFI tutorial.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Check the privacy of implemented traits

This bug showed up because the visitor only visited the path of the implemented
trait via walk_path (with no corresponding visit_path function). I have modified
the visitor to use visit_path (which is now overridable), and the privacy
visitor overrides this function and now properly checks for the privacy of all
paths.

Closes #10857
auto merge of #10862 : alexcrichton/rust/issue-10857, r=huonw

This bug showed up because the visitor only visited the path of the implemented
trait via walk_path (with no corresponding visit_path function). I have modified
the visitor to use visit_path (which is now overridable), and the privacy
visitor overrides this function and now properly checks for the privacy of all
paths.

Closes #10857
auto merge of #10822 : ezyang/rust/master, r=huonw

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
auto merge of #10882 : jhasse/rust/patch-1, r=metajack

typo
libextra: Another round of de-`Cell`-ing.

34 uses of `Cell` remain.
librustuv: RAII-ify `Local::borrow`, and remove some 12 Cells.
libstd: Remove some cells involved in
`deschedule_running_task_and_then`.
librustpkg: Make `io::ignore_io_error()` use RAII; remove a few more
cells.
libstd: Remove `Cell`s that were used because of `finally` by converting
their `finally` blocks to RAII.
compiletest: Remove uses of `Cell`.
librustdoc: Don't use `finally`, shaving off a `Cell`.
librustdoc: Remove a couple of `Cell`s.
libextra: Remove various cells involved in `Arc`s.

I could have done this by making `Arc` use RAII, but this is too
involved for now.
librustuv: Change `with_local_io` to use RAII.
libstd: Change `atomically` to use RAII.
libstd: Remove two uses of `Cell`.