Add test for Self not being a generic in search index

This commit is contained in:
Noah Lev 2024-07-31 20:13:17 -07:00
parent b4f77df9f8
commit dac7f20e13
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,22 @@
// exact-check
const EXPECTED = [
{
'query': 'A -> A',
'others': [
{ 'path': 'self_is_not_generic::Thing', 'name': 'from' }
],
},
{
'query': 'A -> B',
'others': [
{ 'path': 'self_is_not_generic::Thing', 'name': 'try_from' }
],
},
{
'query': 'Combine -> Combine',
'others': [
{ 'path': 'self_is_not_generic::Combine', 'name': 'combine' }
],
}
];

View File

@ -0,0 +1,11 @@
pub trait Combine {
fn combine(&self, other: &Self) -> Self;
}
pub struct Thing;
impl Combine for Thing {
fn combine(&self, other: &Self) -> Self {
Self
}
}