[-Zbuild-std] Only build libtest when libstd is built#7360
[-Zbuild-std] Only build libtest when libstd is built#7360bors merged 2 commits intorust-lang:masterfrom
Conversation
|
r? @ehuss (rust_highfive has picked a reviewer for you, use r? to override) |
9cdbbc5 to
6b4fd44
Compare
|
@bors: r+ Seems like a reasonable workaround for now! |
|
📌 Commit 6b4fd44 has been approved by |
|
⌛ Testing commit 6b4fd44 with merge a41885e9b40ac3801a48b355a0f95b84c935266a... |
|
💔 Test failed - checks-azure |
I have never seen that error before, weird! @bors retry |
…lexcrichton [-Zbuild-std] Only build libtest when libstd is built Currently `libtest` is always compiled when a compilation unit uses a test harness. This implicitly adds builds the standard library too because `libtest` depends on it. This breaks the use of custom test frameworks in `no_std` crates as reported in #7216 (comment). This pull request fixes the issue by only building `libtest` if `libstd` is built. This makes sense in my opinion because when the user explicitly specified `-Zbuild-std=core`, they probably don't want to build the full standard library and rather get a compilation error when they accidentally use `libtest`.
|
☀️ Test successful - checks-azure |
Currently
libtestis always compiled when a compilation unit uses a test harness. This implicitly adds builds the standard library too becauselibtestdepends on it. This breaks the use of custom test frameworks inno_stdcrates as reported in #7216 (comment).This pull request fixes the issue by only building
libtestiflibstdis built. This makes sense in my opinion because when the user explicitly specified-Zbuild-std=core, they probably don't want to build the full standard library and rather get a compilation error when they accidentally uselibtest.