<p dir="auto">On IRC, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bjz/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bjz">@bjz</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Kimundi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Kimundi">@Kimundi</a> pointed out some infelicities with how rustpkg handles the test crate.</p>
<p dir="auto">kimundi writes: "I think there are 3 ways to have the test suite of a rustpkg package work: in-crate by compiling the crate with rustc --test, out-of-crate by having a test.rs file that 'extern mod's the crate, and hybrid where you have a test.rs file that contains all modules of your crate with 'mod ...;' statements, effectively providing an alternate test crate-root."</p>
<p dir="auto">Currently, rustpkg is designed to give preference to the last option: having a <code class="notranslate">test.rs</code> file that is an alternative crate root for building a test executable.</p>
<p dir="auto">So one question is whether to support all 3 ways with equally good ergonomics in rustpkg. The other question is whether to choose one way that we prefer, and document that that is the preferred method.</p>
<p dir="auto">kimundi pointing out that the pros and cons of each approach are:</p>
<p dir="auto">"in-crate: pro: quick and easy, can test private things. cons: clutters the code, change to tests mean recompile the library itself</p>
<p dir="auto">out-of-crate: pro: can test the public api extensivly, no cluttering the crate code itself, changes to testsuite do not cause the  crate to need recompiling. cons: can't test private items, need to do more work to test the public api</p>
<p dir="auto">hybrid: pro: can test private api, separate test crate from regular crate, can test public api separately without needing to recompile crate. cons: needs to compile the same amount of code as the crate, needs to duplicate crate root."</p>
<p dir="auto">This is a tracking issue for the unstable <code class="notranslate">ref_slice</code> feature in the standard library. These functions seem fairly innocuous but it's also somewhat questionable how useful they are. They're probably ready for either stabilization or deprecation as-is.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nikomatsakis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nikomatsakis">@nikomatsakis</a></p>