diff options
| author | bors <bors@rust-lang.org> | 2022-01-20 20:44:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-20 20:44:14 +0000 |
| commit | 777bb86bcdbc568be7cff6eeeaaf81a89b4aa50b (patch) | |
| tree | 82f458e6da62ec8cd4baa7cf5c1b4c2eed5f3cc5 /src/test/rustdoc | |
| parent | 74fbbefea8d13683cca5eee62e4740706cb3144a (diff) | |
| parent | dbc97490bbca00e6913c34b8864791d660c60312 (diff) | |
| download | rust-777bb86bcdbc568be7cff6eeeaaf81a89b4aa50b.tar.gz rust-777bb86bcdbc568be7cff6eeeaaf81a89b4aa50b.zip | |
Auto merge of #93119 - matthiaskrgr:rollup-ku3cn5j, r=matthiaskrgr
Rollup of 13 pull requests Successful merges: - #89747 (Add MaybeUninit::(slice_)as_bytes(_mut)) - #89764 (Fix variant index / discriminant confusion in uninhabited enum branching) - #91606 (Stabilize `-Z print-link-args` as `--print link-args`) - #91694 (rustdoc: decouple stability and const-stability) - #92183 (Point at correct argument when async fn output type lifetime disagrees with signature) - #92582 (improve `_` constants in item signature handling) - #92680 (intra-doc: Use the impl's assoc item where possible) - #92704 (Change lint message to be stronger for &T -> &mut T transmute) - #92861 (Rustdoc mobile: put out-of-band info on its own line) - #92992 (Help optimize out backtraces when disabled) - #93038 (Fix star handling in block doc comments) - #93108 (:arrow_up: rust-analyzer) - #93112 (Fix CVE-2022-21658) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/const-display.rs | 17 | ||||
| -rw-r--r-- | src/test/rustdoc/deref-const-fn.rs | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/strip-block-doc-comments-stars.docblock.html | 2 | ||||
| -rw-r--r-- | src/test/rustdoc/strip-block-doc-comments-stars.rs | 11 |
4 files changed, 31 insertions, 1 deletions
diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs index fb8ea7e33c2..b8e101038f8 100644 --- a/src/test/rustdoc/const-display.rs +++ b/src/test/rustdoc/const-display.rs @@ -67,3 +67,20 @@ impl Foo { #[rustc_const_stable(feature = "rust1", since = "1.2.0")] pub const fn stable_impl() -> u32 { 42 } } + +#[stable(feature = "rust1", since = "1.0.0")] +pub struct Bar; + +impl Bar { + // Do not show non-const stabilities that are the same as the enclosing item. + // @matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.2.0$' + #[stable(feature = "rust1", since = "1.0.0")] + #[rustc_const_stable(feature = "rust1", since = "1.2.0")] + pub const fn stable_impl() -> u32 { 42 } + + // Show const-stability even for unstable functions. + // @matches 'foo/struct.Bar.html' '//span[@class="since"]' '^const: 1.3.0$' + #[unstable(feature = "foo2", issue = "none")] + #[rustc_const_stable(feature = "rust1", since = "1.3.0")] + pub const fn const_stable_unstable() -> u32 { 42 } +} diff --git a/src/test/rustdoc/deref-const-fn.rs b/src/test/rustdoc/deref-const-fn.rs index ca51f3c7b5a..8ecca6d12d2 100644 --- a/src/test/rustdoc/deref-const-fn.rs +++ b/src/test/rustdoc/deref-const-fn.rs @@ -13,7 +13,7 @@ pub struct Bar; impl Bar { // @has - '//*[@id="method.len"]' 'pub const fn len(&self) -> usize' - // @has - '//*[@id="method.len"]//span[@class="since"]' '1.0.0 (const: 1.0.0)' + // @has - '//*[@id="method.len"]//span[@class="since"]' 'const: 1.0.0' #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(feature = "rust1", since = "1.0.0")] pub const fn len(&self) -> usize { 0 } diff --git a/src/test/rustdoc/strip-block-doc-comments-stars.docblock.html b/src/test/rustdoc/strip-block-doc-comments-stars.docblock.html new file mode 100644 index 00000000000..22b0b5dc47e --- /dev/null +++ b/src/test/rustdoc/strip-block-doc-comments-stars.docblock.html @@ -0,0 +1,2 @@ +<div class="docblock"><p>a</p> +</div> \ No newline at end of file diff --git a/src/test/rustdoc/strip-block-doc-comments-stars.rs b/src/test/rustdoc/strip-block-doc-comments-stars.rs new file mode 100644 index 00000000000..ed2297b4fac --- /dev/null +++ b/src/test/rustdoc/strip-block-doc-comments-stars.rs @@ -0,0 +1,11 @@ +#![crate_name = "foo"] + +// The goal of this test is to answer that it won't be generated as a list because +// block doc comments can have their lines starting with a star. + +// @has foo/fn.foo.html +// @snapshot docblock - '//*[@class="rustdoc-toggle top-doc"]//*[@class="docblock"]' +/** + * a + */ +pub fn foo() {} |
