Skip to content

impl-everywhere.rs has a weird test #55201

Closed
@Munksgaard

Description

@Munksgaard

From #54824 (comment):

[ ] impl-everywhere.rs:// @!has foo/fn.foo.html '//section[@id="main"]//pre' "x: &'x impl Foo"

This test looks strange. The generated documentation looks like this (wrapped in pre):

pub fn foo<'x>(
    x: &'x impl Foo
) -> &'x impl Foo

so it seems like the backslash in the test is taken literally which means that it doesn't match. Is that on purpose? @GuillaumeGomez it seems like you created the test, so perhaps you can enlighten me?

Edit: To be clear, removing the backslash from the test causes the test to fail.

My understanding is that test is trying to assert that fn.foo.html doesn't contain the phrase x: &' impl Foo, but because it is erroneously escaping a quote it fails to make that assertion. Furthermore, the generated fn.foo.html file actually does contain the text being checked for, so there is a bug in rustdoc as well.

Metadata

Metadata

Assignees

Labels

A-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions