diff options
| author | kennytm <kennytm@gmail.com> | 2018-05-04 02:16:59 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-05-04 02:16:59 +0800 |
| commit | bab812d7ca23a13ae59e80da4eaebaa3c6d63351 (patch) | |
| tree | 5960f4602afc29c6aa3ec0d6738f3c9cfa534204 /src/test | |
| parent | 4cc4a67cea385194ff0fd0d400bba894beceb759 (diff) | |
| parent | 390c3cee6a8e0c0550eb6213c0e7e5f74c4fbc31 (diff) | |
| download | rust-bab812d7ca23a13ae59e80da4eaebaa3c6d63351.tar.gz rust-bab812d7ca23a13ae59e80da4eaebaa3c6d63351.zip | |
Rollup merge of #50416 - rleungx:non-lifetime, r=estebank
check if the token is a lifetime before parsing Fixes #50381.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/macro-non-lifetime.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/compile-fail/macro-non-lifetime.rs b/src/test/compile-fail/macro-non-lifetime.rs new file mode 100644 index 00000000000..a2706e83229 --- /dev/null +++ b/src/test/compile-fail/macro-non-lifetime.rs @@ -0,0 +1,20 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test for issue #50381: non-lifetime passed to :lifetime. + +#![feature(macro_lifetime_matcher)] + +macro_rules! m { ($x:lifetime) => { } } + +fn main() { + m!(a); + //~^ ERROR expected a lifetime, found `a` +} |
