Files
rust/tests/ui/const-generics/early/const_arg_trivial_macro_expansion-4.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
470 B
Rust
Raw Normal View History

2024-11-25 18:17:23 +01:00
macro_rules! empty {
() => {};
}
macro_rules! arg {
() => {
N
//~^ ERROR generic parameters may not be used in const operations
//~| ERROR generic parameters may not be used in const operations
};
}
struct Foo<const N: usize>;
fn foo<const N: usize>() -> Foo<{ arg!{} arg!{} }> { loop {} }
fn bar<const N: usize>() -> [(); { empty!{}; N }] { loop {} }
//~^ ERROR generic parameters may not be used in const operations
fn main() {}