Skip to content

Commit b232c46

Browse files
authored
Rollup merge of #93339 - notriddle:notriddle/test-generics-multi-trait, r=GuillaumeGomez
rustdoc: add test case for multiple traits and erased names #92339 (comment)
2 parents 6caa533 + f5cdfb4 commit b232c46

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// exact-check
2+
3+
const QUERY = [
4+
'Result<SomeTrait>',
5+
'Zzzzzzzzzzzzzzzzzz',
6+
'Nonononononononono',
7+
];
8+
9+
const EXPECTED = [
10+
// check one of the generic items
11+
{
12+
'in_args': [
13+
{ 'path': 'generics_multi_trait', 'name': 'beta' },
14+
],
15+
'returned': [
16+
{ 'path': 'generics_multi_trait', 'name': 'bet' },
17+
],
18+
},
19+
{
20+
'in_args': [
21+
{ 'path': 'generics_multi_trait', 'name': 'beta' },
22+
],
23+
'returned': [
24+
{ 'path': 'generics_multi_trait', 'name': 'bet' },
25+
],
26+
},
27+
// ignore the name of the generic itself
28+
{
29+
'in_args': [],
30+
'returned': [],
31+
},
32+
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
pub trait SomeTrait {}
2+
pub trait Zzzzzzzzzzzzzzzzzz {}
3+
4+
pub fn bet<Nonononononononono: SomeTrait + Zzzzzzzzzzzzzzzzzz>() -> Result<Nonononononononono, ()> {
5+
loop {}
6+
}
7+
8+
pub fn beta<Nonononononononono: SomeTrait + Zzzzzzzzzzzzzzzzzz>(
9+
_param: Result<Nonononononononono, ()>,
10+
) {
11+
loop {}
12+
}

0 commit comments

Comments
 (0)