Rename @hastext
to @hasraw
(same for matches
)
I think `@hasraw` is slightly clearer than `@hastext` since it is actually matching against the raw HTML, not the text nodes.
This commit is contained in:
parent
37eed1d1ff
commit
13d53273f8
41 changed files with 175 additions and 175 deletions
|
@ -41,15 +41,15 @@ There are a number of supported commands:
|
|||
`PATH` is relative to the output directory. It can be given as `-`
|
||||
which repeats the most recently used `PATH`.
|
||||
|
||||
* `@hastext PATH PATTERN` and `@matchestext PATH PATTERN` checks
|
||||
* `@hasraw PATH PATTERN` and `@matchesraw PATH PATTERN` checks
|
||||
for the occurrence of the given pattern `PATTERN` in the specified file.
|
||||
Only one occurrence of the pattern is enough.
|
||||
|
||||
For `@hastext`, `PATTERN` is a whitespace-normalized (every consecutive
|
||||
For `@hasraw`, `PATTERN` is a whitespace-normalized (every consecutive
|
||||
whitespace being replaced by one single space character) string.
|
||||
The entire file is also whitespace-normalized including newlines.
|
||||
|
||||
For `@matchestext`, `PATTERN` is a Python-supported regular expression.
|
||||
For `@matchesraw`, `PATTERN` is a Python-supported regular expression.
|
||||
The file remains intact but the regexp is matched without the `MULTILINE`
|
||||
and `IGNORECASE` options. You can still use a prefix `(?m)` or `(?i)`
|
||||
to override them, and `\A` and `\Z` for definitely matching
|
||||
|
@ -542,19 +542,19 @@ ERR_COUNT = 0
|
|||
def check_command(c, cache):
|
||||
try:
|
||||
cerr = ""
|
||||
if c.cmd in ['has', 'hastext', 'matches', 'matchestext']: # string test
|
||||
if c.cmd in ['has', 'hasraw', 'matches', 'matchesraw']: # string test
|
||||
regexp = c.cmd.startswith('matches')
|
||||
if len(c.args) == 1 and not regexp and 'text' not in c.cmd: # @has <path> = file existence
|
||||
if len(c.args) == 1 and not regexp and 'raw' not in c.cmd: # @has <path> = file existence
|
||||
try:
|
||||
cache.get_file(c.args[0])
|
||||
ret = True
|
||||
except FailedCheck as err:
|
||||
cerr = str(err)
|
||||
ret = False
|
||||
elif len(c.args) == 2 and 'text' in c.cmd: # @hastext/matchestext <path> <pat> = string test
|
||||
elif len(c.args) == 2 and 'raw' in c.cmd: # @hasraw/matchesraw <path> <pat> = string test
|
||||
cerr = "`PATTERN` did not match"
|
||||
ret = check_string(cache.get_file(c.args[0]), c.args[1], regexp)
|
||||
elif len(c.args) == 3 and 'text' not in c.cmd: # @has/matches <path> <pat> <match> = XML tree test
|
||||
elif len(c.args) == 3 and 'raw' not in c.cmd: # @has/matches <path> <pat> <match> = XML tree test
|
||||
cerr = "`XPATH PATTERN` did not match"
|
||||
ret = get_nb_matching_elements(cache, c, regexp, True) != 0
|
||||
else:
|
||||
|
|
|
@ -5,8 +5,8 @@ pub struct Foo0;
|
|||
|
||||
impl Foo0 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc'
|
||||
// @hastext - 'fn_with_doc short'
|
||||
// @hastext - 'fn_with_doc full'
|
||||
// @hasraw - 'fn_with_doc short'
|
||||
// @hasraw - 'fn_with_doc full'
|
||||
/// fn_with_doc short
|
||||
///
|
||||
/// fn_with_doc full
|
||||
|
@ -52,8 +52,8 @@ pub struct Foo1;
|
|||
|
||||
impl Bar for Foo1 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
|
||||
// @hastext - 'fn_empty_with_doc_impl short'
|
||||
// @hastext - 'fn_empty_with_doc_impl full'
|
||||
// @hasraw - 'fn_empty_with_doc_impl short'
|
||||
// @hasraw - 'fn_empty_with_doc_impl full'
|
||||
/// fn_empty_with_doc_impl short
|
||||
///
|
||||
/// fn_empty_with_doc_impl full
|
||||
|
@ -63,8 +63,8 @@ impl Bar for Foo1 {
|
|||
fn fn_empty_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
|
||||
// @hastext - 'fn_def_with_doc_impl short'
|
||||
// @hastext - 'fn_def_with_doc_impl full'
|
||||
// @hasraw - 'fn_def_with_doc_impl short'
|
||||
// @hasraw - 'fn_def_with_doc_impl full'
|
||||
/// fn_def_with_doc_impl short
|
||||
///
|
||||
/// fn_def_with_doc_impl full
|
||||
|
@ -74,7 +74,7 @@ impl Bar for Foo1 {
|
|||
fn fn_def_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
|
||||
// @hastext - 'fn_def_def_with_doc short'
|
||||
// @hasraw - 'fn_def_def_with_doc short'
|
||||
// @!has - 'fn_def_def_with_doc full'
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
|
||||
|
@ -85,33 +85,33 @@ pub struct Foo2;
|
|||
|
||||
impl Bar for Foo2 {
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
|
||||
// @hastext - 'fn_empty_with_doc short'
|
||||
// @hasraw - 'fn_empty_with_doc short'
|
||||
// @!has - 'fn_empty_with_doc full'
|
||||
fn fn_empty_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
|
||||
// @hastext - 'fn_empty_without_doc_impl short'
|
||||
// @hastext - 'fn_empty_without_doc_impl full'
|
||||
// @hasraw - 'fn_empty_without_doc_impl short'
|
||||
// @hasraw - 'fn_empty_without_doc_impl full'
|
||||
/// fn_empty_without_doc_impl short
|
||||
///
|
||||
/// fn_empty_without_doc_impl full
|
||||
fn fn_empty_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
|
||||
// @hastext - 'fn_def_with_doc short'
|
||||
// @hasraw - 'fn_def_with_doc short'
|
||||
// @!has - 'fn_def_with_doc full'
|
||||
fn fn_def_with_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
|
||||
// @hastext - 'fn_def_without_doc_impl short'
|
||||
// @hastext - 'fn_def_without_doc_impl full'
|
||||
// @hasraw - 'fn_def_without_doc_impl short'
|
||||
// @hasraw - 'fn_def_without_doc_impl full'
|
||||
/// fn_def_without_doc_impl short
|
||||
///
|
||||
/// fn_def_without_doc_impl full
|
||||
fn fn_def_without_doc() {}
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
|
||||
// @hastext - 'fn_def_def_with_doc short'
|
||||
// @hasraw - 'fn_def_def_with_doc short'
|
||||
// @!has - 'fn_def_def_with_doc full'
|
||||
|
||||
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
|
||||
|
|
|
@ -11,33 +11,33 @@ pub struct Ref<'a>(&'a u32);
|
|||
type ARef<'a> = Ref<'a>;
|
||||
|
||||
// @has foo/fn.test1.html
|
||||
// @matchestext - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
pub fn test1(a: &u32) -> Ref {
|
||||
Ref(a)
|
||||
}
|
||||
|
||||
// @has foo/fn.test2.html
|
||||
// @matchestext - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
pub fn test2(a: &u32) -> Ref<'_> {
|
||||
Ref(a)
|
||||
}
|
||||
|
||||
// @has foo/fn.test3.html
|
||||
// @matchestext - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
pub fn test3(a: &u32) -> ARef {
|
||||
Ref(a)
|
||||
}
|
||||
|
||||
// @has foo/fn.test4.html
|
||||
// @matchestext - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
pub fn test4(a: &u32) -> ARef<'_> {
|
||||
Ref(a)
|
||||
}
|
||||
|
||||
// Ensure external paths in inlined docs also display elided lifetime
|
||||
// @has foo/bar/fn.test5.html
|
||||
// @matchestext - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
// @has foo/bar/fn.test6.html
|
||||
// @matchestext - "Ref</a><'_>"
|
||||
// @matchesraw - "Ref</a><'_>"
|
||||
#[doc(inline)]
|
||||
pub extern crate bar;
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
// compile-flags: --document-private-items
|
||||
|
||||
// @has 'empty_mod_private/index.html' '//a[@href="foo/index.html"]' 'foo'
|
||||
// @hastext 'empty_mod_private/sidebar-items.js' 'foo'
|
||||
// @hasraw 'empty_mod_private/sidebar-items.js' 'foo'
|
||||
// @matches 'empty_mod_private/foo/index.html' '//h1' 'Module empty_mod_private::foo'
|
||||
mod foo {}
|
||||
|
||||
// @has 'empty_mod_private/index.html' '//a[@href="bar/index.html"]' 'bar'
|
||||
// @hastext 'empty_mod_private/sidebar-items.js' 'bar'
|
||||
// @hasraw 'empty_mod_private/sidebar-items.js' 'bar'
|
||||
// @matches 'empty_mod_private/bar/index.html' '//h1' 'Module empty_mod_private::bar'
|
||||
mod bar {
|
||||
// @has 'empty_mod_private/bar/index.html' '//a[@href="baz/index.html"]' 'baz'
|
||||
// @hastext 'empty_mod_private/bar/sidebar-items.js' 'baz'
|
||||
// @hasraw 'empty_mod_private/bar/sidebar-items.js' 'baz'
|
||||
// @matches 'empty_mod_private/bar/baz/index.html' '//h1' 'Module empty_mod_private::bar::baz'
|
||||
mod baz {}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
// @has 'empty_mod_public/index.html' '//a[@href="foo/index.html"]' 'foo'
|
||||
// @hastext 'empty_mod_public/sidebar-items.js' 'foo'
|
||||
// @hasraw 'empty_mod_public/sidebar-items.js' 'foo'
|
||||
// @matches 'empty_mod_public/foo/index.html' '//h1' 'Module empty_mod_public::foo'
|
||||
pub mod foo {}
|
||||
|
||||
// @has 'empty_mod_public/index.html' '//a[@href="bar/index.html"]' 'bar'
|
||||
// @hastext 'empty_mod_public/sidebar-items.js' 'bar'
|
||||
// @hasraw 'empty_mod_public/sidebar-items.js' 'bar'
|
||||
// @matches 'empty_mod_public/bar/index.html' '//h1' 'Module empty_mod_public::bar'
|
||||
pub mod bar {
|
||||
// @has 'empty_mod_public/bar/index.html' '//a[@href="baz/index.html"]' 'baz'
|
||||
// @hastext 'empty_mod_public/bar/sidebar-items.js' 'baz'
|
||||
// @hasraw 'empty_mod_public/bar/sidebar-items.js' 'baz'
|
||||
// @matches 'empty_mod_public/bar/baz/index.html' '//h1' 'Module empty_mod_public::bar::baz'
|
||||
pub mod baz {}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ pub trait Trait {
|
|||
// Make sure that the elided lifetime shows up
|
||||
|
||||
// @has foo/type.T.html
|
||||
// @hastext - "pub type T = "
|
||||
// @hastext - "<'_>"
|
||||
// @hasraw - "pub type T = "
|
||||
// @hasraw - "<'_>"
|
||||
pub type T = fn(&<() as Trait>::Gat<'_>);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
extern crate unstable_trait;
|
||||
|
||||
// @hastext foo/struct.Foo.html 'bar'
|
||||
// @hastext foo/struct.Foo.html 'bar2'
|
||||
// @hasraw foo/struct.Foo.html 'bar'
|
||||
// @hasraw foo/struct.Foo.html 'bar2'
|
||||
#[doc(inline)]
|
||||
pub use unstable_trait::Foo;
|
||||
|
|
|
@ -12,9 +12,9 @@ pub struct Bar<T> { t: T }
|
|||
// full impl string. Instead, just make sure something from each part
|
||||
// is mentioned.
|
||||
|
||||
// @hastext implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
|
||||
// @hastext - Send
|
||||
// @hastext - !AnAutoTrait
|
||||
// @hastext - Copy
|
||||
// @hasraw implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
|
||||
// @hasraw - Send
|
||||
// @hasraw - !AnAutoTrait
|
||||
// @hasraw - Copy
|
||||
impl<T: Send> !rustdoc_impl_parts_crosscrate::AnAutoTrait for Bar<T>
|
||||
where T: Copy {}
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
trait MyTrait {}
|
||||
impl MyTrait for i32 {}
|
||||
|
||||
// @hastext impl_trait_alias/type.Foo.html 'Foo'
|
||||
// @hasraw impl_trait_alias/type.Foo.html 'Foo'
|
||||
/// debug type
|
||||
pub type Foo = impl MyTrait;
|
||||
|
||||
// @hastext impl_trait_alias/fn.foo.html 'foo'
|
||||
// @hasraw impl_trait_alias/fn.foo.html 'foo'
|
||||
/// debug function
|
||||
pub fn foo() -> Foo {
|
||||
1
|
||||
|
|
|
@ -4,6 +4,6 @@ extern crate inner;
|
|||
|
||||
|
||||
// @has add_docs/struct.MyStruct.html
|
||||
// @hastext add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition"
|
||||
// @hasraw add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition"
|
||||
/// Doc comment from 'pub use',
|
||||
pub use inner::MyStruct;
|
||||
|
|
|
@ -12,25 +12,25 @@ extern crate some_macros;
|
|||
// @has proc_macro/derive.SomeDerive.html
|
||||
|
||||
// @has proc_macro/macro.some_proc_macro.html
|
||||
// @hastext - 'a proc-macro that swallows its input and does nothing.'
|
||||
// @hasraw - 'a proc-macro that swallows its input and does nothing.'
|
||||
pub use some_macros::some_proc_macro;
|
||||
|
||||
// @has proc_macro/macro.reexported_macro.html
|
||||
// @hastext - 'Doc comment from the original crate'
|
||||
// @hasraw - 'Doc comment from the original crate'
|
||||
pub use some_macros::reexported_macro;
|
||||
|
||||
// @has proc_macro/attr.some_proc_attr.html
|
||||
// @hastext - 'a proc-macro attribute that passes its item through verbatim.'
|
||||
// @hasraw - 'a proc-macro attribute that passes its item through verbatim.'
|
||||
pub use some_macros::some_proc_attr;
|
||||
|
||||
// @has proc_macro/derive.SomeDerive.html
|
||||
// @hastext - 'a derive attribute that adds nothing to its input.'
|
||||
// @hasraw - 'a derive attribute that adds nothing to its input.'
|
||||
pub use some_macros::SomeDerive;
|
||||
|
||||
// @has proc_macro/attr.first_attr.html
|
||||
// @hastext - 'Generated doc comment'
|
||||
// @hasraw - 'Generated doc comment'
|
||||
pub use some_macros::first_attr;
|
||||
|
||||
// @has proc_macro/attr.second_attr.html
|
||||
// @hastext - 'Generated doc comment'
|
||||
// @hasraw - 'Generated doc comment'
|
||||
pub use some_macros::second_attr;
|
||||
|
|
|
@ -12,14 +12,14 @@ mod mod1 {
|
|||
pub use mod1::*;
|
||||
|
||||
// @has foo/index.html
|
||||
// @hastext - "mod1"
|
||||
// @hastext - "public_fn"
|
||||
// @hasraw - "mod1"
|
||||
// @hasraw - "public_fn"
|
||||
// @!has - "private_fn"
|
||||
// @has foo/fn.public_fn.html
|
||||
// @!has foo/fn.private_fn.html
|
||||
|
||||
// @has foo/mod1/index.html
|
||||
// @hastext - "public_fn"
|
||||
// @hastext - "private_fn"
|
||||
// @hasraw - "public_fn"
|
||||
// @hasraw - "private_fn"
|
||||
// @has foo/mod1/fn.public_fn.html
|
||||
// @has foo/mod1/fn.private_fn.html
|
||||
|
|
|
@ -11,7 +11,7 @@ pub use mod1::*;
|
|||
|
||||
// @has foo/index.html
|
||||
// @!has - "mod1"
|
||||
// @hastext - "public_fn"
|
||||
// @hasraw - "public_fn"
|
||||
// @!has - "private_fn"
|
||||
// @has foo/fn.public_fn.html
|
||||
// @!has foo/fn.private_fn.html
|
||||
|
|
|
@ -15,11 +15,11 @@ mod mod1 {
|
|||
pub use mod1::*;
|
||||
|
||||
// @has foo/index.html
|
||||
// @hastext - "mod1"
|
||||
// @hastext - "Mod1Public"
|
||||
// @hasraw - "mod1"
|
||||
// @hasraw - "Mod1Public"
|
||||
// @!has - "Mod1Private"
|
||||
// @!has - "mod2"
|
||||
// @hastext - "Mod2Public"
|
||||
// @hasraw - "Mod2Public"
|
||||
// @!has - "Mod2Private"
|
||||
// @has foo/struct.Mod1Public.html
|
||||
// @!has foo/struct.Mod1Private.html
|
||||
|
@ -27,9 +27,9 @@ pub use mod1::*;
|
|||
// @!has foo/struct.Mod2Private.html
|
||||
|
||||
// @has foo/mod1/index.html
|
||||
// @hastext - "mod2"
|
||||
// @hastext - "Mod1Public"
|
||||
// @hastext - "Mod1Private"
|
||||
// @hasraw - "mod2"
|
||||
// @hasraw - "Mod1Public"
|
||||
// @hasraw - "Mod1Private"
|
||||
// @!has - "Mod2Public"
|
||||
// @!has - "Mod2Private"
|
||||
// @has foo/mod1/struct.Mod1Public.html
|
||||
|
@ -38,8 +38,8 @@ pub use mod1::*;
|
|||
// @!has foo/mod1/struct.Mod2Private.html
|
||||
|
||||
// @has foo/mod1/mod2/index.html
|
||||
// @hastext - "Mod2Public"
|
||||
// @hastext - "Mod2Private"
|
||||
// @hasraw - "Mod2Public"
|
||||
// @hasraw - "Mod2Private"
|
||||
// @has foo/mod1/mod2/struct.Mod2Public.html
|
||||
// @has foo/mod1/mod2/struct.Mod2Private.html
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ pub use mod1::*;
|
|||
|
||||
// @has foo/index.html
|
||||
// @!has - "mod1"
|
||||
// @hastext - "Mod1Public"
|
||||
// @hasraw - "Mod1Public"
|
||||
// @!has - "Mod1Private"
|
||||
// @!has - "mod2"
|
||||
// @hastext - "Mod2Public"
|
||||
// @hasraw - "Mod2Public"
|
||||
// @!has - "Mod2Private"
|
||||
// @has foo/struct.Mod1Public.html
|
||||
// @!has foo/struct.Mod1Private.html
|
||||
|
|
|
@ -12,7 +12,7 @@ pub mod a {
|
|||
|
||||
// @has please_inline/b/index.html
|
||||
pub mod b {
|
||||
// @hastext - 'pub use foo::'
|
||||
// @hasraw - 'pub use foo::'
|
||||
// @!has please_inline/b/struct.Foo.html
|
||||
#[feature(inline)]
|
||||
pub use foo::Foo;
|
||||
|
|
|
@ -25,11 +25,11 @@ impl G<usize> for ExternType {
|
|||
}
|
||||
|
||||
// @has 'extern_type/foreigntype.ExternType.html'
|
||||
// @hastext 'extern_type/fn.links_to_extern_type.html' \
|
||||
// @hasraw 'extern_type/fn.links_to_extern_type.html' \
|
||||
// 'href="foreigntype.ExternType.html#method.f"'
|
||||
// @hastext 'extern_type/fn.links_to_extern_type.html' \
|
||||
// @hasraw 'extern_type/fn.links_to_extern_type.html' \
|
||||
// 'href="foreigntype.ExternType.html#method.test"'
|
||||
// @hastext 'extern_type/fn.links_to_extern_type.html' \
|
||||
// @hasraw 'extern_type/fn.links_to_extern_type.html' \
|
||||
// 'href="foreigntype.ExternType.html#method.g"'
|
||||
/// See also [ExternType::f]
|
||||
/// See also [ExternType::test]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
pub struct Foo;
|
||||
|
||||
// @hastext issue_16265_1/traits/index.html 'source'
|
||||
// @hasraw issue_16265_1/traits/index.html 'source'
|
||||
pub mod traits {
|
||||
impl PartialEq for super::Foo {
|
||||
fn eq(&self, _: &super::Foo) -> bool {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// @hastext issue_16265_2/index.html 'source'
|
||||
// @hasraw issue_16265_2/index.html 'source'
|
||||
|
||||
trait Y {}
|
||||
impl Y for Option<u32> {}
|
||||
|
|
|
@ -6,7 +6,7 @@ pub mod str {
|
|||
#![doc(primitive = "str")]
|
||||
|
||||
impl str {
|
||||
// @hastext search-index.js foo
|
||||
// @hasraw search-index.js foo
|
||||
#[rustc_allow_incoherent_impl]
|
||||
pub fn foo(&self) {}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@ doc! {
|
|||
}
|
||||
|
||||
// @has issue_23812/Foo/index.html
|
||||
// @hastext - 'Outer comment'
|
||||
// @hasraw - 'Outer comment'
|
||||
// @!has - '/// Outer comment'
|
||||
// @hastext - 'Inner comment'
|
||||
// @hasraw - 'Inner comment'
|
||||
// @!has - '//! Inner comment'
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@ doc! {
|
|||
}
|
||||
|
||||
// @has issue_23812/Bar/index.html
|
||||
// @hastext - 'Outer block comment'
|
||||
// @hasraw - 'Outer block comment'
|
||||
// @!has - '/** Outer block comment */'
|
||||
// @hastext - 'Inner block comment'
|
||||
// @hasraw - 'Inner block comment'
|
||||
// @!has - '/*! Inner block comment */'
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
// @!has - 'extern crate std'
|
||||
// @!has - 'use std::prelude::'
|
||||
|
||||
// @hastext - 'pub extern crate empty'
|
||||
// @hasraw - 'pub extern crate empty'
|
||||
pub extern crate empty;
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
#![unstable(feature="test", issue="27759")]
|
||||
|
||||
// @has issue_27759/unstable/index.html
|
||||
// @hastext - '<code>test</code> <a href="http://issue_url/27759">#27759</a>'
|
||||
// @hasraw - '<code>test</code> <a href="http://issue_url/27759">#27759</a>'
|
||||
#[unstable(feature="test", issue="27759")]
|
||||
pub mod unstable {
|
||||
// @has issue_27759/unstable/fn.issue.html
|
||||
// @hastext - '<code>test_function</code> <a href="http://issue_url/12345">#12345</a>'
|
||||
// @hasraw - '<code>test_function</code> <a href="http://issue_url/12345">#12345</a>'
|
||||
#[unstable(feature="test_function", issue="12345")]
|
||||
pub fn issue() {}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// @has issue_31899/index.html
|
||||
// @hastext - 'Make this line a bit longer.'
|
||||
// @hasraw - 'Make this line a bit longer.'
|
||||
// @!has - 'rust rust-example-rendered'
|
||||
// @!has - 'use ndarray::arr2'
|
||||
// @!has - 'prohibited'
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]' \
|
||||
// '👎 Deprecated since 1.0.0: text'
|
||||
// @hastext - '<code>test</code> <a href="https://issue_url/32374">#32374</a>'
|
||||
// @hasraw - '<code>test</code> <a href="https://issue_url/32374">#32374</a>'
|
||||
// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' \
|
||||
// '🔬 This is a nightly-only experimental API. \(test\s#32374\)$'
|
||||
/// Docs
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// @has issue_41783/struct.Foo.html
|
||||
// @!has - 'space'
|
||||
// @!has - 'comment'
|
||||
// @hastext - '# <span class="ident">single'
|
||||
// @hastext - '## <span class="ident">double</span>'
|
||||
// @hastext - '### <span class="ident">triple</span>'
|
||||
// @hastext - '<span class="attribute">#[<span class="ident">outer</span>]</span>'
|
||||
// @hastext - '<span class="attribute">#![<span class="ident">inner</span>]</span>'
|
||||
// @hasraw - '# <span class="ident">single'
|
||||
// @hasraw - '## <span class="ident">double</span>'
|
||||
// @hasraw - '### <span class="ident">triple</span>'
|
||||
// @hasraw - '<span class="attribute">#[<span class="ident">outer</span>]</span>'
|
||||
// @hasraw - '<span class="attribute">#![<span class="ident">inner</span>]</span>'
|
||||
|
||||
/// ```no_run
|
||||
/// # # space
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#![no_core]
|
||||
#![feature(no_core)]
|
||||
|
||||
// @matchestext 'issue_89852/sidebar-items.js' '"repro"'
|
||||
// @matchesraw 'issue_89852/sidebar-items.js' '"repro"'
|
||||
// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"'
|
||||
|
||||
#[macro_export]
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
//!
|
||||
//! [foo]: url 'title & <stuff> & "things"'
|
||||
|
||||
// @hastext 'foo/index.html' 'title & <stuff> & "things"'
|
||||
// @hasraw 'foo/index.html' 'title & <stuff> & "things"'
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
//
|
||||
// compile-flags: --document-private-items
|
||||
|
||||
// @hastext macro_document_private_duplicate/index.html 'Doc 1.'
|
||||
// @hastext macro_document_private_duplicate/macro.a_macro.html 'Doc 1.'
|
||||
// @hasraw macro_document_private_duplicate/index.html 'Doc 1.'
|
||||
// @hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 1.'
|
||||
/// Doc 1.
|
||||
macro_rules! a_macro {
|
||||
() => ()
|
||||
}
|
||||
|
||||
// @hastext macro_document_private_duplicate/index.html 'Doc 2.'
|
||||
// @hasraw macro_document_private_duplicate/index.html 'Doc 2.'
|
||||
// @!has macro_document_private_duplicate/macro.a_macro.html 'Doc 2.'
|
||||
/// Doc 2.
|
||||
macro_rules! a_macro {
|
||||
|
|
|
@ -7,27 +7,27 @@
|
|||
// @has - '//span[@class="macro"]' 'macro_rules!'
|
||||
// @has - '//span[@class="ident"]' 'todo'
|
||||
|
||||
// @hastext - '{ () => { ... }; ($('
|
||||
// @hasraw - '{ () => { ... }; ($('
|
||||
// @has - '//span[@class="macro-nonterminal"]' '$'
|
||||
// @has - '//span[@class="macro-nonterminal"]' 'arg'
|
||||
// @hastext - ':'
|
||||
// @hasraw - ':'
|
||||
// @has - '//span[@class="ident"]' 'tt'
|
||||
// @hastext - ')+'
|
||||
// @hastext - ') => { ... }; }'
|
||||
// @hasraw - ')+'
|
||||
// @hasraw - ') => { ... }; }'
|
||||
pub use std::todo;
|
||||
|
||||
mod mod1 {
|
||||
// @has 'foo/macro.macro1.html'
|
||||
// @hastext - 'macro_rules!'
|
||||
// @hastext - 'macro1'
|
||||
// @hastext - '{ () => { ... }; ($('
|
||||
// @hasraw - 'macro_rules!'
|
||||
// @hasraw - 'macro1'
|
||||
// @hasraw - '{ () => { ... }; ($('
|
||||
// @has - '//span[@class="macro-nonterminal"]' '$'
|
||||
// @has - '//span[@class="macro-nonterminal"]' 'arg'
|
||||
// @hastext - ':'
|
||||
// @hastext - 'expr'
|
||||
// @hastext - '),'
|
||||
// @hastext - '+'
|
||||
// @hastext - ') => { ... }; }'
|
||||
// @hasraw - ':'
|
||||
// @hasraw - 'expr'
|
||||
// @hasraw - '),'
|
||||
// @hasraw - '+'
|
||||
// @hasraw - ') => { ... }; }'
|
||||
#[macro_export]
|
||||
macro_rules! macro1 {
|
||||
() => {};
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
//!
|
||||
//! [link]: https://example.com
|
||||
|
||||
// @hastext search-index.js 'This <em>summary</em> has a link and <code>code</code>.'
|
||||
// @hasraw search-index.js 'This <em>summary</em> has a link and <code>code</code>.'
|
||||
// @!has - 'second paragraph'
|
||||
|
||||
/// This `code` will be rendered in a code tag.
|
||||
|
@ -15,8 +15,8 @@
|
|||
/// This text should not be rendered.
|
||||
pub struct Sidebar;
|
||||
|
||||
// @hastext search-index.js 'This <code>code</code> will be rendered in a code tag.'
|
||||
// @hastext summaries/sidebar-items.js 'This `code` will be rendered in a code tag.'
|
||||
// @hasraw search-index.js 'This <code>code</code> will be rendered in a code tag.'
|
||||
// @hasraw summaries/sidebar-items.js 'This `code` will be rendered in a code tag.'
|
||||
// @!has - 'text should not be rendered'
|
||||
|
||||
/// ```text
|
||||
|
|
|
@ -7,11 +7,11 @@ mod a_module {
|
|||
|
||||
pub mod a_nested_module {
|
||||
// @has aCrate/a_nested_module/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function'
|
||||
// @hastext aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()'
|
||||
// @hasraw aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()'
|
||||
pub fn a_nested_public_function() {}
|
||||
|
||||
// @has aCrate/a_nested_module/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function'
|
||||
// @hastext aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()'
|
||||
// @hasraw aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()'
|
||||
pub use a_nested_module::a_nested_public_function as another_nested_public_function;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#![crate_name = "foo"]
|
||||
|
||||
// @hastext 'search-index.js' 'Foo short link.'
|
||||
// @hasraw 'search-index.js' 'Foo short link.'
|
||||
// @!has - 'www.example.com'
|
||||
// @!has - 'More Foo.'
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
use std::ops::Deref;
|
||||
|
||||
// @hastext search-index.js Foo
|
||||
// @hasraw search-index.js Foo
|
||||
pub use private::Foo;
|
||||
|
||||
mod private {
|
||||
pub struct Foo;
|
||||
impl Foo {
|
||||
pub fn test_method() {} // @hastext - test_method
|
||||
pub fn test_method() {} // @hasraw - test_method
|
||||
fn priv_method() {} // @!has - priv_method
|
||||
}
|
||||
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
// Test that the contents of constants are displayed as part of the
|
||||
// documentation.
|
||||
|
||||
// @hastext show_const_contents/constant.CONST_S.html 'show this'
|
||||
// @hasraw show_const_contents/constant.CONST_S.html 'show this'
|
||||
// @!has show_const_contents/constant.CONST_S.html '; //'
|
||||
pub const CONST_S: &'static str = "show this";
|
||||
|
||||
// @hastext show_const_contents/constant.CONST_I32.html '= 42;'
|
||||
// @hasraw show_const_contents/constant.CONST_I32.html '= 42;'
|
||||
// @!has show_const_contents/constant.CONST_I32.html '; //'
|
||||
pub const CONST_I32: i32 = 42;
|
||||
|
||||
// @hastext show_const_contents/constant.CONST_I32_HEX.html '= 0x42;'
|
||||
// @hasraw show_const_contents/constant.CONST_I32_HEX.html '= 0x42;'
|
||||
// @!has show_const_contents/constant.CONST_I32_HEX.html '; //'
|
||||
pub const CONST_I32_HEX: i32 = 0x42;
|
||||
|
||||
// @hastext show_const_contents/constant.CONST_NEG_I32.html '= -42;'
|
||||
// @hasraw show_const_contents/constant.CONST_NEG_I32.html '= -42;'
|
||||
// @!has show_const_contents/constant.CONST_NEG_I32.html '; //'
|
||||
pub const CONST_NEG_I32: i32 = -42;
|
||||
|
||||
// @hastext show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '= 42i32;'
|
||||
// @hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '= 42i32;'
|
||||
// @!has show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '// 42i32'
|
||||
pub const CONST_EQ_TO_VALUE_I32: i32 = 42i32;
|
||||
|
||||
// @hastext show_const_contents/constant.CONST_CALC_I32.html '= _; // 43i32'
|
||||
// @hasraw show_const_contents/constant.CONST_CALC_I32.html '= _; // 43i32'
|
||||
pub const CONST_CALC_I32: i32 = 42 + 1;
|
||||
|
||||
// @!has show_const_contents/constant.CONST_REF_I32.html '= &42;'
|
||||
// @!has show_const_contents/constant.CONST_REF_I32.html '; //'
|
||||
pub const CONST_REF_I32: &'static i32 = &42;
|
||||
|
||||
// @hastext show_const_contents/constant.CONST_I32_MAX.html '= i32::MAX; // 2_147_483_647i32'
|
||||
// @hasraw show_const_contents/constant.CONST_I32_MAX.html '= i32::MAX; // 2_147_483_647i32'
|
||||
pub const CONST_I32_MAX: i32 = i32::MAX;
|
||||
|
||||
// @!has show_const_contents/constant.UNIT.html '= ();'
|
||||
|
@ -47,11 +47,11 @@ pub struct MyTypeWithStr(&'static str);
|
|||
// @!has show_const_contents/constant.MY_TYPE_WITH_STR.html '; //'
|
||||
pub const MY_TYPE_WITH_STR: MyTypeWithStr = MyTypeWithStr("show this");
|
||||
|
||||
// @hastext show_const_contents/constant.PI.html '= 3.14159265358979323846264338327950288f32;'
|
||||
// @hastext show_const_contents/constant.PI.html '; // 3.14159274f32'
|
||||
// @hasraw show_const_contents/constant.PI.html '= 3.14159265358979323846264338327950288f32;'
|
||||
// @hasraw show_const_contents/constant.PI.html '; // 3.14159274f32'
|
||||
pub use std::f32::consts::PI;
|
||||
|
||||
// @hastext show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32'
|
||||
// @hasraw show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32'
|
||||
#[allow(deprecated, deprecated_in_future)]
|
||||
pub use std::i32::MAX;
|
||||
|
||||
|
@ -61,7 +61,7 @@ macro_rules! int_module {
|
|||
)
|
||||
}
|
||||
|
||||
// @hastext show_const_contents/constant.MIN.html '= i16::MIN; // -32_768i16'
|
||||
// @hasraw show_const_contents/constant.MIN.html '= i16::MIN; // -32_768i16'
|
||||
int_module!(i16);
|
||||
|
||||
// @has show_const_contents/constant.ESCAPE.html //pre '= r#"<script>alert("ESCAPE");</script>"#;'
|
||||
|
|
|
@ -9,5 +9,5 @@ pub mod module_c {}
|
|||
|
||||
pub mod module_a {}
|
||||
|
||||
// @matchestext 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a'
|
||||
// @matchestext 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"'
|
||||
// @matchesraw 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a'
|
||||
// @matchesraw 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#![crate_name = "foo"]
|
||||
|
||||
// @hastext source-files.js source-file.rs
|
||||
// @hasraw source-files.js source-file.rs
|
||||
|
||||
pub struct Foo;
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
// compile-flags:-Z unstable-options --static-root-path /cache/
|
||||
|
||||
// @has static_root_path/struct.SomeStruct.html
|
||||
// @matchestext - '"/cache/main\.js"'
|
||||
// @matchesraw - '"/cache/main\.js"'
|
||||
// @!matches - '"\.\./main\.js"'
|
||||
// @matchestext - 'data-root-path="\.\./"'
|
||||
// @matchesraw - 'data-root-path="\.\./"'
|
||||
// @!matches - '"/cache/search-index\.js"'
|
||||
pub struct SomeStruct;
|
||||
|
||||
// @has src/static_root_path/static-root-path.rs.html
|
||||
// @matchestext - '"/cache/source-script\.js"'
|
||||
// @matchesraw - '"/cache/source-script\.js"'
|
||||
// @!matches - '"\.\./\.\./source-script\.js"'
|
||||
// @matchestext - '"\.\./\.\./source-files.js"'
|
||||
// @matchesraw - '"\.\./\.\./source-files.js"'
|
||||
// @!matches - '"/cache/source-files\.js"'
|
||||
|
||||
// @has settings.html
|
||||
// @matchestext - '/cache/settings\.js'
|
||||
// @matchesraw - '/cache/settings\.js'
|
||||
// @!matches - '\./settings\.js'
|
||||
|
|
|
@ -1,84 +1,84 @@
|
|||
// compile-flags: --show-type-layout -Z unstable-options
|
||||
|
||||
// @hastext type_layout/struct.Foo.html 'Size: '
|
||||
// @hastext - ' bytes'
|
||||
// @hasraw type_layout/struct.Foo.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
// @has - '//*[@id="layout"]/a[@href="#layout"]' ''
|
||||
pub struct Foo {
|
||||
pub a: usize,
|
||||
b: Vec<String>,
|
||||
}
|
||||
|
||||
// @hastext type_layout/enum.Bar.html 'Size: '
|
||||
// @hastext - ' bytes'
|
||||
// @hasraw type_layout/enum.Bar.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub enum Bar<'a> {
|
||||
A(String),
|
||||
B(&'a str, (std::collections::HashMap<String, usize>, Foo)),
|
||||
}
|
||||
|
||||
// @hastext type_layout/union.Baz.html 'Size: '
|
||||
// @hastext - ' bytes'
|
||||
// @hasraw type_layout/union.Baz.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub union Baz {
|
||||
a: &'static str,
|
||||
b: usize,
|
||||
c: &'static [u8],
|
||||
}
|
||||
|
||||
// @hastext type_layout/struct.X.html 'Size: '
|
||||
// @hastext - ' bytes'
|
||||
// @hasraw type_layout/struct.X.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub struct X(usize);
|
||||
|
||||
// @hastext type_layout/struct.Y.html 'Size: '
|
||||
// @hastext - '1 byte'
|
||||
// @hasraw type_layout/struct.Y.html 'Size: '
|
||||
// @hasraw - '1 byte'
|
||||
// @!has - ' bytes'
|
||||
pub struct Y(u8);
|
||||
|
||||
// @hastext type_layout/struct.Z.html 'Size: '
|
||||
// @hastext - '0 bytes'
|
||||
// @hasraw type_layout/struct.Z.html 'Size: '
|
||||
// @hasraw - '0 bytes'
|
||||
pub struct Z;
|
||||
|
||||
// We can't compute layout for generic types.
|
||||
// @hastext type_layout/struct.Generic.html 'Unable to compute type layout, possibly due to this type having generic parameters'
|
||||
// @hasraw type_layout/struct.Generic.html 'Unable to compute type layout, possibly due to this type having generic parameters'
|
||||
// @!has - 'Size: '
|
||||
pub struct Generic<T>(T);
|
||||
|
||||
// We *can*, however, compute layout for types that are only generic over lifetimes,
|
||||
// because lifetimes are a type-system construct.
|
||||
// @hastext type_layout/struct.GenericLifetimes.html 'Size: '
|
||||
// @hastext - ' bytes'
|
||||
// @hasraw type_layout/struct.GenericLifetimes.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub struct GenericLifetimes<'a>(&'a str);
|
||||
|
||||
// @hastext type_layout/struct.Unsized.html 'Size: '
|
||||
// @hastext - '(unsized)'
|
||||
// @hasraw type_layout/struct.Unsized.html 'Size: '
|
||||
// @hasraw - '(unsized)'
|
||||
pub struct Unsized([u8]);
|
||||
|
||||
// @hastext type_layout/type.TypeAlias.html 'Size: '
|
||||
// @hastext - ' bytes'
|
||||
// @hasraw type_layout/type.TypeAlias.html 'Size: '
|
||||
// @hasraw - ' bytes'
|
||||
pub type TypeAlias = X;
|
||||
|
||||
// @hastext type_layout/type.GenericTypeAlias.html 'Size: '
|
||||
// @hastext - '8 bytes'
|
||||
// @hasraw type_layout/type.GenericTypeAlias.html 'Size: '
|
||||
// @hasraw - '8 bytes'
|
||||
pub type GenericTypeAlias = (Generic<(u32, ())>, Generic<u32>);
|
||||
|
||||
// Regression test for the rustdoc equivalent of #85103.
|
||||
// @hastext type_layout/type.Edges.html 'Encountered an error during type layout; the type failed to be normalized.'
|
||||
// @hasraw type_layout/type.Edges.html 'Encountered an error during type layout; the type failed to be normalized.'
|
||||
pub type Edges<'a, E> = std::borrow::Cow<'a, [E]>;
|
||||
|
||||
// @!has type_layout/trait.MyTrait.html 'Size: '
|
||||
pub trait MyTrait {}
|
||||
|
||||
// @hastext type_layout/enum.Variants.html 'Size: '
|
||||
// @hastext - '2 bytes'
|
||||
// @hastext - '<code>A</code>: 0 bytes'
|
||||
// @hastext - '<code>B</code>: 1 byte'
|
||||
// @hasraw type_layout/enum.Variants.html 'Size: '
|
||||
// @hasraw - '2 bytes'
|
||||
// @hasraw - '<code>A</code>: 0 bytes'
|
||||
// @hasraw - '<code>B</code>: 1 byte'
|
||||
pub enum Variants {
|
||||
A,
|
||||
B(u8),
|
||||
}
|
||||
|
||||
// @hastext type_layout/enum.WithNiche.html 'Size: '
|
||||
// @hasraw type_layout/enum.WithNiche.html 'Size: '
|
||||
// @has - //p '4 bytes'
|
||||
// @hastext - '<code>None</code>: 0 bytes'
|
||||
// @hastext - '<code>Some</code>: 4 bytes'
|
||||
// @hasraw - '<code>None</code>: 0 bytes'
|
||||
// @hasraw - '<code>Some</code>: 4 bytes'
|
||||
pub enum WithNiche {
|
||||
None,
|
||||
Some(std::num::NonZeroU32),
|
||||
|
|
|
@ -11,7 +11,7 @@ impl MyStruct {
|
|||
// @has typedef/type.MyAlias.html
|
||||
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'impl MyAlias'
|
||||
// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'impl MyTrait for MyAlias'
|
||||
// @hastext - 'Alias docstring'
|
||||
// @hasraw - 'Alias docstring'
|
||||
// @has - '//*[@class="sidebar"]//*[@class="location"]' 'MyAlias'
|
||||
// @has - '//*[@class="sidebar"]//a[@href="#implementations"]' 'Methods'
|
||||
// @has - '//*[@class="sidebar"]//a[@href="#trait-implementations"]' 'Trait Implementations'
|
||||
|
|
|
@ -5,15 +5,15 @@ use std::borrow::Borrow;
|
|||
|
||||
// @has foo/fn.foo.html
|
||||
// @has - //pre 'foo('
|
||||
// @matchestext - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"'
|
||||
// @matchestext - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html'
|
||||
// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"'
|
||||
// @matchesraw - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html'
|
||||
pub fn foo(_x: impl Clone, _y: i32, _z: (impl Copy, impl Clone)) {
|
||||
}
|
||||
|
||||
pub trait Trait {
|
||||
// @has foo/trait.Trait.html
|
||||
// @hastext - 'method</a>('
|
||||
// @matchestext - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
|
||||
// @hasraw - 'method</a>('
|
||||
// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
|
||||
fn method(&self, _x: impl std::fmt::Debug) {
|
||||
}
|
||||
}
|
||||
|
@ -22,30 +22,30 @@ pub struct S<T>(T);
|
|||
|
||||
impl<T> S<T> {
|
||||
// @has foo/struct.S.html
|
||||
// @hastext - 'bar</a>('
|
||||
// @matchestext - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"'
|
||||
// @hasraw - 'bar</a>('
|
||||
// @matchesraw - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"'
|
||||
pub fn bar(_bar: impl Copy) {
|
||||
}
|
||||
|
||||
// @hastext - 'baz</a>('
|
||||
// @matchestext - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html'
|
||||
// @hasraw - 'baz</a>('
|
||||
// @matchesraw - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html'
|
||||
pub fn baz(_baz: S<impl Clone>) {
|
||||
}
|
||||
|
||||
// @hastext - 'qux</a>('
|
||||
// @matchestext - 'trait\.Read\.html'
|
||||
// @hasraw - 'qux</a>('
|
||||
// @matchesraw - 'trait\.Read\.html'
|
||||
pub fn qux(_qux: impl IntoIterator<Item = S<impl Read>>) {
|
||||
}
|
||||
}
|
||||
|
||||
// @hastext - 'method</a>('
|
||||
// @matchestext - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
|
||||
// @hasraw - 'method</a>('
|
||||
// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
|
||||
impl<T> Trait for S<T> {}
|
||||
|
||||
// @has foo/fn.much_universe.html
|
||||
// @matchestext - 'T:.+Borrow.+impl .+trait\.Trait\.html'
|
||||
// @matchestext - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html'
|
||||
// @matchestext - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
|
||||
// @matchesraw - 'T:.+Borrow.+impl .+trait\.Trait\.html'
|
||||
// @matchesraw - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html'
|
||||
// @matchesraw - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
|
||||
pub fn much_universe<
|
||||
T: Borrow<impl Trait>,
|
||||
U: IntoIterator<Item = impl Iterator<Item = impl Clone>>,
|
||||
|
|
Loading…
Add table
Reference in a new issue