diff options
| author | bors <bors@rust-lang.org> | 2024-12-20 07:27:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-20 07:27:15 +0000 |
| commit | 8a1f8039a7ded79d3d4fe97b110016d89f2b11e2 (patch) | |
| tree | 5022f5c7ef7a02bbf580da393908b05294aa30c9 /tests/rustdoc | |
| parent | 5dfe648b45659db8dd0a673a806bba3df84aa3af (diff) | |
| parent | e6aea1afe920f0146699ff35e6a83e61b100d006 (diff) | |
| download | rust-8a1f8039a7ded79d3d4fe97b110016d89f2b11e2.tar.gz rust-8a1f8039a7ded79d3d4fe97b110016d89f2b11e2.zip | |
Auto merge of #134550 - jhpratt:rollup-wsfmo59, r=jhpratt
Rollup of 6 pull requests Successful merges: - #126118 (docs: Mention `spare_capacity_mut()` in `Vec::set_len`) - #132830 (Rename `elem_offset` to `element_offset`) - #133103 (Pass FnAbi to find_mir_or_eval_fn) - #134321 (Hide `= _` as associated constant value inside impl blocks) - #134518 (fix typos in the example code in the doc comments of `Ipv4Addr::from_bits()`, `Ipv6Addr::from_bits()` & `Ipv6Addr::to_bits()`) - #134521 (Arbitrary self types v2: roll loop.) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'tests/rustdoc')
| -rw-r--r-- | tests/rustdoc/assoc-consts-underscore.rs | 30 | ||||
| -rw-r--r-- | tests/rustdoc/bold-tag-101743.rs | 2 |
2 files changed, 31 insertions, 1 deletions
diff --git a/tests/rustdoc/assoc-consts-underscore.rs b/tests/rustdoc/assoc-consts-underscore.rs new file mode 100644 index 00000000000..f48098094db --- /dev/null +++ b/tests/rustdoc/assoc-consts-underscore.rs @@ -0,0 +1,30 @@ +pub struct Struct { + _private: (), +} + +pub trait Trait { + //@ has assoc_consts_underscore/trait.Trait.html '//pre[@class="rust item-decl"]' \ + // 'const REQUIRED: Struct;' + //@ !has - '//*[@id="associatedconstant.REQUIRED"]' 'const REQUIRED: Struct = _' + //@ has - '//*[@id="associatedconstant.REQUIRED"]' 'const REQUIRED: Struct' + const REQUIRED: Struct; + //@ has - '//pre[@class="rust item-decl"]' 'const OPTIONAL: Struct = _;' + //@ has - '//*[@id="associatedconstant.OPTIONAL"]' 'const OPTIONAL: Struct = _' + const OPTIONAL: Struct = Struct { _private: () }; +} + +impl Trait for Struct { + //@ !has assoc_consts_underscore/struct.Struct.html '//*[@id="associatedconstant.REQUIRED"]' \ + // 'const REQUIRED: Struct = _' + //@ has - '//*[@id="associatedconstant.REQUIRED"]' 'const REQUIRED: Struct' + const REQUIRED: Struct = Struct { _private: () }; + //@ !has - '//*[@id="associatedconstant.OPTIONAL"]' 'const OPTIONAL: Struct = _' + //@ has - '//*[@id="associatedconstant.OPTIONAL"]' 'const OPTIONAL: Struct' + const OPTIONAL: Struct = Struct { _private: () }; +} + +impl Struct { + //@ !has - '//*[@id="associatedconstant.INHERENT"]' 'const INHERENT: Struct = _' + //@ has - '//*[@id="associatedconstant.INHERENT"]' 'const INHERENT: Struct' + pub const INHERENT: Struct = Struct { _private: () }; +} diff --git a/tests/rustdoc/bold-tag-101743.rs b/tests/rustdoc/bold-tag-101743.rs index a81767eeeeb..3cd4005a4fa 100644 --- a/tests/rustdoc/bold-tag-101743.rs +++ b/tests/rustdoc/bold-tag-101743.rs @@ -14,6 +14,6 @@ impl<const B: Word> Repr<B> { // If we change back to rendering the value of consts, check this doesn't add // a <b> tag, but escapes correctly - //@ has foo/struct.Repr.html '//section[@id="associatedconstant.BASE"]/h4' '= _' + //@ !has foo/struct.Repr.html '//section[@id="associatedconstant.BASE"]/h4' '=' pub const BASE: IBig = base_as_ibig::<B>(); } |
