1 #![allow(clippy::semicolon_if_nothing_returned)] // https://github.com/rust-lang/rust-clippy/issues/7324 2 3 #[rustversion::attr(all(), const)] _basic()4fn _basic() {} 5 const _BASIC: () = _basic(); 6 7 #[rustversion::attr(all(), const)] _unsafe()8unsafe fn _unsafe() {} 9 const _UNSAFE: () = unsafe { _unsafe() }; 10 11 macro_rules! item { 12 ($i:item) => { 13 #[rustversion::attr(all(), const)] 14 $i 15 }; 16 } 17 18 item! {fn _item() {}} 19 const _ITEM: () = _item(); 20 21 macro_rules! ident { 22 ($fn:ident) => { 23 #[rustversion::attr(all(), const)] 24 $fn _ident() {} 25 }; 26 } 27 28 ident! {fn} 29 const _IDENT: () = _ident(); 30 31 #[rustversion::attr(all(), const)] 32 /// doc _doc_below()33fn _doc_below() {} 34 const _DOC_BELOW: () = _doc_below(); 35 36 /// doc 37 #[rustversion::attr(all(), const)] _doc_above()38fn _doc_above() {} 39 const _DOC_ABOVE: () = _doc_above(); 40