rustdoc: add test case for multiple traits and erased names

https://github.com/rust-lang/rust/pull/92339#discussion_r792805289
This commit is contained in:
Michael Howell 2022-01-26 09:24:36 -07:00
parent a7f375789b
commit f5cdfb47e5
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,32 @@
// exact-check
const QUERY = [
'Result<SomeTrait>',
'Zzzzzzzzzzzzzzzzzz',
'Nonononononononono',
];
const EXPECTED = [
// check one of the generic items
{
'in_args': [
{ 'path': 'generics_multi_trait', 'name': 'beta' },
],
'returned': [
{ 'path': 'generics_multi_trait', 'name': 'bet' },
],
},
{
'in_args': [
{ 'path': 'generics_multi_trait', 'name': 'beta' },
],
'returned': [
{ 'path': 'generics_multi_trait', 'name': 'bet' },
],
},
// ignore the name of the generic itself
{
'in_args': [],
'returned': [],
},
];

View File

@ -0,0 +1,12 @@
pub trait SomeTrait {}
pub trait Zzzzzzzzzzzzzzzzzz {}
pub fn bet<Nonononononononono: SomeTrait + Zzzzzzzzzzzzzzzzzz>() -> Result<Nonononononononono, ()> {
loop {}
}
pub fn beta<Nonononononononono: SomeTrait + Zzzzzzzzzzzzzzzzzz>(
_param: Result<Nonononononononono, ()>,
) {
loop {}
}