Skip to content

Commit 43b8503

Browse files
committed
rustdoc: Clean up some htmldocck tests
Fix #21740
1 parent 189930f commit 43b8503

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/test/run-make/rustdoc-hidden-line/foo.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@
3232
pub fn foo() {}
3333

3434
// @!has foo/fn.foo.html invisible
35-
// @matches - //pre '#.*\[.*derive.*\(.*Eq.*\).*\].*//.*Bar'
36-
35+
// @matches - //pre "#\[derive\(PartialEq\)\] // Bar"

src/test/run-make/rustdoc-negative-impl/foo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub struct Alpha;
1515
// @matches foo/struct.Bravo.html '//pre' "pub struct Bravo<B>"
1616
pub struct Bravo<B>;
1717

18-
// @matches foo/struct.Alpha.html '//*[@class="impl"]//code' "impl !.*Send.* for .*Alpha"
18+
// @matches foo/struct.Alpha.html '//*[@class="impl"]//code' "impl !Send for Alpha"
1919
impl !Send for Alpha {}
2020

21-
// @matches foo/struct.Bravo.html '//*[@class="impl"]//code' "impl<B> !.*Send.* for .*Bravo.*<B>"
21+
// @matches foo/struct.Bravo.html '//*[@class="impl"]//code' "impl<B> !Send for Bravo<B>"
2222
impl<B> !Send for Bravo<B> {}

src/test/run-make/rustdoc-where/foo.rs

+13-12
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,30 @@
1010

1111
pub trait MyTrait {}
1212

13-
// @matches foo/struct.Alpha.html '//pre' "Alpha.*where.*A:.*MyTrait"
13+
// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A> where A: MyTrait"
1414
pub struct Alpha<A> where A: MyTrait;
15-
// @matches foo/trait.Bravo.html '//pre' "Bravo.*where.*B:.*MyTrait"
15+
// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait"
1616
pub trait Bravo<B> where B: MyTrait {}
17-
// @matches foo/fn.charlie.html '//pre' "charlie.*where.*C:.*MyTrait"
17+
// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>() where C: MyTrait"
1818
pub fn charlie<C>() where C: MyTrait {}
1919

2020
pub struct Delta<D>;
21-
// @matches foo/struct.Delta.html '//*[@class="impl"]//code' "impl.*Delta.*where.*D:.*MyTrait"
21+
// @has foo/struct.Delta.html '//*[@class="impl"]//code' \
22+
// "impl<D> Delta<D> where D: MyTrait"
2223
impl<D> Delta<D> where D: MyTrait {
2324
pub fn delta() {}
2425
}
2526

2627
pub struct Echo<E>;
27-
// @matches foo/struct.Echo.html '//*[@class="impl"]//code' \
28-
// "impl.*MyTrait.*for.*Echo.*where.*E:.*MyTrait"
29-
// @matches foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
30-
// "impl.*MyTrait.*for.*Echo.*where.*E:.*MyTrait"
28+
// @has foo/struct.Echo.html '//*[@class="impl"]//code' \
29+
// "impl<E> MyTrait for Echo<E> where E: MyTrait"
30+
// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
31+
// "impl<E> MyTrait for Echo<E> where E: MyTrait"
3132
impl<E> MyTrait for Echo<E> where E: MyTrait {}
3233

3334
pub enum Foxtrot<F> {}
34-
// @matches foo/enum.Foxtrot.html '//*[@class="impl"]//code' \
35-
// "impl.*MyTrait.*for.*Foxtrot.*where.*F:.*MyTrait"
36-
// @matches foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
37-
// "impl.*MyTrait.*for.*Foxtrot.*where.*F:.*MyTrait"
35+
// @has foo/enum.Foxtrot.html '//*[@class="impl"]//code' \
36+
// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
37+
// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \
38+
// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
3839
impl<F> MyTrait for Foxtrot<F> where F: MyTrait {}

0 commit comments

Comments
 (0)