File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -898,8 +898,7 @@ impl Rewrite for ast::Arm {
898
898
attr_visitor. last_pos = attrs[ 0 ] . span . lo ;
899
899
if attr_visitor. visit_attrs ( attrs) {
900
900
// Attributes included a skip instruction.
901
- let snippet = context. snippet ( mk_sp ( attrs[ 0 ] . span . lo , body. span . hi ) ) ;
902
- return Some ( snippet) ;
901
+ return None ;
903
902
}
904
903
attr_visitor. format_missing ( pats[ 0 ] . span . lo ) ;
905
904
attr_visitor. buffer . to_string ( )
Original file line number Diff line number Diff line change @@ -100,6 +100,14 @@ fn matches() {
100
100
}
101
101
}
102
102
103
+ fn match_skip ( ) {
104
+ let _ = match Some ( 1 ) {
105
+ #[ rustfmt_skip]
106
+ Some ( n) => n,
107
+ None => 1 ,
108
+ } ;
109
+ }
110
+
103
111
fn issue339 ( ) {
104
112
match a {
105
113
b => { }
Original file line number Diff line number Diff line change @@ -115,6 +115,14 @@ fn matches() {
115
115
}
116
116
}
117
117
118
+ fn match_skip ( ) {
119
+ let _ = match Some ( 1 ) {
120
+ #[ rustfmt_skip]
121
+ Some ( n) => n,
122
+ None => 1 ,
123
+ } ;
124
+ }
125
+
118
126
fn issue339 ( ) {
119
127
match a {
120
128
b => { }
You can’t perform that action at this time.
0 commit comments