1 // rustfmt-normalize_comments: true
17 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
19 Pattern1 | Pattern2 | Pattern3 => false,
20 Paternnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn |
21 Paternnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => blah,
22 Patternnnnnnnnnnnnnnnnnnn |
23 Patternnnnnnnnnnnnnnnnnnn |
24 Patternnnnnnnnnnnnnnnnnnn |
25 Patternnnnnnnnnnnnnnnnnnn => meh,
27 Patternnnnnnnnnnnnnnnnnnn |
28 Patternnnnnnnnnnnnnnnnnnn if looooooooooooooooooong_guard => meh,
30 Patternnnnnnnnnnnnnnnnnnnnnnnnn |
31 Patternnnnnnnnnnnnnnnnnnnnnnnnn if looooooooooooooooooooooooooooooooooooooooong_guard => {
35 // Test that earlier patterns can take the guard space
36 (aaaa, bbbbb, ccccccc, aaaaa, bbbbbbbb, cccccc, aaaa, bbbbbbbb, cccccc, dddddd) |
37 Patternnnnnnnnnnnnnnnnnnnnnnnnn if loooooooooooooooooooooooooooooooooooooooooong_guard => {}
40 ast::PathParameters::AngleBracketedParameters(ref data) if data.lifetimes.len() > 0 ||
41 data.types.len() > 0 ||
42 data.bindings.len() > 0 => {}
45 let whatever = match something {
48 // Comment on an attribute.
50 // Comment after an attribute.
57 // Test that a match on an overflow line is laid out properly.
60 match xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx {
61 Some(sub_span) => Some(sub_span),
66 // Test that one-line bodies align.
69 Variableeeeeeeeeeeeeeeeee => {
70 ("variable", vec!["id", "name", "qualname", "value", "type", "scopeid"], true, true)
72 Enummmmmmmmmmmmmmmmmmmmm => {
73 ("enum", vec!["id", "qualname", "scopeid", "value"], true, true)
75 Variantttttttttttttttttttttttt => {
76 ("variant", vec!["id", "name", "qualname", "type", "value", "scopeid"], true, true)
81 y => { /*Block with comment. Preserve me.*/ }
100 let _ = match Some(1) {
113 // collapsing here is safe
114 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff => {}
115 // collapsing here exceeds line length
116 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffg => {
119 // comment above block
121 i => {} // comment below block
123 // comment inside block
126 // comments inside...
128 // TODO uncomment when vertical whitespace is handled better
131 // // comment with WS above
134 // // comment with ws below
149 // TODO uncomment when block-support exists
159 a => println!("a", b),
162 d => println!("a", b),
165 h => println!("a", b), // h comment
166 i => vec![1, 2], // i comment
167 j => vec!(3; 4), // j comment
169 k => println!("a", b),
174 // Rewrite splits macro
175 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => {
178 // Rewrite splits macro
179 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo => {
182 // Macro support fails to recognise this macro as splitable
183 // We push the whole expr to a new line, TODO split this macro as well
184 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp => {
187 // q, r and s: Rewrite splits match arm
188 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq => {
191 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr => {
194 ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss => {
197 // Funky bracketing styles
198 t => println!{"a", b},
201 w => println!["a", b],
204 // Brackets with comments
205 tc => println!{"a", b}, // comment
206 uc => vec![1, 2], // comment
207 vc => vec!{3; 4}, // comment
208 wc => println!["a", b], // comment
209 xc => vec![1, 2], // comment
210 yc => vec![3; 4], // comment
212 looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func(aaaaaaaaaa,
223 CompressionMode::DiscardNewline |
224 CompressionMode::CompressWhitespaceNewline => ch == '\n',
225 ast::ItemConst(ref typ, ref expr) => {
226 self.process_static_or_const_item(item, &typ, &expr)
233 match resolution.last_private {
234 LastImport { .. } => false,
241 1 => unsafe { std::intrinsics::abort() },
248 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
249 HTMLElementTypeId::HTMLCanvasElement))) => true,
250 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
251 HTMLElementTypeId::HTMLObjectElement))) => s.has_object_data(),
252 Some(NodeTypeId::Element(_)) => false,
261 def::DefConst(def_id) |
262 def::DefAssociatedConst(def_id) => {
263 match const_eval::lookup_const_by_id(cx.tcx, def_id, Some(self.pat.id)) {
264 Some(const_expr) => x,
276 hir::StmtExpr(ref expr, id) |
277 hir::StmtSemi(ref expr, id) => {
278 result.push(StmtRef::Mirror(Box::new(Stmt {
280 kind: StmtKind::Expr {
294 BiEq | BiLt | BiLe | BiNe | BiGt | BiGe => true,
295 BiAnd | BiOr | BiAdd | BiSub | BiMul | BiDiv | BiRem | BiBitXor | BiBitAnd | BiBitOr |
296 BiShl | BiShr => false,
302 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo &&
304 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
305 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo &&
307 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
308 if fooooooooooooooooooooo &&
309 (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ||
310 cccccccccccccccccccccccccccccccccccccccc) => {}