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
45 Patternnnnnnnnnnnnnnnnnnnnnnnnn if loooooooooooooooooooooooooooooooooooooooooong_guard => {}
48 ast::PathParameters::AngleBracketedParameters(ref data) if data.lifetimes.len() > 0 ||
49 data.types.len() > 0 ||
50 data.bindings.len() > 0 => {}
53 let whatever = match something {
56 // Comment on an attribute.
58 // Comment after an attribute.
65 // Test that a match on an overflow line is laid out properly.
68 match xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx {
69 Some(sub_span) => Some(sub_span),
74 // Test that one-line bodies align.
77 Variableeeeeeeeeeeeeeeeee => {
79 vec!["id", "name", "qualname", "value", "type", "scopeid"],
83 Enummmmmmmmmmmmmmmmmmmmm => {
85 vec!["id", "qualname", "scopeid", "value"],
89 Variantttttttttttttttttttttttt => {
91 vec!["id", "name", "qualname", "type", "value", "scopeid"],
99 // Block with comment. Preserve me.
124 // collapsing here is safe
125 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff => {}
126 // collapsing here exceeds line length
127 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffg => {
130 // comment above block
132 i => {} // comment below block
134 // comment inside block
137 // comments inside...
139 // TODO uncomment when vertical whitespace is handled better
142 // // comment with WS above
145 // // comment with ws below
160 // TODO uncomment when block-support exists
170 a => println!("a", b),
173 d => println!("a", b),
176 h => println!("a", b), // h comment
177 i => vec![1, 2], // i comment
178 j => vec!(3; 4), // j comment
180 k => println!("a", b),
185 // Rewrite splits macro
186 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => {
189 // Rewrite splits macro
190 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo => {
193 // Macro support fails to recognise this macro as splitable
194 // We push the whole expr to a new line, TODO split this macro as well
195 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp => {
198 // q, r and s: Rewrite splits match arm
199 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq => {
202 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr => {
205 ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss => {
208 // Funky bracketing styles
209 t => println!{"a", b},
212 w => println!["a", b],
215 // Brackets with comments
216 tc => println!{"a", b}, // comment
217 uc => vec![1, 2], // comment
218 vc => vec!{3; 4}, // comment
219 wc => println!["a", b], // comment
220 xc => vec![1, 2], // comment
221 yc => vec![3; 4], // comment
223 looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func(aaaaaaaaaa,
234 CompressionMode::DiscardNewline | CompressionMode::CompressWhitespaceNewline => {
237 ast::ItemConst(ref typ, ref expr) => {
238 self.process_static_or_const_item(item, &typ, &expr)
245 match resolution.last_private {
246 LastImport{..} => false,
253 1 => unsafe { std::intrinsics::abort() },
260 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
261 HTMLElementTypeId::HTMLCanvasElement))) => true,
262 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
263 HTMLElementTypeId::HTMLObjectElement))) => s.has_object_data(),
264 Some(NodeTypeId::Element(_)) => false,
273 def::DefConst(def_id) | def::DefAssociatedConst(def_id) => {
274 match const_eval::lookup_const_by_id(cx.tcx, def_id, Some(self.pat.id)) {
275 Some(const_expr) => x,
287 hir::StmtExpr(ref expr, id) | hir::StmtSemi(ref expr, id) => {
288 result.push(StmtRef::Mirror(Box::new(Stmt {
290 kind: StmtKind::Expr {
291 scope: cx.tcx.region_maps.node_extent(id),