Error code E0584

A doc comment that is not attached to anything has been encountered.

Erroneous code example:

#![allow(unused)] fn main() { trait Island { fn lost(); /// I'm lost! } }

A little reminder: a doc comment has to be placed before the item it's supposed to document. So if you want to document the Island trait, you need to put a doc comment before it, not inside it. Same goes for the lost method: the doc comment needs to be before it:

#![allow(unused)] fn main() { /// I'm THE island! trait Island { /// I'm lost! fn lost(); } }