Add regression test for #81289

This commit is contained in:
LeSeulArtichaut 2021-02-06 16:40:30 +01:00
parent 2a67e2e323
commit 793e88ad16
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// Rustdoc shouldn't display `mut` in function arguments, which are
// implementation details. Regression test for #81289.
#![crate_name = "foo"]
pub struct Foo;
// @count foo/struct.Foo.html '//*[@class="impl-items"]//*[@class="method"]' 2
// @!has - '//*[@class="impl-items"]//*[@class="method"]' 'mut'
impl Foo {
pub fn foo(mut self) {}
pub fn bar(mut bar: ()) {}
}
// @count foo/fn.baz.html '//*[@class="rust fn"]' 1
// @!has - '//*[@class="rust fn"]' 'mut'
pub fn baz(mut foo: Foo) {}