Skip to content

Commit e18d7a3

Browse files
Add regression test for #115480
1 parent 6e0b21f commit e18d7a3

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use std::borrow::Borrow;
2+
3+
pub trait Equivalent<K: ?Sized> {
4+
fn equivalent(&self, key: &K) -> bool;
5+
}
6+
7+
impl<Q: ?Sized, K: ?Sized> Equivalent<K> for Q
8+
where
9+
Q: Eq,
10+
K: Borrow<Q>,
11+
{
12+
fn equivalent(&self, key: &K) -> bool {
13+
PartialEq::eq(self, key.borrow())
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// exact-check
2+
3+
// This test ensures that methods from blanket impls of not available foreign traits
4+
// don't show up in the search results.
5+
6+
const EXPECTED = {
7+
'query': 'equivalent',
8+
'others': [],
9+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// aux-build:equivalent.rs
2+
3+
#[derive(Clone, PartialEq, Eq, Debug)]
4+
pub struct LayoutError;

0 commit comments

Comments
 (0)