Add regression test for #115480
This commit is contained in:
parent
a314707867
commit
efac0b9c02
15
tests/rustdoc-js/auxiliary/equivalent.rs
Normal file
15
tests/rustdoc-js/auxiliary/equivalent.rs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
use std::borrow::Borrow;
|
||||||
|
|
||||||
|
pub trait Equivalent<K: ?Sized> {
|
||||||
|
fn equivalent(&self, key: &K) -> bool;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<Q: ?Sized, K: ?Sized> Equivalent<K> for Q
|
||||||
|
where
|
||||||
|
Q: Eq,
|
||||||
|
K: Borrow<Q>,
|
||||||
|
{
|
||||||
|
fn equivalent(&self, key: &K) -> bool {
|
||||||
|
PartialEq::eq(self, key.borrow())
|
||||||
|
}
|
||||||
|
}
|
9
tests/rustdoc-js/search-non-local-trait-impl.js
Normal file
9
tests/rustdoc-js/search-non-local-trait-impl.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// exact-check
|
||||||
|
|
||||||
|
// This test ensures that methods from blanket impls of not available foreign traits
|
||||||
|
// don't show up in the search results.
|
||||||
|
|
||||||
|
const EXPECTED = {
|
||||||
|
'query': 'equivalent',
|
||||||
|
'others': [],
|
||||||
|
};
|
8
tests/rustdoc-js/search-non-local-trait-impl.rs
Normal file
8
tests/rustdoc-js/search-non-local-trait-impl.rs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// aux-crate:priv:equivalent=equivalent.rs
|
||||||
|
// compile-flags: -Zunstable-options --extern equivalent
|
||||||
|
// edition:2018
|
||||||
|
|
||||||
|
extern crate equivalent;
|
||||||
|
|
||||||
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||||
|
pub struct LayoutError;
|
Loading…
Reference in New Issue
Block a user