2 struct Example<const N: usize>;
4 macro_rules! external_macro {
11 trait Marker<const N: usize> {}
12 impl<const N: usize> Marker<N> for Example<N> {}
14 fn make_marker() -> impl Marker<{
16 macro_rules! const_macro { () => {{ 3 }} } inline!()
18 Example::<{ const_macro!() }>
21 fn from_marker(_: impl Marker<{
23 macro_rules! inline { () => {{ 3 }} } inline!()
29 macro_rules! gimme_a_const {
30 ($rusty: ident) => {{ let $rusty = 3; *&$rusty }}
35 let _ok = Example::<{ external_macro!() }>;
37 let _ok: [_; gimme_a_const!(blah)] = [0,0,0];
38 let _ok: [[u8; gimme_a_const!(blah)]; gimme_a_const!(blah)];
39 let _ok: [u8; gimme_a_const!(blah)];
43 macro_rules! const_two { () => {{ 2 }} }
49 macro_rules! const_three { () => {{ 3 }} }
52 let _ok = [0; const_three!()];
54 from_marker(make_marker());