Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #14 from Manishearth/macros
Browse files Browse the repository at this point in the history
Use local_inner_macros to allow compilation with new-style macro imports
  • Loading branch information
SimonSapin committed Jul 19, 2018
2 parents 88a017b + 71c74c7 commit 46141f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion matches/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 4 additions & 4 deletions matches/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand All @@ -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)
}
Expand All @@ -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! {
Expand Down Expand Up @@ -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)*); })
}
Expand Down

0 comments on commit 46141f4

Please sign in to comment.