forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#64094 - kawa-yoiko:rustdoc-search, r=Guilla…
…umeGomez Improve searching in rustdoc and add tests 👋 I have made searching in rustdoc more intuitive, added a couple more tests and made a little shell script to aid testing. Closes rust-lang#63005. It took me quite a while to figure out how to run the tests for rustdoc (instead of running tests for other crates with rustdoc); the only pointer I found was [hidden in the rustc book](https://rust-lang.github.io/rustc-guide/rustdoc.html#cheat-sheet). Maybe this could be better documented? I shall be delighted to help if it is desirable.
- Loading branch information
Showing
8 changed files
with
169 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const QUERY = 'si::pc'; | ||
|
||
const EXPECTED = { | ||
'others': [ | ||
{ 'path': 'exact_match::Si', 'name': 'pc' }, | ||
{ 'path': 'exact_match::Psi', 'name': 'pc' }, | ||
{ 'path': 'exact_match::Si', 'name': 'pa' }, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
macro_rules! imp { | ||
($name:ident) => { | ||
pub struct $name { | ||
pub op: usize, | ||
} | ||
impl $name { | ||
pub fn op() {} | ||
pub fn cmp() {} | ||
pub fn map() {} | ||
pub fn pop() {} | ||
pub fn ptr() {} | ||
pub fn rpo() {} | ||
pub fn drop() {} | ||
pub fn copy() {} | ||
pub fn zip() {} | ||
pub fn sup() {} | ||
pub fn pa() {} | ||
pub fn pb() {} | ||
pub fn pc() {} | ||
pub fn pd() {} | ||
pub fn pe() {} | ||
pub fn pf() {} | ||
pub fn pg() {} | ||
pub fn ph() {} | ||
pub fn pi() {} | ||
pub fn pj() {} | ||
pub fn pk() {} | ||
pub fn pl() {} | ||
pub fn pm() {} | ||
pub fn pn() {} | ||
pub fn po() {} | ||
} | ||
}; | ||
($name:ident, $($names:ident),*) => { | ||
imp!($name); | ||
imp!($($names),*); | ||
}; | ||
} | ||
macro_rules! en { | ||
($name:ident) => { | ||
pub enum $name { | ||
Ptr, | ||
Rp, | ||
Rpo, | ||
Pt, | ||
Drop, | ||
Dr, | ||
Dro, | ||
Sup, | ||
Op, | ||
Cmp, | ||
Map, | ||
Mp, | ||
} | ||
}; | ||
($name:ident, $($names:ident),*) => { | ||
en!($name); | ||
en!($($names),*); | ||
}; | ||
} | ||
|
||
imp!(Ot, Foo, Cmp, Map, Loc, Lac, Toc, Si, Sig, Sip, Psy, Psi, Py, Pi, Pa, Pb, Pc, Pd); | ||
imp!(Pe, Pf, Pg, Ph, Pj, Pk, Pl, Pm, Pn, Po, Pq, Pr, Ps, Pt, Pu, Pv, Pw, Px, Pz, Ap, Bp, Cp); | ||
imp!(Dp, Ep, Fp, Gp, Hp, Ip, Jp, Kp, Lp, Mp, Np, Op, Pp, Qp, Rp, Sp, Tp, Up, Vp, Wp, Xp, Yp, Zp); | ||
|
||
en!(Place, Plac, Plae, Plce, Pace, Scalar, Scalr, Scaar, Sclar, Salar); | ||
|
||
pub struct P; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const QUERY = 'ig::pc'; | ||
|
||
const EXPECTED = { | ||
'others': [ | ||
{ 'path': 'module_substring::Sig', 'name': 'pc' }, | ||
{ 'path': 'module_substring::Si', 'name': 'pc' }, | ||
{ 'path': 'module_substring::Si', 'name': 'pa' }, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
macro_rules! imp { | ||
($name:ident) => { | ||
pub struct $name { | ||
pub op: usize, | ||
} | ||
impl $name { | ||
pub fn op() {} | ||
pub fn cmp() {} | ||
pub fn map() {} | ||
pub fn pop() {} | ||
pub fn ptr() {} | ||
pub fn rpo() {} | ||
pub fn drop() {} | ||
pub fn copy() {} | ||
pub fn zip() {} | ||
pub fn sup() {} | ||
pub fn pa() {} | ||
pub fn pb() {} | ||
pub fn pc() {} | ||
pub fn pd() {} | ||
pub fn pe() {} | ||
pub fn pf() {} | ||
pub fn pg() {} | ||
pub fn ph() {} | ||
pub fn pi() {} | ||
pub fn pj() {} | ||
pub fn pk() {} | ||
pub fn pl() {} | ||
pub fn pm() {} | ||
pub fn pn() {} | ||
pub fn po() {} | ||
} | ||
}; | ||
($name:ident, $($names:ident),*) => { | ||
imp!($name); | ||
imp!($($names),*); | ||
}; | ||
} | ||
macro_rules! en { | ||
($name:ident) => { | ||
pub enum $name { | ||
Ptr, | ||
Rp, | ||
Rpo, | ||
Pt, | ||
Drop, | ||
Dr, | ||
Dro, | ||
Sup, | ||
Op, | ||
Cmp, | ||
Map, | ||
Mp, | ||
} | ||
}; | ||
($name:ident, $($names:ident),*) => { | ||
en!($name); | ||
en!($($names),*); | ||
}; | ||
} | ||
|
||
imp!(Ot, Foo, Cmp, Map, Loc, Lac, Toc, Si, Sig, Sip, Psy, Psi, Py, Pi, Pa, Pb, Pc, Pd); | ||
imp!(Pe, Pf, Pg, Ph, Pj, Pk, Pl, Pm, Pn, Po, Pq, Pr, Ps, Pt, Pu, Pv, Pw, Px, Pz, Ap, Bp, Cp); | ||
imp!(Dp, Ep, Fp, Gp, Hp, Ip, Jp, Kp, Lp, Mp, Np, Op, Pp, Qp, Rp, Sp, Tp, Up, Vp, Wp, Xp, Yp, Zp); | ||
|
||
en!(Place, Plac, Plae, Plce, Pace, Scalar, Scalr, Scaar, Sclar, Salar); | ||
|
||
pub struct P; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters