mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2024-11-23 16:00:10 +00:00
Un-export test suite macros
Eliminates a clippy lint: error: `crate` references the macro call's crate --> tests/macros/mod.rs:40:21 | 40 | let $expr = crate::macros::Tokens::parse::<$t>($expr).unwrap(); | ^^^^^ help: to reference the macro definition's crate, use: `$crate` | = note: `-D clippy::crate-in-macro-def` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#crate_in_macro_def
This commit is contained in:
parent
13bf252482
commit
9fd668c666
@ -1,9 +1,10 @@
|
||||
#![allow(unused_macros)]
|
||||
|
||||
#[path = "../debug/mod.rs"]
|
||||
pub mod debug;
|
||||
|
||||
use syn::parse::{Parse, Result};
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! errorf {
|
||||
($($tt:tt)*) => {{
|
||||
use ::std::io::Write;
|
||||
@ -12,7 +13,6 @@ macro_rules! errorf {
|
||||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! punctuated {
|
||||
($($e:expr,)+) => {{
|
||||
let mut seq = ::syn::punctuated::Punctuated::new();
|
||||
@ -27,14 +27,12 @@ macro_rules! punctuated {
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! snapshot {
|
||||
($($args:tt)*) => {
|
||||
snapshot_impl!(() $($args)*)
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! snapshot_impl {
|
||||
(($expr:ident) as $t:ty, @$snapshot:literal) => {
|
||||
let $expr = crate::macros::Tokens::parse::<$t>($expr).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user