rust/tests/ui/parser/macro/macro-bare-trait-object-maybe-trait-bound.rs
Josh Triplett 131cffb6ba Rename tests named with mbe to use macro instead
Most macro tests use `macro` in the name, making it easy to find and run
tests relevant to macros. However, a few use `mbe` instead. Rename those
to say `macro`.
2025-07-05 21:09:10 -07:00

17 lines
412 B
Rust

// Check that `?Trait` matches the macro fragment specifier `ty`.
// Syntactically trait object types can be "bare" (i.e., lack the prefix `dyn`),
// even in newer editions like Rust 2021.
// Therefore the arm `?$Trait:path` shouldn't get reached.
//@ edition: 2021
//@ check-pass
macro_rules! check {
($Ty:ty) => {};
(?$Trait:path) => { compile_error!("non-ty"); };
}
check! { ?Trait }
fn main() {}