]> git.proxmox.com Git - rustc.git/blame - src/tools/rust-analyzer/crates/parser/test_data/parser/ok/0045_block_attrs.rs
New upstream version 1.72.1+dfsg1
[rustc.git] / src / tools / rust-analyzer / crates / parser / test_data / parser / ok / 0045_block_attrs.rs
CommitLineData
064997fb
FG
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")]
fe692bf9 6 #![doc("Being validated is not affected by duplicates")]
064997fb
FG
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-lang/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}