Rollup merge of #134277 - notriddle:notriddle/inline-into, r=GuillaumeGomez
rustdoc-search: handle `impl Into<X>` better This PR fixes two bugs I ran into while searching the compiler docs: - It omitted an `impl Trait` entry in the type signature field, producing `TyCtxt, , Symbol -> bool` - It didn't let me search for `TyCtxt, DefId, Symbol -> bool` even though that's a perfectly good description of the function I was looking for (the function actually used `impl Into<DefId>` r? ``@GuillaumeGomez`` cc ``@lolbinarycat``
This commit is contained in:
commit
d9ba4bf6fe
5 changed files with 72 additions and 8 deletions
35
tests/rustdoc-js/impl-trait-inlining.js
Normal file
35
tests/rustdoc-js/impl-trait-inlining.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
// exact-check
|
||||
// ignore-order
|
||||
|
||||
const EXPECTED = [
|
||||
{
|
||||
'query': 'tyctxt, symbol -> bool',
|
||||
'others': [
|
||||
{
|
||||
'path': 'foo::TyCtxt',
|
||||
'name': 'has_attr',
|
||||
'displayType': "`TyCtxt`, Into<DefId>, `Symbol` -> `bool`",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'tyctxt, into<defid>, symbol -> bool',
|
||||
'others': [
|
||||
{
|
||||
'path': 'foo::TyCtxt',
|
||||
'name': 'has_attr',
|
||||
'displayType': "`TyCtxt`, `Into`<`DefId`>, `Symbol` -> `bool`",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
'query': 'tyctxt, defid, symbol -> bool',
|
||||
'others': [
|
||||
{
|
||||
'path': 'foo::TyCtxt',
|
||||
'name': 'has_attr',
|
||||
'displayType': "`TyCtxt`, Into<`DefId`>, `Symbol` -> `bool`",
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
11
tests/rustdoc-js/impl-trait-inlining.rs
Normal file
11
tests/rustdoc-js/impl-trait-inlining.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
#![crate_name = "foo"]
|
||||
|
||||
pub struct TyCtxt;
|
||||
pub struct DefId;
|
||||
pub struct Symbol;
|
||||
|
||||
impl TyCtxt {
|
||||
pub fn has_attr(self, _did: impl Into<DefId>, _attr: Symbol) -> bool {
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue