Some of the first Rust code I wrote was a struct with a &str field. As you might imagine, the borrow checker didn’t let me do a lot of things, and the API ergonomics were limited. This article aims to demonstrate the issues with having raw &str references in structs, introduce some intermediate APIs that alleviate the ergonomics but aren’t necessarily efficient, and end with an implementation that is both ergonomic and efficient.

YouCompleteMe now supports Rust auto-completion and GoTo. Rust semantic analysis is provided by racerd, a JSON/HTTP server powered by racer. YCM with Rust provides a superior experience to current vim-racer, emacs-racer, and other racer-based plugins.