Rust and C++ Interoperability in Chrome
&gt; No need for the “unsafe” keyword unless something is known to be less safe than normal C++.<p>&gt; For a Rustacean, this is controversial - all C++ is unsafe!<p>Isn&#x27;t this just a fundamental misunderstanding of what unsafe really means, and as such a nonsense goal that doesn&#x27;t gain anything?<p>Unsafe is a Rust language definition, and defines whether the <i>rust compiler</i> can vouch for the safety of some code.  As such, calling to a library in some other language will always be unsafe, by definition, because the Rust language cannot vouch for it.<p>If it makes you feel better, replace &quot;unsafe&quot; in your head (or with a macro) with &quot;rustc_cannot_vouch_for&quot; and carry on with your day.  It means the same thing, and isn&#x27;t really telling you that your C++ code sucks even if it looks like it at first glance, so who cares?<p>If you really want to reduce the unsafe keyword from being seen in most regular code, you create and interface that maps the C++ function and exposes it as a rust function, and you&#x27;ve hidden away your unsafe usage to one spot per function.  If you have enough confidence in your C++ code, there&#x27;s no downside to this (and if you don&#x27;t, then maybe you shouldn&#x27;t be complaining that unsafe is unneeded).