From 5c99d6c6bc79b87863e02bc130d5b00f3daf6ad5 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Tue, 25 Jul 2017 00:56:09 +0900 Subject: [PATCH] Update tests --- tests/source/attrib.rs | 17 +++++++++++++++++ tests/source/issue-1800.rs | 3 +++ tests/target/attrib.rs | 17 +++++++++++++++++ tests/target/comment4.rs | 4 ++-- tests/target/issue-1800.rs | 3 +++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 tests/source/issue-1800.rs create mode 100644 tests/target/issue-1800.rs diff --git a/tests/source/attrib.rs b/tests/source/attrib.rs index 361d9fb784c..beabed88510 100644 --- a/tests/source/attrib.rs +++ b/tests/source/attrib.rs @@ -91,3 +91,20 @@ fn issue_1799() { // https://github.com/rust-lang/rust/issues/43336 Some( Err(error) ) ; } + +// Formatting inner attributes +fn inner_attributes() { + #![ this_is_an_inner_attribute ( foo ) ] + + foo(); +} + +impl InnerAttributes() { + #![ this_is_an_inner_attribute ( foo ) ] + + fn foo() {} +} + +mod InnerAttributes { + #![ this_is_an_inner_attribute ( foo ) ] +} diff --git a/tests/source/issue-1800.rs b/tests/source/issue-1800.rs new file mode 100644 index 00000000000..eae22653258 --- /dev/null +++ b/tests/source/issue-1800.rs @@ -0,0 +1,3 @@ +#![doc(html_root_url = "http://example.com")] +#[cfg(feature = "foo")] +fn a() {} diff --git a/tests/target/attrib.rs b/tests/target/attrib.rs index 7ff79b16411..43283d2db05 100644 --- a/tests/target/attrib.rs +++ b/tests/target/attrib.rs @@ -91,3 +91,20 @@ fn issue_1799() { // https://github.com/rust-lang/rust/issues/43336 Some(Err(error)); } + +// Formatting inner attributes +fn inner_attributes() { + #![this_is_an_inner_attribute(foo)] + + foo(); +} + +impl InnerAttributes() { + #![this_is_an_inner_attribute(foo)] + + fn foo() {} +} + +mod InnerAttributes { + #![this_is_an_inner_attribute(foo)] +} diff --git a/tests/target/comment4.rs b/tests/target/comment4.rs index 2916f083ca0..516b78c4ec4 100644 --- a/tests/target/comment4.rs +++ b/tests/target/comment4.rs @@ -1,5 +1,5 @@ -#![allow(dead_code)] // bar - +#![allow(dead_code)] +// bar //! Doc comment fn test() { // comment diff --git a/tests/target/issue-1800.rs b/tests/target/issue-1800.rs new file mode 100644 index 00000000000..06c5cfd0567 --- /dev/null +++ b/tests/target/issue-1800.rs @@ -0,0 +1,3 @@ +#![doc(html_root_url = "http://example.com")] +#[cfg(feature = "foo")] +fn a() {} -- 2.44.0