mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Update tests to respect the way that macros work now.
This commit is contained in:
parent
45bcb10204
commit
e7f07cb2a3
@ -3,10 +3,10 @@
|
||||
fn main() {
|
||||
|
||||
macro_rules! mylambda_tt(
|
||||
($x:ident, $body:expr) => {
|
||||
($x:ident, $body:expr) => ({
|
||||
fn f($x: int) -> int { return $body; };
|
||||
f
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
assert(mylambda_tt!(y, y * 2)(8) == 16)
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
macro_rules! overly_complicated (
|
||||
($fnname:ident, $arg:ident, $ty:ty, $body:block, $val:expr, $pat:pat, $res:path) =>
|
||||
{
|
||||
({
|
||||
fn $fnname($arg: $ty) -> Option<$ty> $body
|
||||
match $fnname($val) {
|
||||
Some($pat) => {
|
||||
@ -9,7 +9,7 @@ macro_rules! overly_complicated (
|
||||
}
|
||||
_ => { fail; }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
)
|
||||
fn main() {
|
||||
|
@ -2,13 +2,11 @@ mod m {
|
||||
pub type t = int;
|
||||
}
|
||||
|
||||
fn macros() {
|
||||
macro_rules! foo {
|
||||
($p:path) => {
|
||||
fn f() -> $p { 10 }
|
||||
f()
|
||||
}
|
||||
}
|
||||
macro_rules! foo {
|
||||
($p:path) => ({
|
||||
fn f() -> $p { 10 };
|
||||
f()
|
||||
})
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -54,12 +54,12 @@ macro_rules! select (
|
||||
$($message:path$(($($x: ident),+))dont_type_this*
|
||||
-> $next:ident $e:expr),+
|
||||
} )+
|
||||
} => {
|
||||
} => ({
|
||||
let index = pipes::selecti([$(($port).header()),+]);
|
||||
select_if!(index, 0, $( $port => [
|
||||
$($message$(($($x),+))dont_type_this* -> $next $e),+
|
||||
], )+)
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
// Types and protocols
|
||||
|
Loading…
Reference in New Issue
Block a user