diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-05-05 16:40:02 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-05-05 17:47:18 +0200 |
| commit | d1f4a0bcb60ab868c496ca72a28b48ac0a4128af (patch) | |
| tree | 5f9dc3dd1df27f8d4a2f7f06950943cc4ab3cc5c /tests/rustdoc/proc-macro.rs | |
| parent | eee6c9753588fe1888d3ddb264f9516e7ac56997 (diff) | |
| download | rust-d1f4a0bcb60ab868c496ca72a28b48ac0a4128af.tar.gz rust-d1f4a0bcb60ab868c496ca72a28b48ac0a4128af.zip | |
Created `tests/rustdoc/macro` subfolder to limit number of files at the top level
Diffstat (limited to 'tests/rustdoc/proc-macro.rs')
| -rw-r--r-- | tests/rustdoc/proc-macro.rs | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/tests/rustdoc/proc-macro.rs b/tests/rustdoc/proc-macro.rs deleted file mode 100644 index a821f68ab93..00000000000 --- a/tests/rustdoc/proc-macro.rs +++ /dev/null @@ -1,72 +0,0 @@ -//@ force-host -//@ no-prefer-dynamic -//@ compile-flags: --crate-type proc-macro --document-private-items - -#![crate_type="proc-macro"] -#![crate_name="some_macros"] - -//@ has some_macros/index.html -//@ has - '//a/[@href="attr.some_proc_attr.html"]' 'some_proc_attr' - -//! include a link to [some_proc_macro!] to make sure it works. - -extern crate proc_macro; - -use proc_macro::TokenStream; - -//@ has some_macros/index.html -//@ has - '//h2' 'Macros' -//@ has - '//h2' 'Attribute Macros' -//@ has - '//h2' 'Derive Macros' -//@ !has - '//h2' 'Functions' - -//@ has some_macros/all.html -//@ has - '//a[@href="macro.some_proc_macro.html"]' 'some_proc_macro' -//@ has - '//a[@href="attr.some_proc_attr.html"]' 'some_proc_attr' -//@ has - '//a[@href="derive.SomeDerive.html"]' 'SomeDerive' -//@ !has - '//a/@href' 'fn.some_proc_macro.html' -//@ !has - '//a/@href' 'fn.some_proc_attr.html' -//@ !has - '//a/@href' 'fn.some_derive.html' - -//@ has some_macros/index.html '//a/@href' 'macro.some_proc_macro.html' -//@ !has - '//a/@href' 'fn.some_proc_macro.html' -//@ has some_macros/macro.some_proc_macro.html -//@ !has some_macros/fn.some_proc_macro.html -/// a proc-macro that swallows its input and does nothing. -#[proc_macro] -pub fn some_proc_macro(_input: TokenStream) -> TokenStream { - TokenStream::new() -} - -//@ has some_macros/index.html '//a/@href' 'attr.some_proc_attr.html' -//@ !has - '//a/@href' 'fn.some_proc_attr.html' -//@ has some_macros/attr.some_proc_attr.html -//@ !has some_macros/fn.some_proc_attr.html -/// a proc-macro attribute that passes its item through verbatim. -#[proc_macro_attribute] -pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream { - item -} - -//@ has some_macros/index.html '//a/@href' 'derive.SomeDerive.html' -//@ !has - '//a/@href' 'fn.some_derive.html' -//@ has some_macros/derive.SomeDerive.html -//@ !has some_macros/fn.some_derive.html -/// a derive attribute that adds nothing to its input. -#[proc_macro_derive(SomeDerive)] -pub fn some_derive(_item: TokenStream) -> TokenStream { - TokenStream::new() -} - -//@ has some_macros/foo/index.html -mod foo { - //@ has - '//code' 'pub use some_proc_macro;' - //@ has - '//a/@href' '../macro.some_proc_macro.html' - pub use some_proc_macro; - //@ has - '//code' 'pub use some_proc_attr;' - //@ has - '//a/@href' '../attr.some_proc_attr.html' - pub use some_proc_attr; - //@ has - '//code' 'pub use some_derive;' - //@ has - '//a/@href' '../derive.SomeDerive.html' - pub use some_derive; -} |
