Skip to content

Commit 775ce97

Browse files
committed
Auto merge of #51592 - GuillaumeGomez:fix-macro-doc-search, r=GuillaumeGomez
Fix macro missing from doc search Fixes #51095. r? @QuietMisdreavus
2 parents 57dd722 + e3b2583 commit 775ce97

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

Diff for: src/librustdoc/html/static/main.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,8 @@
465465
var res = buildHrefAndPath(obj);
466466
obj.displayPath = pathSplitter(res[0]);
467467
obj.fullPath = obj.displayPath + obj.name;
468-
if (obj.ty === TY_KEYWORD) {
469-
// To be sure than it isn't considered as duplicate with items.
470-
obj.fullPath += '|k';
471-
}
468+
// To be sure than it some items aren't considered as duplicate.
469+
obj.fullPath += '|' + obj.ty;
472470
obj.href = res[1];
473471
out.push(obj);
474472
if (out.length >= MAX_RESULTS) {

Diff for: src/test/rustdoc-js/macro-check.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// ignore-order
12+
13+
const QUERY = 'panic';
14+
15+
const EXPECTED = {
16+
'others': [
17+
{ 'path': 'std', 'name': 'panic', ty: 14 }, // 15 is for macros
18+
{ 'path': 'std', 'name': 'panic', ty: 0 }, // 0 is for modules
19+
],
20+
};

0 commit comments

Comments
 (0)