From 4720462e6761306a72de1f62523d72698d4e77c9 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Wed, 29 Nov 2017 12:34:09 +0900 Subject: [PATCH] Add a test for #2200 --- tests/source/chains.rs | 21 +++++++++++++++++++++ tests/target/chains.rs | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/tests/source/chains.rs b/tests/source/chains.rs index f14a0293123..0141326269b 100644 --- a/tests/source/chains.rs +++ b/tests/source/chains.rs @@ -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(); + } +} diff --git a/tests/target/chains.rs b/tests/target/chains.rs index 00855de4f98..a88440a9d78 100644 --- a/tests/target/chains.rs +++ b/tests/target/chains.rs @@ -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(); + } +}