]> git.lizzy.rs Git - rust.git/commitdiff
fix logic bug
authorEsteban Küber <esteban@commure.com>
Sun, 22 Jul 2018 00:17:49 +0000 (17:17 -0700)
committerEsteban Küber <esteban@commure.com>
Sun, 22 Jul 2018 00:17:49 +0000 (17:17 -0700)
src/libsyntax_ext/format.rs
src/test/ui/feature-gate-format_args_nl.rs [new file with mode: 0644]

index c63cc3727eda0ed753f876a8f88d2be39602da29..755d2b476b7167ae33b94f195aabc075d8b52ebb 100644 (file)
@@ -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 (file)
index 0000000..e69de29