Things you can’t do in Rust (and what to do instead)
I&#x27;ve started to learn rust for the 2nd time. The first time was a really frustrating. In my defense though, I&#x27;m pretty sure the compiler inferred a lot less back then (maybe 5-6 years ago now?)<p>This time, it&#x27;s going much better and I&#x27;ve managed to build something non-trivial. I quickly ran into the self-referencing issue. A simple structure to hold an [normalized] phrase and a list of words within that phrase:<p><pre><code>    struct Input&lt;&#x27;a&gt;{
      words: Vec&lt;&amp;&#x27;a str&gt;,
      phrase: String,
    }
</code></pre>
I ended up asking in <a href="https:&#x2F;&#x2F;users.rust-lang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;users.rust-lang.org&#x2F;</a> where people are super fast, friendly and helpful. I understand that it isn&#x27;t allowed, but I still don&#x27;t quite understand why it isn&#x27;t. It seems completely straightforward and unambiguous to me.<p>Something else I&#x27;m surprised the article didn&#x27;t mention is the combination of `Box&lt;dyn X + Sync + Send&gt;` which is a mouthful - both in terms of having to declare a type with this, and in terms of everything is implies&#x2F;encapsulates.