about summary refs log tree commit diff
path: root/src/test/run-make
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-11-04 14:59:42 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-11-07 12:04:28 -0800
commit3dbd32854f6bdee94c98c5e3e5da58fb79d79fd9 (patch)
treec38be4cf6f5ffdf89a3983635849a90b502d87fb /src/test/run-make
parent45cbdec4174778bf915f17561ef971c068a7fcbc (diff)
downloadrust-3dbd32854f6bdee94c98c5e3e5da58fb79d79fd9.tar.gz
rust-3dbd32854f6bdee94c98c5e3e5da58fb79d79fd9.zip
rustc: Process #[cfg]/#[cfg_attr] on crates
This commit implements processing these two attributes at the crate level as
well as at the item level. When #[cfg] is applied at the crate level, then the
entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute
is processed as usual in that the attribute is included or not depending on
whether the cfg matches.

This was spurred on by motivations of #18585 where #[cfg_attr] annotations will
be applied at the crate-level.

cc #18585
Diffstat (limited to 'src/test/run-make')
-rw-r--r--src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot8
-rw-r--r--src/test/run-make/graphviz-flowgraph/f03.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot b/src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot
index e60d349ad14..1986c27ad43 100644
--- a/src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot
+++ b/src/test/run-make/graphviz-flowgraph/f03.dot-expected.dot
@@ -2,10 +2,10 @@ digraph block {
     N0[label="entry"];
     N1[label="exit"];
     N2[label="expr 3i"];
-    N3[label="expr 33i"];
-    N4[label="expr 3i + 33i"];
-    N5[label="stmt 3i + 33i;"];
-    N6[label="block { 3i + 33i; }"];
+    N3[label="expr 4"];
+    N4[label="expr 3i + 4"];
+    N5[label="stmt 3i + 4;"];
+    N6[label="block { 3i + 4; }"];
     N0 -> N2;
     N2 -> N3;
     N3 -> N4;
diff --git a/src/test/run-make/graphviz-flowgraph/f03.rs b/src/test/run-make/graphviz-flowgraph/f03.rs
index 1007225f2f2..051409a49b1 100644
--- a/src/test/run-make/graphviz-flowgraph/f03.rs
+++ b/src/test/run-make/graphviz-flowgraph/f03.rs
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 pub fn expr_add_3() {
-    3i + 33i;
+    3i + 4;
 }