about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2020-11-05 10:29:50 +0100
committerGitHub <noreply@github.com>2020-11-05 10:29:50 +0100
commit9bbb052af8150c054e3fbb9875bf018490805305 (patch)
tree0642e5191ad00f157822412af5a7955a0afdb9b0 /src/test/rustdoc
parent43e1b58bccf7e62bcccfd1ce0bedc9dc65df3564 (diff)
parent251f6da276c3bee6a0737b8b42d5d13295c3a4d8 (diff)
downloadrust-9bbb052af8150c054e3fbb9875bf018490805305.tar.gz
rust-9bbb052af8150c054e3fbb9875bf018490805305.zip
Rollup merge of #78727 - liketechnik:issue-55201, r=GuillaumeGomez
(rustdoc) fix test for trait impl display

The test checks that parameters and return values with `impl Trait` types are correctly generated in rustdoc's output.

In essence, the previous version of the test checked the absence of values that would never be generated by rustdoc, so it could basically never fail. These values were adjusted to the expected output and are now required to exist in rustdoc's output. See https://github.com/rust-lang/rust/issues/55201#issuecomment-716182474 for a detailed explanation of the reasoning behind the changes.

Note that the output of rustdoc for `impl Trait`s in parameters and return values did not change since the inital test creation, so this PR only modifies the test.

Closes #55201
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/impl-everywhere.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/rustdoc/impl-everywhere.rs b/src/test/rustdoc/impl-everywhere.rs
index 9d86dd3c29e..74281326258 100644
--- a/src/test/rustdoc/impl-everywhere.rs
+++ b/src/test/rustdoc/impl-everywhere.rs
@@ -8,23 +8,23 @@ pub struct Bar;
 impl Foo for Bar {}
 impl Foo2 for Bar {}
 
-// @!has foo/fn.foo.html '//section[@id="main"]//pre' "x: &\'x impl Foo"
-// @!has foo/fn.foo.html '//section[@id="main"]//pre' "-> &\'x impl Foo {"
+// @has foo/fn.foo.html '//section[@id="main"]//pre' "x: &'x impl Foo"
+// @has foo/fn.foo.html '//section[@id="main"]//pre' "-> &'x impl Foo"
 pub fn foo<'x>(x: &'x impl Foo) -> &'x impl Foo {
     x
 }
 
-// @!has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &\'x impl Foo"
-// @!has foo/fn.foo2.html '//section[@id="main"]//pre' '-> impl Foo2 {'
+// @has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &'x impl Foo"
+// @has foo/fn.foo2.html '//section[@id="main"]//pre' '-> impl Foo2'
 pub fn foo2<'x>(_x: &'x impl Foo) -> impl Foo2 {
     Bar
 }
 
-// @!has foo/fn.foo_foo.html '//section[@id="main"]//pre' '-> impl Foo + Foo2 {'
+// @has foo/fn.foo_foo.html '//section[@id="main"]//pre' '-> impl Foo + Foo2'
 pub fn foo_foo() -> impl Foo + Foo2 {
     Bar
 }
 
-// @!has foo/fn.foo2.html '//section[@id="main"]//pre' "x: &'x (impl Foo + Foo2)"
+// @has foo/fn.foo_foo_foo.html '//section[@id="main"]//pre' "x: &'x impl Foo + Foo2"
 pub fn foo_foo_foo<'x>(_x: &'x (impl Foo + Foo2)) {
 }