From 099f730dcf95404e3f272cb2690a25077b9f2a4b Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 5 May 2025 15:21:06 +0200 Subject: Created `tests/rustdoc/source-code-pages` subfolder to limit number of files at the top level --- .../source-code-pages/source-code-highlight.rs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/rustdoc/source-code-pages/source-code-highlight.rs (limited to 'tests/rustdoc/source-code-pages/source-code-highlight.rs') diff --git a/tests/rustdoc/source-code-pages/source-code-highlight.rs b/tests/rustdoc/source-code-pages/source-code-highlight.rs new file mode 100644 index 00000000000..f1c905e64c0 --- /dev/null +++ b/tests/rustdoc/source-code-pages/source-code-highlight.rs @@ -0,0 +1,29 @@ +// We need this option to be enabled for the `foo` macro declaration to ensure +// that the link on the ident is not including whitespace characters. + +//@ compile-flags: -Zunstable-options --generate-link-to-definition +#![crate_name = "foo"] + +//@ has 'src/foo/source-code-highlight.rs.html' + +//@ hasraw - 'foo' +#[macro_export] +macro_rules! foo { + () => {} +} + +//@ hasraw - 'foo!' +foo! {} + +//@ hasraw - 'f' +#[rustfmt::skip] +pub fn f () {} +//@ hasraw - 'Bar' +//@ hasraw - 'Bar' +//@ hasraw - 'u32' +#[rustfmt::skip] +pub struct Bar ( u32 ); +//@ hasraw - 'Foo' +pub enum Foo { + A, +} -- cgit 1.4.1-3-g733a5