mirror of https://github.com/rust-lang/rust.git
Create failing test for equal inside macro
This commit is contained in:
parent
4daa4e38e2
commit
50eb48e42b
|
@ -87,4 +87,20 @@ fn main() {
|
||||||
let x = Y(1);
|
let x = Y(1);
|
||||||
let y = Y(2);
|
let y = Y(2);
|
||||||
let z = x & &y;
|
let z = x & &y;
|
||||||
|
|
||||||
|
check_ignore_macro();
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! check_if_named_foo {
|
||||||
|
($expression:expr) => (
|
||||||
|
if stringify!($expression) == "foo" {
|
||||||
|
println!("foo!");
|
||||||
|
} else {
|
||||||
|
println!("not foo.");
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn check_ignore_macro() {
|
||||||
|
check_if_named_foo!(foo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue