diff options
| author | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2023-01-05 09:13:28 +0100 |
|---|---|---|
| committer | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2023-01-11 09:32:08 +0000 |
| commit | cf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch) | |
| tree | 40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/rustdoc/proc-macro.rs | |
| parent | ca855e6e42787ecd062d81d53336fe6788ef51a9 (diff) | |
| download | rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip | |
Move /src/test to /tests
Diffstat (limited to 'src/test/rustdoc/proc-macro.rs')
| -rw-r--r-- | src/test/rustdoc/proc-macro.rs | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/test/rustdoc/proc-macro.rs b/src/test/rustdoc/proc-macro.rs deleted file mode 100644 index 10acb7ac495..00000000000 --- a/src/test/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; -} |
