diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2025-08-19 19:50:05 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-19 19:50:05 +0800 |
| commit | 3e1a63d31dfcb8dc2b91cd75946849971d809816 (patch) | |
| tree | b98574dd5f42542ec3edb73edf71831f4c9c3038 /tests | |
| parent | 07518a7a251c045f3e6c04017f34a63e43e3035c (diff) | |
| parent | c335d5781df3132dcce2e900424703d9499e447c (diff) | |
| download | rust-3e1a63d31dfcb8dc2b91cd75946849971d809816.tar.gz rust-3e1a63d31dfcb8dc2b91cd75946849971d809816.zip | |
Rollup merge of #145568 - fee1-dead-contrib:push-uvsonuzxmkus, r=fmease
ignore frontmatters in `TokenStream::new` Fixes rust-lang/rust#145520 for now, we'd likely want to figure the stripping part later, so I noted it down on the list on the tracking issue. cc `@fmease`
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/frontmatter/auxiliary/makro.rs | 2 | ||||
| -rw-r--r-- | tests/ui/frontmatter/proc-macro-observer.rs | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/tests/ui/frontmatter/auxiliary/makro.rs b/tests/ui/frontmatter/auxiliary/makro.rs index 78e7417afb5..70707b27bff 100644 --- a/tests/ui/frontmatter/auxiliary/makro.rs +++ b/tests/ui/frontmatter/auxiliary/makro.rs @@ -3,6 +3,6 @@ use proc_macro::TokenStream; #[proc_macro] pub fn check(_: TokenStream) -> TokenStream { - assert!("---\n---".parse::<TokenStream>().unwrap().is_empty()); + assert_eq!(6, "---\n---".parse::<TokenStream>().unwrap().into_iter().count()); Default::default() } diff --git a/tests/ui/frontmatter/proc-macro-observer.rs b/tests/ui/frontmatter/proc-macro-observer.rs index bafbe912032..b1cc1460933 100644 --- a/tests/ui/frontmatter/proc-macro-observer.rs +++ b/tests/ui/frontmatter/proc-macro-observer.rs @@ -2,11 +2,10 @@ //@ proc-macro: makro.rs //@ edition: 2021 -#![feature(frontmatter)] - makro::check!(); -// checks that a proc-macro cannot observe frontmatter tokens. +// checks that a proc-macro doesn't know or parse frontmatters at all and instead treats +// it as normal Rust code. // see auxiliary/makro.rs for how it is tested. fn main() {} |
