rust/src/test/rustdoc/sized_trait.rs
Noah Lev 0d588e928e rustdoc: Fix incorrect usage of @!has and @!matches
`@!has` (and `@!matches`) with two arguments used to treat the second
argument as a literal string of HTML code. Now, that feature has been
renamed into `@!hasraw` (and `@!matchesraw`), and the arity-2 `@!has`
version is an error.

These uses thought the second argument was being treated as an XPath, as
with the arity-3 version, but in fact was being treated as literal HTML.
Because these were checking for the *absence* of the string, the tests
silently did nothing -- an XPath string won't ever be showing up in the
test's generated HTML!
2022-08-13 00:56:16 -04:00

17 lines
396 B
Rust

#![crate_name = "foo"]
// @has foo/struct.Bar.html
// @!has - '//*[@id="impl-Sized"]' ''
pub struct Bar {
a: u16,
}
// @has foo/struct.Foo.html
// @!has - '//*[@id="impl-Sized"]' ''
pub struct Foo<T: ?Sized>(T);
// @has foo/struct.Unsized.html
// @has - '//*[@id="impl-Sized-for-Unsized"]//h3[@class="code-header in-band"]' 'impl !Sized for Unsized'
pub struct Unsized {
data: [u8],
}