Skip to content

Commit ae7fca1

Browse files
committed
Check for doc(inline) instead of .*(inline)
1 parent 8f0479b commit ae7fca1

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

src/librustdoc/visit_ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,10 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
276276
let node = if item.vis == hir::Public {
277277
let please_inline = item.attrs.iter().any(|item| {
278278
match item.meta_item_list() {
279-
Some(list) => {
279+
Some(list) if &item.name()[..] == "doc" => {
280280
list.iter().any(|i| &i.name()[..] == "inline")
281281
}
282-
None => false,
282+
_ => false,
283283
}
284284
});
285285
match self.visit_view_path(node, om, item.id, please_inline) {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2016 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+
pub mod foo {
12+
pub struct Foo;
13+
}
14+
15+
// @has please_inline/a/index.html
16+
pub mod a {
17+
// @!has - 'pub use foo::'
18+
// @has please_inline/a/struct.Foo.html
19+
#[doc(inline)]
20+
pub use foo::Foo;
21+
}
22+
23+
// @has please_inline/b/index.html
24+
pub mod b {
25+
// @has - 'pub use foo::'
26+
// @!has please_inline/b/struct.Foo.html
27+
#[feature(inline)]
28+
pub use foo::Foo;
29+
}

0 commit comments

Comments
 (0)