15 // Perhaps this should introduce braces?
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
46 Patternnnnnnnnnnnnnnnnnnnnnnnnn if loooooooooooooooooooooooooooooooooooooooooong_guard => {}
49 ast::PathParameters::AngleBracketedParameters(ref data) if data.lifetimes.len() > 0 ||
50 data.types.len() > 0 ||
51 data.bindings.len() > 0 => {}
54 let whatever = match something {
57 // Comment on an attribute.
59 // Comment after an attribute.
66 // Test that a match on an overflow line is laid out properly.
69 match xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx {
70 Some(sub_span) => Some(sub_span),
75 // Test that one-line bodies align.
78 Variableeeeeeeeeeeeeeeeee => {
80 vec!["id", "name", "qualname", "value", "type", "scopeid"],
84 Enummmmmmmmmmmmmmmmmmmmm => {
86 vec!["id", "qualname", "scopeid", "value"],
90 Variantttttttttttttttttttttttt => {
92 vec!["id", "name", "qualname", "type", "value", "scopeid"],
116 // collapsing here is safe
117 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff => {}
118 // collapsing here exceeds line length
119 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffg => {
122 // comment above block
124 i => {} // comment below block
126 // comment inside block
129 // comments inside...
131 // TODO uncomment when vertical whitespace is handled better
134 // // comment with WS above
137 // // comment with ws below
152 // TODO uncomment when block-support exists
162 a => println!("a", b),
165 d => println!("a", b),
168 h => println!("a", b), // h comment
169 i => vec![1, 2], // i comment
170 j => vec!(3; 4), // j comment
172 k => println!("a", b),
177 // Rewrite splits macro
178 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => {
181 // Rewrite splits macro
182 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo => {
185 // Macro support fails to recognise this macro as splitable
186 // We push the whole expr to a new line, TODO split this macro as well
187 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp => {
190 // q, r and s: Rewrite splits match arm
191 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq => {
194 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr => {
197 ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss => {
200 // Funky bracketing styles
201 t => println!{"a", b},
204 w => println!["a", b],
207 // Brackets with comments
208 tc => println!{"a", b}, // comment
209 uc => vec![1, 2], // comment
210 vc => vec!{3; 4}, // comment
211 wc => println!["a", b], // comment
212 xc => vec![1, 2], // comment
213 yc => vec![3; 4], // comment
215 looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func(aaaaaaaaaa,
226 CompressionMode::DiscardNewline | CompressionMode::CompressWhitespaceNewline => {
229 ast::ItemConst(ref typ, ref expr) => {
230 self.process_static_or_const_item(item, &typ, &expr)
237 match resolution.last_private {
238 LastImport{..} => false,
245 1 => unsafe { std::intrinsics::abort() },
252 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
253 HTMLElementTypeId::HTMLCanvasElement))) => true,
254 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
255 HTMLElementTypeId::HTMLObjectElement))) => s.has_object_data(),
256 Some(NodeTypeId::Element(_)) => false,
265 def::DefConst(def_id) | def::DefAssociatedConst(def_id) => {
266 match const_eval::lookup_const_by_id(cx.tcx, def_id, Some(self.pat.id)) {
267 Some(const_expr) => x,
279 hir::StmtExpr(ref expr, id) | hir::StmtSemi(ref expr, id) => {
280 result.push(StmtRef::Mirror(Box::new(Stmt {
282 kind: StmtKind::Expr {
283 scope: cx.tcx.region_maps.node_extent(id),