2018-02-22 17:10:17 -06:00
|
|
|
// rustfmt-error_on_line_overflow: false
|
|
|
|
|
2018-01-24 13:09:49 -06:00
|
|
|
macro_rules! m {
|
2018-01-29 04:15:18 -06:00
|
|
|
// a
|
2018-01-25 08:20:17 -06:00
|
|
|
($expr :expr, $( $func : ident ) * ) => {
|
2018-01-24 13:09:49 -06:00
|
|
|
{
|
|
|
|
let x = $expr;
|
|
|
|
$func (
|
|
|
|
x
|
|
|
|
)
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-01-29 04:15:18 -06:00
|
|
|
/* b */
|
2018-01-24 13:09:49 -06:00
|
|
|
|
2018-01-29 04:15:18 -06:00
|
|
|
() => {/* c */};
|
|
|
|
|
2018-01-30 11:05:31 -06:00
|
|
|
(@tag) =>
|
|
|
|
{
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2018-01-29 04:15:18 -06:00
|
|
|
// d
|
2018-01-24 13:09:49 -06:00
|
|
|
( $item:ident ) => {
|
|
|
|
mod macro_item { struct $item ; }
|
|
|
|
};
|
|
|
|
}
|
2018-01-30 11:05:31 -06:00
|
|
|
|
|
|
|
macro m2 {
|
|
|
|
// a
|
|
|
|
($expr :expr, $( $func : ident ) * ) => {
|
|
|
|
{
|
|
|
|
let x = $expr;
|
|
|
|
$func (
|
|
|
|
x
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* b */
|
|
|
|
|
|
|
|
() => {/* c */}
|
|
|
|
|
|
|
|
(@tag) =>
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// d
|
|
|
|
( $item:ident ) => {
|
|
|
|
mod macro_item { struct $item ; }
|
|
|
|
}
|
|
|
|
}
|
2018-02-13 13:00:26 -06:00
|
|
|
|
2018-02-22 17:10:17 -06:00
|
|
|
// #2438, #2476
|
|
|
|
macro_rules! m {
|
|
|
|
() => {
|
|
|
|
fn foo() {
|
|
|
|
this_line_is_98_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
macro_rules! m {
|
|
|
|
() => {
|
|
|
|
fn foo() {
|
|
|
|
this_line_is_99_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
macro_rules! m {
|
|
|
|
() => {
|
|
|
|
fn foo() {
|
|
|
|
this_line_is_100_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
|
|
|
|
);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2018-02-13 14:10:43 -06:00
|
|
|
macro_rules! m {
|
|
|
|
() => {
|
2018-02-22 17:10:17 -06:00
|
|
|
fn foo() {
|
|
|
|
this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
|
|
|
|
);
|
|
|
|
}
|
2018-02-13 14:10:43 -06:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-02-13 13:00:26 -06:00
|
|
|
// #2439
|
|
|
|
macro_rules! m {
|
|
|
|
(
|
|
|
|
$line0_xxxxxxxxxxxxxxxxx: expr,
|
|
|
|
$line1_xxxxxxxxxxxxxxxxx: expr,
|
|
|
|
$line2_xxxxxxxxxxxxxxxxx: expr,
|
|
|
|
$line3_xxxxxxxxxxxxxxxxx: expr,
|
|
|
|
) => {};
|
|
|
|
}
|
2018-02-18 23:08:33 -06:00
|
|
|
|
|
|
|
// #2466
|
|
|
|
// Skip formatting `macro_rules!` that are not using `{}`.
|
|
|
|
macro_rules! m (
|
|
|
|
() => ()
|
|
|
|
);
|
|
|
|
macro_rules! m [
|
|
|
|
() => ()
|
|
|
|
];
|
2018-02-19 23:48:46 -06:00
|
|
|
|
|
|
|
// #2470
|
|
|
|
macro foo($type_name: ident, $docs: expr) {
|
|
|
|
#[allow(non_camel_case_types)]
|
|
|
|
#[doc=$docs]
|
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
|
|
pub struct $type_name;
|
|
|
|
}
|