Open
Description
I tried this code:
#[macro_export]
macro_rules! vec2 {
( $( $x:expr ),* ) => {
{
let mut temp_vec = Vec::new();
$(
temp_vec.push($x);
)? // this one works the same as below
temp_vec
}
};
}
#[macro_export]
macro_rules! vec3 {
( $( $x:expr ),* ) => {
{
let mut temp_vec = Vec::new();
$(
temp_vec.push($x);
)* // this one works the same as above
temp_vec
}
};
}
I expected to see this happen: macros expression that use "?" should return error
Instead, this happened: both macros works in same way
Meta
rustc --version --verbose
:
rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: x86_64-pc-windows-msvc
release: 1.60.0
LLVM version: 14.0.0