aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/test_data/parser/ok/0045_block_attrs.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-19 15:37:54 +0100
committerGitHub <[email protected]>2021-04-19 15:37:54 +0100
commit6877e6e4da08570ca4fa245306ebc6725e861ab5 (patch)
tree40900502c52e16ad54cf558255a4acce539541a4 /crates/syntax/test_data/parser/ok/0045_block_attrs.rs
parent6991b517f2c1ba9eb75f98ca689378e8dfa1e87f (diff)
parent5f89a60f1a0feab1e2e0dd37e642877552675da4 (diff)
Merge #8578
8578: fix: false positive about inner attrs in docs r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/syntax/test_data/parser/ok/0045_block_attrs.rs')
-rw-r--r--crates/syntax/test_data/parser/ok/0045_block_attrs.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/syntax/test_data/parser/ok/0045_block_attrs.rs b/crates/syntax/test_data/parser/ok/0045_block_attrs.rs
new file mode 100644
index 000000000..ed4593759
--- /dev/null
+++ b/crates/syntax/test_data/parser/ok/0045_block_attrs.rs
@@ -0,0 +1,24 @@
1fn inner() {
2 #![doc("Inner attributes allowed here")]
3 //! As are ModuleDoc style comments
4 {
5 #![doc("Inner attributes are allowed in blocks used as statements")]
6 #![doc("Being validated is not affected by duplcates")]
7 //! As are ModuleDoc style comments
8 };
9 {
10 #![doc("Inner attributes are allowed in blocks when they are the last statement of another block")]
11 //! As are ModuleDoc style comments
12 }
13}
14
15fn outer() {
16 let _ = #[doc("Outer attributes are always allowed")] {};
17}
18
19// https://github.com/rust-analyzer/rust-analyzer/issues/689
20impl Whatever {
21 fn salsa_event(&self, event_fn: impl Fn() -> Event<Self>) {
22 #![allow(unused_variables)] // this is `inner_attr` of the block
23 }
24}