about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEsteban Küber <esteban@commure.com>2018-07-21 17:17:49 -0700
committerEsteban Küber <esteban@commure.com>2018-07-21 17:17:49 -0700
commit915ff0b9699c9cf39b5d80fc3aeb6c7e047dd280 (patch)
treedd9cc34e0396fadc319ed57b8c0b5fc02bd3c7f2 /src
parent93b2bb01a961fdb61a4aeaf6bc6bdcab9ccedbe2 (diff)
downloadrust-915ff0b9699c9cf39b5d80fc3aeb6c7e047dd280.tar.gz
rust-915ff0b9699c9cf39b5d80fc3aeb6c7e047dd280.zip
fix logic bug
Diffstat (limited to 'src')
-rw-r--r--src/libsyntax_ext/format.rs4
-rw-r--r--src/test/ui/feature-gate-format_args_nl.rs0
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs
index c63cc3727ed..755d2b476b7 100644
--- a/src/libsyntax_ext/format.rs
+++ b/src/libsyntax_ext/format.rs
@@ -698,8 +698,8 @@ pub fn expand_format_args_nl<'cx>(ecx: &'cx mut ExtCtxt,
 
     // For some reason, the only one that actually works for `println` is the first check
     if !sp.allows_unstable()   // the enclosing span is marked as `#[allow_insternal_unsable]`
-        || !ecx.ecfg.enable_allow_internal_unstable()  // NOTE: when is this enabled?
-        || !ecx.ecfg.enable_format_args_nl()  // enabled using `#[feature(format_args_nl]`
+        && !ecx.ecfg.enable_allow_internal_unstable()  // NOTE: when is this enabled?
+        && !ecx.ecfg.enable_format_args_nl()  // enabled using `#[feature(format_args_nl]`
     {
         feature_gate::emit_feature_err(&ecx.parse_sess,
                                        "format_args_nl",
diff --git a/src/test/ui/feature-gate-format_args_nl.rs b/src/test/ui/feature-gate-format_args_nl.rs
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/src/test/ui/feature-gate-format_args_nl.rs