Skip to content

Commit 4720462

Browse files
committed
Add a test for #2200
1 parent 426ba1c commit 4720462

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

tests/source/chains.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,24 @@ fn issue2126() {
185185
}
186186
}
187187
}
188+
189+
// #2200
190+
impl Foo {
191+
pub fn from_ast(diagnostic: &::errors::Handler,
192+
attrs: &[ast::Attribute]) -> Attributes {
193+
let other_attrs = attrs.iter().filter_map(|attr| {
194+
attr.with_desugared_doc(|attr| {
195+
if attr.check_name("doc") {
196+
if let Some(mi) = attr.meta() {
197+
if let Some(value) = mi.value_str() {
198+
doc_strings.push(DocFragment::Include(line,
199+
attr.span,
200+
filename,
201+
contents));
202+
}
203+
}
204+
}
205+
})
206+
}).collect();
207+
}
208+
}

tests/target/chains.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,25 @@ fn issue2126() {
213213
}
214214
}
215215
}
216+
217+
// #2200
218+
impl Foo {
219+
pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
220+
let other_attrs = attrs
221+
.iter()
222+
.filter_map(|attr| {
223+
attr.with_desugared_doc(|attr| {
224+
if attr.check_name("doc") {
225+
if let Some(mi) = attr.meta() {
226+
if let Some(value) = mi.value_str() {
227+
doc_strings.push(
228+
DocFragment::Include(line, attr.span, filename, contents),
229+
);
230+
}
231+
}
232+
}
233+
})
234+
})
235+
.collect();
236+
}
237+
}

0 commit comments

Comments
 (0)