Merge pull request #14 from Manishearth/macros

Use local_inner_macros to allow compilation with new-style macro imports
This commit is contained in:
Simon Sapin
2018-07-19 10:03:47 +02:00
committed by GitHub
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "matches"
version = "0.1.6"
version = "0.1.7"
authors = ["Simon Sapin <simon.sapin@exyr.org>"]
license = "MIT"
repository = "https://github.com/SimonSapin/rust-std-candidates"
+4 -4
View File
@@ -27,7 +27,7 @@
///
/// # fn main() { }
/// ```
#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! matches {
($expression:expr, $($pattern:tt)+) => {
_matches_tt_as_expr_hack! {
@@ -41,7 +41,7 @@ macro_rules! matches {
/// Work around "error: unexpected token: `an interpolated tt`", whatever that means.
#[doc(hidden)]
#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! _matches_tt_as_expr_hack {
($value:expr) => ($value)
}
@@ -64,7 +64,7 @@ macro_rules! _matches_tt_as_expr_hack {
/// assert_matches!(data.get(1), Some(_));
/// }
/// ```
#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! assert_matches {
($expression:expr, $($pattern:tt)+) => {
_matches_tt_as_expr_hack! {
@@ -96,7 +96,7 @@ macro_rules! assert_matches {
/// debug_assert_matches!(data.get(1), Some(_));
/// }
/// ```
#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! debug_assert_matches {
($($arg:tt)*) => (if cfg!(debug_assertions) { assert_matches!($($arg)*); })
}