diff options
| author | bors <bors@rust-lang.org> | 2023-01-11 11:17:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-11 11:17:22 +0000 |
| commit | b22c152958eade17a71d899b29a2d39bcc77aa48 (patch) | |
| tree | ec6da75dc598a0a4086c0cc032c86d7241be1bc1 /tests/rustdoc/intra-doc/basic.rs | |
| parent | 8ecaad85f61375b18e1667b51a3ef350121d2ca0 (diff) | |
| parent | 40ba0e84d53f605ccf01836e9c2d27892728ae81 (diff) | |
| download | rust-b22c152958eade17a71d899b29a2d39bcc77aa48.tar.gz rust-b22c152958eade17a71d899b29a2d39bcc77aa48.zip | |
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
Move src/test to the root
See MCP at rust-lang/compiler-team#573
There may be more changes needed.
The first commit is just the move of the files:
You can check that the first commit did not do anything else than renames by running
```
git diff --diff-filter=r -M100% <rust-lang remote>/master <first commit hash>
```
The output should be empty, because the filter excludes renames, and the match threshold for qualifying a rename is 100%.
The second one is mostly a "find and replace" of `src/test` to `tests` and whatever is needed to make CI pass.
What is left to do:
---
- [x] Move directory
- [ ] Change references to `src/test`
- [x] Change references in-tree
- [ ] Change references in submodules / out-of-tree docs
- [x] Make CI pass:
- [x] Fix tidy
- [x] Fix tests
- [x] Bless tests if needed (shouldn't normally)
- [ ] Merge it !
Diffstat (limited to 'tests/rustdoc/intra-doc/basic.rs')
| -rw-r--r-- | tests/rustdoc/intra-doc/basic.rs | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/tests/rustdoc/intra-doc/basic.rs b/tests/rustdoc/intra-doc/basic.rs new file mode 100644 index 00000000000..39f5c298bc4 --- /dev/null +++ b/tests/rustdoc/intra-doc/basic.rs @@ -0,0 +1,84 @@ +// @has basic/index.html +// @has - '//a/@href' 'struct.ThisType.html' +// @has - '//a/@href' 'struct.ThisType.html#method.this_method' +// @has - '//a/@href' 'enum.ThisEnum.html' +// @has - '//a/@href' 'enum.ThisEnum.html#variant.ThisVariant' +// @has - '//a/@href' 'trait.ThisTrait.html' +// @has - '//a/@href' 'trait.ThisTrait.html#tymethod.this_associated_method' +// @has - '//a/@href' 'trait.ThisTrait.html#associatedtype.ThisAssociatedType' +// @has - '//a/@href' 'trait.ThisTrait.html#associatedconstant.THIS_ASSOCIATED_CONST' +// @has - '//a/@href' 'trait.ThisTrait.html' +// @has - '//a/@href' 'type.ThisAlias.html' +// @has - '//a/@href' 'union.ThisUnion.html' +// @has - '//a/@href' 'fn.this_function.html' +// @has - '//a/@href' 'constant.THIS_CONST.html' +// @has - '//a/@href' 'static.THIS_STATIC.html' +// @has - '//a/@href' 'macro.this_macro.html' +// @has - '//a/@href' 'trait.SoAmbiguous.html' +// @has - '//a/@href' 'fn.SoAmbiguous.html' +//! In this crate we would like to link to: +//! +//! * [`ThisType`](ThisType) +//! * [`ThisType::this_method`](ThisType::this_method) +//! * [`ThisEnum`](ThisEnum) +//! * [`ThisEnum::ThisVariant`](ThisEnum::ThisVariant) +//! * [`ThisEnum::ThisVariantCtor`](ThisEnum::ThisVariantCtor) +//! * [`ThisTrait`](ThisTrait) +//! * [`ThisTrait::this_associated_method`](ThisTrait::this_associated_method) +//! * [`ThisTrait::ThisAssociatedType`](ThisTrait::ThisAssociatedType) +//! * [`ThisTrait::THIS_ASSOCIATED_CONST`](ThisTrait::THIS_ASSOCIATED_CONST) +//! * [`ThisAlias`](ThisAlias) +//! * [`ThisUnion`](ThisUnion) +//! * [`this_function`](this_function()) +//! * [`THIS_CONST`](const@THIS_CONST) +//! * [`THIS_STATIC`](static@THIS_STATIC) +//! * [`this_macro`](this_macro!) +//! +//! In addition, there's some specifics we want to look at. There's [a trait called +//! SoAmbiguous][ambig-trait], but there's also [a function called SoAmbiguous][ambig-fn] too! +//! Whatever shall we do? +//! +//! [ambig-trait]: trait@SoAmbiguous +//! [ambig-fn]: SoAmbiguous() + +#[macro_export] +macro_rules! this_macro { + () => {}; +} + +// @has basic/struct.ThisType.html '//a/@href' 'macro.this_macro.html' +/// another link to [`this_macro!()`] +pub struct ThisType; + +impl ThisType { + pub fn this_method() {} +} +pub enum ThisEnum { ThisVariant, ThisVariantCtor(u32), } +pub trait ThisTrait { + type ThisAssociatedType; + const THIS_ASSOCIATED_CONST: u8; + fn this_associated_method(); +} +pub type ThisAlias = Result<(), ()>; +pub union ThisUnion { this_field: usize, } + +pub fn this_function() {} +pub const THIS_CONST: usize = 5usize; +pub static THIS_STATIC: usize = 5usize; + +pub trait SoAmbiguous {} + +#[allow(nonstandard_style)] +pub fn SoAmbiguous() {} + + +// @has basic/struct.SomeOtherType.html '//a/@href' 'struct.ThisType.html' +// @has - '//a/@href' 'struct.ThisType.html#method.this_method' +// @has - '//a/@href' 'enum.ThisEnum.html' +// @has - '//a/@href' 'enum.ThisEnum.html#variant.ThisVariant' +/// Shortcut links for: +/// * [`ThisType`] +/// * [`ThisType::this_method`] +/// * [ThisEnum] +/// * [ThisEnum::ThisVariant] +pub struct SomeOtherType; |
