From: Seiichi Uchida Date: Mon, 24 Jul 2017 15:56:09 +0000 (+0900) Subject: Update tests X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=5c99d6c6bc79b87863e02bc130d5b00f3daf6ad5;p=rust.git Update tests --- 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() {}