16 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
18 Pattern1 | Pattern2 | Pattern3 => false,
19 Paternnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn |
20 Paternnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => blah,
21 Patternnnnnnnnnnnnnnnnnnn |
22 Patternnnnnnnnnnnnnnnnnnn |
23 Patternnnnnnnnnnnnnnnnnnn |
24 Patternnnnnnnnnnnnnnnnnnn => meh,
26 Patternnnnnnnnnnnnnnnnnnn |
27 Patternnnnnnnnnnnnnnnnnnn if looooooooooooooooooong_guard => meh,
29 Patternnnnnnnnnnnnnnnnnnnnnnnnn |
30 Patternnnnnnnnnnnnnnnnnnnnnnnnn if looooooooooooooooooooooooooooooooooooooooong_guard => {
34 // Test that earlier patterns can take the guard space
35 (aaaa, bbbbb, ccccccc, aaaaa, bbbbbbbb, cccccc, aaaa, bbbbbbbb, cccccc, dddddd) |
36 Patternnnnnnnnnnnnnnnnnnnnnnnnn if loooooooooooooooooooooooooooooooooooooooooong_guard => {}
39 ast::PathParameters::AngleBracketedParameters(ref data) if data.lifetimes.len() > 0 ||
40 data.types.len() > 0 ||
41 data.bindings.len() > 0 => {}
44 let whatever = match something {
47 // Comment on an attribute.
49 // Comment after an attribute.
56 // Test that a match on an overflow line is laid out properly.
59 match xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx {
60 Some(sub_span) => Some(sub_span),
65 // Test that one-line bodies align.
68 Variableeeeeeeeeeeeeeeeee => {
69 ("variable", vec!["id", "name", "qualname", "value", "type", "scopeid"], true, true)
71 Enummmmmmmmmmmmmmmmmmmmm => {
72 ("enum", vec!["id", "qualname", "scopeid", "value"], true, true)
74 Variantttttttttttttttttttttttt => {
75 ("variant", vec!["id", "name", "qualname", "type", "value", "scopeid"], true, true)
81 // Block with comment. Preserve me.
101 let _ = match Some(1) {
114 // collapsing here is safe
115 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff => {}
116 // collapsing here exceeds line length
117 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffg => {
120 // comment above block
122 i => {} // comment below block
124 // comment inside block
127 // comments inside...
129 // TODO uncomment when vertical whitespace is handled better
132 // // comment with WS above
135 // // comment with ws below
150 // TODO uncomment when block-support exists
160 a => println!("a", b),
163 d => println!("a", b),
166 h => println!("a", b), // h comment
167 i => vec![1, 2], // i comment
168 j => vec!(3; 4), // j comment
170 k => println!("a", b),
175 // Rewrite splits macro
176 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => {
179 // Rewrite splits macro
180 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo => {
183 // Macro support fails to recognise this macro as splitable
184 // We push the whole expr to a new line, TODO split this macro as well
185 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp => {
188 // q, r and s: Rewrite splits match arm
189 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq => {
192 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr => {
195 ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss => {
198 // Funky bracketing styles
199 t => println!{"a", b},
202 w => println!["a", b],
205 // Brackets with comments
206 tc => println!{"a", b}, // comment
207 uc => vec![1, 2], // comment
208 vc => vec!{3; 4}, // comment
209 wc => println!["a", b], // comment
210 xc => vec![1, 2], // comment
211 yc => vec![3; 4], // comment
213 looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func(aaaaaaaaaa,
224 CompressionMode::DiscardNewline |
225 CompressionMode::CompressWhitespaceNewline => ch == '\n',
226 ast::ItemConst(ref typ, ref expr) => {
227 self.process_static_or_const_item(item, &typ, &expr)
234 match resolution.last_private {
235 LastImport { .. } => false,
242 1 => unsafe { std::intrinsics::abort() },
249 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
250 HTMLElementTypeId::HTMLCanvasElement))) => true,
251 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
252 HTMLElementTypeId::HTMLObjectElement))) => s.has_object_data(),
253 Some(NodeTypeId::Element(_)) => false,
262 def::DefConst(def_id) |
263 def::DefAssociatedConst(def_id) => {
264 match const_eval::lookup_const_by_id(cx.tcx, def_id, Some(self.pat.id)) {
265 Some(const_expr) => x,
277 hir::StmtExpr(ref expr, id) |
278 hir::StmtSemi(ref expr, id) => {
279 result.push(StmtRef::Mirror(Box::new(Stmt {
281 kind: StmtKind::Expr {
282 scope: cx.tcx.region_maps.node_extent(id),
293 BiEq | BiLt | BiLe | BiNe | BiGt | BiGe => true,
294 BiAnd | BiOr | BiAdd | BiSub | BiMul | BiDiv | BiRem | BiBitXor | BiBitAnd | BiBitOr |
295 BiShl | BiShr => false,
301 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo &&
303 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
304 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa if foooooooooooooo &&
306 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
307 if fooooooooooooooooooooo &&
308 (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ||
309 cccccccccccccccccccccccccccccccccccccccc) => {}