Add test for trailing whitespace in long declaration
This commit is contained in:
parent
b17cf7a493
commit
69f7a6216e
@ -2,7 +2,7 @@
|
||||
|
||||
// @has assoc_types/trait.Index.html
|
||||
pub trait Index<I: ?Sized> {
|
||||
// @has - '//*[@id="associatedtype.Output"]//h4[@class="code-header"]' 'type Output: ?Sized'
|
||||
// @has - '//*[@id="associatedtype.Output"]//h4[@class="code-header"]' 'type Output: ?Sized'
|
||||
type Output: ?Sized;
|
||||
// @has - '//*[@id="tymethod.index"]//h4[@class="code-header"]' \
|
||||
// "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
|
||||
|
@ -0,0 +1,7 @@
|
||||
<code>pub trait Write {
|
||||
fn <a href="#tymethod.poll_write" class="fnname">poll_write</a>(<br />        self: <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br />        cx: &mut <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br />        buf: &mut [<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>]<br />    ) -> <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="{{channel}}/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>, <a class="struct" href="struct.Error.html" title="struct foo::Error">Error</a>>>;
|
||||
<span class="item-spacer" /> fn <a href="#tymethod.poll_flush" class="fnname">poll_flush</a>(<br />        self: <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br />        cx: &mut <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><br />    ) -> <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="{{channel}}/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="{{channel}}/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct foo::Error">Error</a>>>;
|
||||
<span class="item-spacer" /> fn <a href="#tymethod.poll_close" class="fnname">poll_close</a>(<br />        self: <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br />        cx: &mut <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><br />    ) -> <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="{{channel}}/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="{{channel}}/std/primitive.unit.html">()</a>, <a class="struct" href="struct.Error.html" title="struct foo::Error">Error</a>>>;
|
||||
|
||||
fn <a href="#method.poll_write_vectored" class="fnname">poll_write_vectored</a>(<br />        self: <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br />        cx: &mut <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="{{channel}}/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br />        bufs: &[<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>]<br />    ) -> <a class="enum" href="{{channel}}/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="{{channel}}/core/result/enum.Result.html" title="enum core::result::Result">Result</a><<a class="primitive" href="{{channel}}/std/primitive.usize.html">usize</a>, <a class="struct" href="struct.Error.html" title="struct foo::Error">Error</a>>> { ... }
|
||||
}</code>
|
30
src/test/rustdoc/decl-trailing-whitespace.rs
Normal file
30
src/test/rustdoc/decl-trailing-whitespace.rs
Normal file
@ -0,0 +1,30 @@
|
||||
// Regression test for <https://github.com/rust-lang/rust/issues/98803>.
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
pub struct Error;
|
||||
|
||||
// @has 'foo/trait.Write.html'
|
||||
|
||||
pub trait Write {
|
||||
// @snapshot 'declaration' - '//*[@class="docblock item-decl"]//code'
|
||||
fn poll_write(
|
||||
self: Option<String>,
|
||||
cx: &mut Option<String>,
|
||||
buf: &mut [usize]
|
||||
) -> Option<Result<usize, Error>>;
|
||||
fn poll_flush(
|
||||
self: Option<String>,
|
||||
cx: &mut Option<String>
|
||||
) -> Option<Result<(), Error>>;
|
||||
fn poll_close(
|
||||
self: Option<String>,
|
||||
cx: &mut Option<String>,
|
||||
) -> Option<Result<(), Error>>;
|
||||
|
||||
fn poll_write_vectored(
|
||||
self: Option<String>,
|
||||
cx: &mut Option<String>,
|
||||
bufs: &[usize]
|
||||
) -> Option<Result<usize, Error>> {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user