Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revise test slightly so that dyn in macro invocation *must* be pars…
…ed 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<dyn Trait>` type.
  • Loading branch information
pnkfelix committed Mar 28, 2019
1 parent 1f63a52 commit f043d2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -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 Trait> }
($dyn:tt) => { (Box<dyn Trait>, Box<$dyn Trait>) }
}

pub fn r#dyn() -> ::outer_mod::r#dyn::r#dyn {
Expand All @@ -72,7 +72,7 @@ mod macro_defn {
dyn
)
{
Box::new(10)
(Box::new(1), Box::new(2))
}
}

Expand Down
Expand Up @@ -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 Trait> }
($dyn:tt) => { (Box<dyn Trait>, Box<$dyn Trait>) }
}

pub fn dyn() -> ::outer_mod::dyn::dyn {
Expand All @@ -72,7 +72,7 @@ mod macro_defn {
dyn
)
{
Box::new(10)
(Box::new(1), Box::new(2))
}
}

Expand Down

0 comments on commit f043d2d

Please sign in to comment.