-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #59622 - GuillaumeGomez:improve-one-char-search, r=Quie…
…tMisdreavus Ensure that exact matches come first in rustdoc search Fixes #59287. cc @scottmcm r? @QuietMisdreavus
- Loading branch information
Showing
3 changed files
with
83 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const QUERY = 'P'; | ||
|
||
const EXPECTED = { | ||
'others': [ | ||
{ 'path': 'search_short_types', 'name': 'P' }, | ||
{ 'path': 'search_short_types', 'name': 'Ap' }, | ||
], | ||
}; |
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; |