Uh oh!
There was an error while loading. Please reload this page.
Avoid processing features on unconfigured crates - #34969
Conversation
retep998
commented
Jul 21, 2016
Why a compile fail test? Isn't the idea that disabling the crate with |
@retep998 This test still tests that |
For example #![cfg(feature = "nightly")]#![feature(some_feature)]#[test]fnfoo(){// code which relies on some_feature}If the nightly feature isn't enabled, it will compile on the current stable. However it will not compile in the current beta (or at least whatever is on the current playground). The regression is that the stability check for features is done even when the entire crate is disabled with a cfg. So the correct test would need to make sure that this example would still compile in a stable environment where features are disabled. And |
jseyfried
commented
Jul 22, 2016
@retep998 I know, this fixes that regression. The test I added is equivalent since features are stability checked when they are processed, so testing that features are not processed also tests that they are not stability checked. If you know of a more direct way to test this, let me know -- I'm not sure how to add a test with stable/beta feature stability checking. |
// compile-flags:--test// rustc-env:RUSTC_BOOTSTRAP_KEY=#![cfg(feature="does-not-exist")]#![feature(iter_arith_traits)]// nothing below actually matters, but I added it anyway#[test]fndummy(){let() = "this should not reach type-checking";panic!("this should not run");}At least when building beta/stable, this test will require no |
You could add a |
jseyfried
commented
Jul 22, 2016
eddyb
commented
Jul 22, 2016
LGTM. cc @alexcrichton Is this the best we can do about testing? |
alexcrichton
commented
Jul 22, 2016
I don't have too many opinions, so for me if it works it works! |
There was a problem hiding this comment.
You'll also need (found by Travis):
// ignore-pretty : (#23623) problems when ending with // commentsnrc
commented
Jul 25, 2016
@bors: r+ |
bors
commented
Jul 25, 2016
📌 Commit 64d36cc has been approved by |
bors
commented
Jul 25, 2016
⌛ Testing commit 64d36cc with merge bc81a3f... |
bors
commented
Jul 25, 2016
💔 Test failed - auto-win-gnu-32-opt |
alexcrichton
commented
Jul 25, 2016
@bors: retry On Sun, Jul 24, 2016 at 11:24 PM, bors notifications@github.com wrote:
|
alexcrichton
commented
Jul 25, 2016
@bors: retry |
bors
commented
Jul 26, 2016
⌛ Testing commit 64d36cc with merge 362d04d... |
bors
commented
Jul 26, 2016
💔 Test failed - auto-win-msvc-64-opt |
alexcrichton
commented
Jul 26, 2016
@bors: retry On Tue, Jul 26, 2016 at 3:36 AM, bors notifications@github.com wrote:
|
Avoid processing `feature`s on unconfigured crates Fixesrust-lang#34932, a regression caused by rust-lang#34272. r? @nrc
nikomatsakis
commented
Jul 28, 2016
Accepting for backport: regression, small. |
Fixes#34932, a regression caused by #34272.
r? @nrc