From f043d2da65a4da355aae4773204e073fef3e7cba Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Thu, 28 Mar 2019 12:49:50 +0100 Subject: [PATCH] Revise test slightly so that `dyn` in macro invocation *must* be parsed as keyword in test. Back-story: After reflection this morning, I realized that the previous form of this test would allow the macro invocation to treat the `dyn` input as a raw-identifier rather than a keyword, and since the input was discarded by that version of the macro, the test would pass despite the detail that the input `dyn` should not have been parsed as a raw-identifier. This revision fixes that oversight, by actually *using* the macro input to construct a `Box` type. --- .../ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed | 4 ++-- .../ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed index 153d73c9ea5..003736208ed 100644 --- a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed +++ b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.fixed @@ -45,7 +45,7 @@ mod macro_defn { //~| WARN was previously accepted // Note that we do not lint nor fix occurrences under macros - ($dyn:ident) => { Box } + ($dyn:tt) => { (Box, Box<$dyn Trait>) } } pub fn r#dyn() -> ::outer_mod::r#dyn::r#dyn { @@ -72,7 +72,7 @@ mod macro_defn { dyn ) { - Box::new(10) + (Box::new(1), Box::new(2)) } } diff --git a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs index 98ad3a78c13..0e5c39fc501 100644 --- a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs +++ b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.rs @@ -45,7 +45,7 @@ mod macro_defn { //~| WARN was previously accepted // Note that we do not lint nor fix occurrences under macros - ($dyn:ident) => { Box } + ($dyn:tt) => { (Box, Box<$dyn Trait>) } } pub fn dyn() -> ::outer_mod::dyn::dyn { @@ -72,7 +72,7 @@ mod macro_defn { dyn ) { - Box::new(10) + (Box::new(1), Box::new(2)) } }