Add a test for #2200

This commit is contained in:
topecongiro 2017-11-29 12:34:09 +09:00
parent 426ba1cdab
commit 4720462e67
2 changed files with 43 additions and 0 deletions

View File

@ -185,3 +185,24 @@ fn issue2126() {
}
}
}
// #2200
impl Foo {
pub fn from_ast(diagnostic: &::errors::Handler,
attrs: &[ast::Attribute]) -> Attributes {
let other_attrs = attrs.iter().filter_map(|attr| {
attr.with_desugared_doc(|attr| {
if attr.check_name("doc") {
if let Some(mi) = attr.meta() {
if let Some(value) = mi.value_str() {
doc_strings.push(DocFragment::Include(line,
attr.span,
filename,
contents));
}
}
}
})
}).collect();
}
}

View File

@ -213,3 +213,25 @@ fn issue2126() {
}
}
}
// #2200
impl Foo {
pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
let other_attrs = attrs
.iter()
.filter_map(|attr| {
attr.with_desugared_doc(|attr| {
if attr.check_name("doc") {
if let Some(mi) = attr.meta() {
if let Some(value) = mi.value_str() {
doc_strings.push(
DocFragment::Include(line, attr.span, filename, contents),
);
}
}
}
})
})
.collect();
}
}