2023-12-18 17:55:55 +01:00
|
|
|
// 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.
|
|
|
|
|
|
2024-02-16 20:02:50 +00:00
|
|
|
//@ edition: 2021
|
|
|
|
|
//@ check-pass
|
2023-12-18 17:55:55 +01:00
|
|
|
|
|
|
|
|
macro_rules! check {
|
|
|
|
|
($Ty:ty) => {};
|
|
|
|
|
(?$Trait:path) => { compile_error!("non-ty"); };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check! { ?Trait }
|
|
|
|
|
|
|
|
|
|
fn main() {}
|