swc/macros/ast_node/tests/attr_interop.rs

23 lines
557 B
Rust
Raw Normal View History

2018-03-04 09:17:52 +03:00
//! Test that `#[span]` and `#[fold]` can be used at same time.
extern crate serde;
2018-03-04 09:17:52 +03:00
extern crate swc_common;
use serde::{Deserialize, Serialize};
use swc_common::{ast_node, Fold, Span, Spanned};
2018-03-04 09:17:52 +03:00
#[ast_node]
// See https://github.com/rust-lang/rust/issues/44925
pub struct Class {
#[span]
pub has_span: HasSpan,
#[fold(ignore)]
pub s: String,
}
#[ast_node]
pub struct Tuple(#[span] HasSpan, #[fold(ignore)] usize, usize);
#[derive(Debug, Clone, PartialEq, Fold, Spanned, Serialize, Deserialize)]
2018-03-04 09:17:52 +03:00
pub struct HasSpan {
pub span: Span,
}