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.
119 let _ = match Some(1) {
132 // collapsing here is safe
133 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff => {}
134 // collapsing here exceeds line length
135 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffg => {
138 // comment above block
140 i => {} // comment below block
142 // comment inside block
145 // comments inside...
147 // TODO uncomment when vertical whitespace is handled better
150 // // comment with WS above
153 // // comment with ws below
168 // TODO uncomment when block-support exists
178 a => println!("a", b),
181 d => println!("a", b),
184 h => println!("a", b), // h comment
185 i => vec![1, 2], // i comment
186 j => vec!(3; 4), // j comment
188 k => println!("a", b),
193 // Rewrite splits macro
194 nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn => {
197 // Rewrite splits macro
198 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo => {
201 // Macro support fails to recognise this macro as splitable
202 // We push the whole expr to a new line, TODO split this macro as well
203 pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp => {
206 // q, r and s: Rewrite splits match arm
207 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq => {
210 rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr => {
213 ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss => {
216 // Funky bracketing styles
217 t => println!{"a", b},
220 w => println!["a", b],
223 // Brackets with comments
224 tc => println!{"a", b}, // comment
225 uc => vec![1, 2], // comment
226 vc => vec!{3; 4}, // comment
227 wc => println!["a", b], // comment
228 xc => vec![1, 2], // comment
229 yc => vec![3; 4], // comment
231 looooooooooooooooooooooooooooooooooooooooooooooooooooooooong_func(aaaaaaaaaa,
242 CompressionMode::DiscardNewline | CompressionMode::CompressWhitespaceNewline => {
245 ast::ItemConst(ref typ, ref expr) => {
246 self.process_static_or_const_item(item, &typ, &expr)
253 match resolution.last_private {
254 LastImport{..} => false,
261 1 => unsafe { std::intrinsics::abort() },
268 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
269 HTMLElementTypeId::HTMLCanvasElement))) => true,
270 Some(NodeTypeId::Element(ElementTypeId::HTMLElement(
271 HTMLElementTypeId::HTMLObjectElement))) => s.has_object_data(),
272 Some(NodeTypeId::Element(_)) => false,
281 def::DefConst(def_id) | def::DefAssociatedConst(def_id) => {
282 match const_eval::lookup_const_by_id(cx.tcx, def_id, Some(self.pat.id)) {
283 Some(const_expr) => x,
295 hir::StmtExpr(ref expr, id) | hir::StmtSemi(ref expr, id) => {
296 result.push(StmtRef::Mirror(Box::new(Stmt {
298 kind: StmtKind::Expr {
299 scope: cx.tcx.region_maps.node_extent(id),