Skip to content

Commit

Permalink
Add test for Self not being a generic in search index
Browse files Browse the repository at this point in the history
  • Loading branch information
camelid committed Aug 1, 2024
1 parent 94e4025 commit 1543c38
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/rustdoc-js/self-is-not-generic.js
Original file line number Diff line number Diff line change
@@ -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' }
],
}
];
11 changes: 11 additions & 0 deletions tests/rustdoc-js/self-is-not-generic.rs
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit 1543c38

Please sign in to comment.