9 c => { // Another comment.
15 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,
16 Pattern1 | Pattern2 | Pattern3 => false,
17 Paternnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn |
18 Paternnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => {
21 Patternnnnnnnnnnnnnnnnnnn |
22 Patternnnnnnnnnnnnnnnnnnn |
23 Patternnnnnnnnnnnnnnnnnnn |
24 Patternnnnnnnnnnnnnnnnnnn => meh,
26 Patternnnnnnnnnnnnnnnnnnn |
27 Patternnnnnnnnnnnnnnnnnnn if looooooooooooooooooong_guard => meh,
29 Patternnnnnnnnnnnnnnnnnnnnnnnnn |
30 Patternnnnnnnnnnnnnnnnnnnnnnnnn if looooooooooooooooooooooooooooooooooooooooong_guard =>
33 // Test that earlier patterns can take the guard space
34 (aaaa, bbbbb, ccccccc, aaaaa, bbbbbbbb, cccccc, aaaa, bbbbbbbb, cccccc, dddddd) |
35 Patternnnnnnnnnnnnnnnnnnnnnnnnn if loooooooooooooooooooooooooooooooooooooooooong_guard => {}
38 ast::PathParameters::AngleBracketedParameters(ref data) if data.lifetimes.len() > 0 ||
39 data.types.len() > 0 ||
40 data.bindings.len() > 0 => {}
43 let whatever = match something {
46 // Comment on an attribute.
48 // Comment after an attribute.
55 // Test that a match on an overflow line is laid out properly.
58 match xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx {
59 Some(sub_span) => Some(sub_span),
64 // Test that one-line bodies align.
67 Variableeeeeeeeeeeeeeeeee => ( "variable",
68 vec!("id", "name", "qualname",
69 "value", "type", "scopeid"),
72 Enummmmmmmmmmmmmmmmmmmmm => ("enum",
73 vec!("id","qualname","scopeid","value"),
76 Variantttttttttttttttttttttttt => ("variant",
88 y=>{/*Block with comment. Preserve me.*/ }
104 let _ = match Some(1) {
122 // collapsing here is safe
123 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff => {
125 // collapsing here exceeds line length
126 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffg => {
128 h => { // comment above block
131 } // comment below block
133 // comment inside block
136 // comments inside...
138 // TODO uncomment when vertical whitespace is handled better
141 // // comment with WS above
144 // // comment with ws below
152 p => { // Dont collapse me
161 // TODO uncomment when block-support exists
171 a => println!("a", b),
183 h => println!("a", b), // h comment
184 i => vec!(1, 2), // i comment
185 j => vec!(3; 4), // j comment
187 k => println!("a", b),
192 // Rewrite splits macro
193 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => println!("a", b),
194 // Rewrite splits macro
195 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo => vec!(1, 2),
196 // Macro support fails to recognise this macro as splitable
197 // We push the whole expr to a new line, TODO split this macro as well
198 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp => vec!(3; 4),
199 // q, r and s: Rewrite splits match arm
200 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq => println!("a", b),
201 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr => vec!(1, 2),
202 ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss => vec!(3; 4),
203 // Funky bracketing styles
204 t => println!{"a", b},
207 w => println!["a", b],
210 // Brackets with comments
211 tc => println!{"a", b}, // comment
212 uc => vec!{1, 2}, // comment
213 vc =>vec!{3; 4}, // comment
214 wc =>println!["a", b], // comment
215 xc => vec![1,2], // comment
216 yc => vec![3; 4], // comment
218 looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func(aaaaaaaaaa,
228 CompressionMode::DiscardNewline | CompressionMode::CompressWhitespaceNewline => ch ==
230 ast::ItemConst(ref typ, ref expr) => self.process_static_or_const_item(item,
238 match resolution.last_private {LastImport{..} => false, _ => true};
243 1 => unsafe { std::intrinsics::abort() },
250 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
251 HTMLElementTypeId::HTMLCanvasElement))) => true,
252 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
253 HTMLElementTypeId::HTMLObjectElement))) => s.has_object_data(),
254 Some(NodeTypeId::Element(_)) => false,
260 def::DefConst(def_id) | def::DefAssociatedConst(def_id) =>
261 match const_eval::lookup_const_by_id(cx.tcx, def_id, Some(self.pat.id)) {
262 Some(const_expr) => { x }}}}}}}
267 hir::StmtExpr(ref expr, id) | hir::StmtSemi(ref expr, id) =>
270 Box::new(Stmt { span: stmt.span,
271 kind: StmtKind::Expr {
272 scope: cx.tcx.region_maps.node_extent(id),
273 expr: expr.to_ref() } }))),
280 BiEq | BiLt | BiLe | BiNe | BiGt | BiGe =>
282 BiAnd | BiOr | BiAdd | BiSub | BiMul | BiDiv | BiRem |
283 BiBitXor | BiBitAnd | BiBitOr | BiShl | BiShr =>
290 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo && barrrrrrrrrrrr => {}
291 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo && barrrrrrrrrrrr => {}
292 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
293 if fooooooooooooooooooooo &&
294 (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb || cccccccccccccccccccccccccccccccccccccccc) => {}