mirror of
https://github.com/swc-project/swc.git
synced 2024-12-20 04:01:39 +03:00
9d7af34aab
common: - rename `Folder` to `Fold` - folder.then() - impl Fold for Box<F> - impl Fold<T> for &mut F where F: Fold<T> transforms: - make Simplifier private - organize compat codegen: - use `Mark` to avoid deoptimization swc: - upgrade rayon and use global thread pool instead
23 lines
517 B
Rust
23 lines
517 B
Rust
//! Test that `#[span]` and `#[fold]` can be used at same time.
|
|
extern crate swc_common;
|
|
extern crate swc_macros;
|
|
use swc_common::{Fold, Span, Spanned};
|
|
use swc_macros::ast_node;
|
|
|
|
#[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)]
|
|
pub struct HasSpan {
|
|
pub span: Span,
|
|
}
|