File tree Expand file tree Collapse file tree 3 files changed +31
-20
lines changed Expand file tree Collapse file tree 3 files changed +31
-20
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ fn execute() -> i32 {
97
97
}
98
98
99
99
macro_rules! print_usage {
100
- ( $print: ident, $opts: ident, $reason: expr) => ( {
100
+ ( $print: ident, $opts: ident, $reason: expr) => ( {
101
101
let msg = format!( "{}\n usage: cargo fmt [options]" , $reason) ;
102
102
$print!(
103
103
"{}\n This utility formats all bin and lib files of the current crate using rustfmt. \
Original file line number Diff line number Diff line change 1
1
macro_rules! test {
2
- ( $( $t: tt) * ) => { }
2
+ ( $( $t: tt) * ) => {
3
+ } ;
3
4
}
4
5
5
6
fn main ( ) {
Original file line number Diff line number Diff line change @@ -141,7 +141,8 @@ fn issue_1555() {
141
141
142
142
fn issue1178 ( ) {
143
143
macro_rules! foo {
144
- ( #[ $attr: meta] $name: ident) => { }
144
+ ( #[ $attr: meta] $name: ident) => {
145
+ } ;
145
146
}
146
147
147
148
foo ! (
@@ -246,11 +247,15 @@ fn __bindgen_test_layout_HandleWithDtor_open0_int_close0_instantiation() {
246
247
247
248
// #878
248
249
macro_rules! try_opt {
249
- ( $expr: expr) => ( match $expr {
250
- Some ( val) => val,
250
+ ( $expr: expr) => {
251
+ match $expr {
252
+ Some ( val) => val,
251
253
252
- None => { return None ; }
253
- } )
254
+ None => {
255
+ return None ;
256
+ }
257
+ }
258
+ } ;
254
259
}
255
260
256
261
// #2214
@@ -885,23 +890,28 @@ fn macro_in_pattern_position() {
885
890
} ;
886
891
}
887
892
888
- macro foo( ) {
889
-
893
+ macro foo {
894
+ ( ) => {
895
+ }
890
896
}
891
897
892
- pub macro bar ( $x: ident + $y: expr; ) {
893
- fn foo ( $x: Foo ) {
894
- long_function (
895
- a_long_argument_to_a_long_function_is_what_this_is ( AAAAAAAAAAAAAAAAAAAAAAAAAAAA ) ,
896
- $x. bar ( $y) ,
897
- ) ;
898
+ pub macro bar {
899
+ ( $x: ident + $y: expr; ) => {
900
+ fn foo ( $x: Foo ) {
901
+ long_function (
902
+ a_long_argument_to_a_long_function_is_what_this_is ( AAAAAAAAAAAAAAAAAAAAAAAAAAAA ) ,
903
+ $x. bar ( $y) ,
904
+ ) ;
905
+ }
898
906
}
899
907
}
900
908
901
- macro foo( ) {
902
- // a comment
903
- fn foo ( ) {
904
- // another comment
905
- bar ( ) ;
909
+ macro foo {
910
+ ( ) => {
911
+ // a comment
912
+ fn foo ( ) {
913
+ // another comment
914
+ bar ( ) ;
915
+ }
906
916
}
907
917
}
You can’t perform that action at this time.
0 commit comments