1
Fork 0

Rollup merge of #32434 - mitaa:rdoc-no-inline, r=alexcrichton

rustdoc: Consider `doc(no_inline)` in crate-local inlining

Imports with `doc(no_inline)` will not be inlined, even when `doc(inline)` is present.

fixes #32343

r? @alexcrichton
This commit is contained in:
Eduard-Mihai Burtescu 2016-03-23 17:59:16 +02:00
commit 2acad9c17e
7 changed files with 48 additions and 11 deletions

View file

@ -418,7 +418,7 @@ impl Clean<Item> for doctree::Module {
pub trait Attributes {
fn has_word(&self, &str) -> bool;
fn value<'a>(&'a self, &str) -> Option<&'a str>;
fn list_def<'a>(&'a self, &str) -> &'a [Attribute];
fn list<'a>(&'a self, &str) -> &'a [Attribute];
}
impl Attributes for [Attribute] {
@ -447,7 +447,7 @@ impl Attributes for [Attribute] {
}
/// Finds an attribute as List and returns the list of attributes nested inside.
fn list_def<'a>(&'a self, name: &str) -> &'a [Attribute] {
fn list<'a>(&'a self, name: &str) -> &'a [Attribute] {
for attr in self {
if let List(ref x, ref list) = *attr {
if name == *x {
@ -1535,7 +1535,7 @@ impl PrimitiveType {
}
fn find(attrs: &[Attribute]) -> Option<PrimitiveType> {
for attr in attrs.list_def("doc") {
for attr in attrs.list("doc") {
if let NameValue(ref k, ref v) = *attr {
if "primitive" == *k {
if let ret@Some(..) = PrimitiveType::from_str(v) {