Skip to content

Commit d433efa

Browse files
committed
more simple formatting
1 parent 0ee5a1a commit d433efa

File tree

4 files changed

+48
-48
lines changed

4 files changed

+48
-48
lines changed

compiler/rustc_ast/src/ast.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2088,15 +2088,15 @@ pub enum InlineAsmRegOrRegClass {
20882088
bitflags::bitflags! {
20892089
#[derive(Encodable, Decodable, HashStable_Generic)]
20902090
pub struct InlineAsmOptions: u16 {
2091-
const PURE = 1 << 0;
2092-
const NOMEM = 1 << 1;
2093-
const READONLY = 1 << 2;
2091+
const PURE = 1 << 0;
2092+
const NOMEM = 1 << 1;
2093+
const READONLY = 1 << 2;
20942094
const PRESERVES_FLAGS = 1 << 3;
2095-
const NORETURN = 1 << 4;
2096-
const NOSTACK = 1 << 5;
2097-
const ATT_SYNTAX = 1 << 6;
2098-
const RAW = 1 << 7;
2099-
const MAY_UNWIND = 1 << 8;
2095+
const NORETURN = 1 << 4;
2096+
const NOSTACK = 1 << 5;
2097+
const ATT_SYNTAX = 1 << 6;
2098+
const RAW = 1 << 7;
2099+
const MAY_UNWIND = 1 << 8;
21002100
}
21012101
}
21022102

compiler/rustc_ast/src/util/parser.rs

+34-34
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,11 @@ impl ExprPrecedence {
297297
match self {
298298
ExprPrecedence::Closure => PREC_CLOSURE,
299299

300-
ExprPrecedence::Break |
301-
ExprPrecedence::Continue |
302-
ExprPrecedence::Ret |
303-
ExprPrecedence::Yield |
304-
ExprPrecedence::Yeet => PREC_JUMP,
300+
ExprPrecedence::Break
301+
| ExprPrecedence::Continue
302+
| ExprPrecedence::Ret
303+
| ExprPrecedence::Yield
304+
| ExprPrecedence::Yeet => PREC_JUMP,
305305

306306
// `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
307307
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
@@ -318,43 +318,43 @@ impl ExprPrecedence {
318318
ExprPrecedence::AssignOp => AssocOp::Assign.precedence() as i8,
319319

320320
// Unary, prefix
321-
ExprPrecedence::Box |
322-
ExprPrecedence::AddrOf |
321+
ExprPrecedence::Box
322+
| ExprPrecedence::AddrOf
323323
// Here `let pats = expr` has `let pats =` as a "unary" prefix of `expr`.
324324
// However, this is not exactly right. When `let _ = a` is the LHS of a binop we
325325
// need parens sometimes. E.g. we can print `(let _ = a) && b` as `let _ = a && b`
326326
// but we need to print `(let _ = a) < b` as-is with parens.
327-
ExprPrecedence::Let |
328-
ExprPrecedence::Unary => PREC_PREFIX,
327+
| ExprPrecedence::Let
328+
| ExprPrecedence::Unary => PREC_PREFIX,
329329

330330
// Unary, postfix
331-
ExprPrecedence::Await |
332-
ExprPrecedence::Call |
333-
ExprPrecedence::MethodCall |
334-
ExprPrecedence::Field |
335-
ExprPrecedence::Index |
336-
ExprPrecedence::Try |
337-
ExprPrecedence::InlineAsm |
338-
ExprPrecedence::Mac => PREC_POSTFIX,
331+
ExprPrecedence::Await
332+
| ExprPrecedence::Call
333+
| ExprPrecedence::MethodCall
334+
| ExprPrecedence::Field
335+
| ExprPrecedence::Index
336+
| ExprPrecedence::Try
337+
| ExprPrecedence::InlineAsm
338+
| ExprPrecedence::Mac => PREC_POSTFIX,
339339

340340
// Never need parens
341-
ExprPrecedence::Array |
342-
ExprPrecedence::Repeat |
343-
ExprPrecedence::Tup |
344-
ExprPrecedence::Lit |
345-
ExprPrecedence::Path |
346-
ExprPrecedence::Paren |
347-
ExprPrecedence::If |
348-
ExprPrecedence::While |
349-
ExprPrecedence::ForLoop |
350-
ExprPrecedence::Loop |
351-
ExprPrecedence::Match |
352-
ExprPrecedence::ConstBlock |
353-
ExprPrecedence::Block |
354-
ExprPrecedence::TryBlock |
355-
ExprPrecedence::Async |
356-
ExprPrecedence::Struct |
357-
ExprPrecedence::Err => PREC_PAREN,
341+
ExprPrecedence::Array
342+
| ExprPrecedence::Repeat
343+
| ExprPrecedence::Tup
344+
| ExprPrecedence::Lit
345+
| ExprPrecedence::Path
346+
| ExprPrecedence::Paren
347+
| ExprPrecedence::If
348+
| ExprPrecedence::While
349+
| ExprPrecedence::ForLoop
350+
| ExprPrecedence::Loop
351+
| ExprPrecedence::Match
352+
| ExprPrecedence::ConstBlock
353+
| ExprPrecedence::Block
354+
| ExprPrecedence::TryBlock
355+
| ExprPrecedence::Async
356+
| ExprPrecedence::Struct
357+
| ExprPrecedence::Err => PREC_PAREN,
358358
}
359359
}
360360
}

compiler/rustc_hir/src/hir.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@ impl LifetimeName {
139139
match self {
140140
LifetimeName::ImplicitObjectLifetimeDefault | LifetimeName::Infer => true,
141141

142-
// It might seem surprising that `Fresh` counts as
143-
// *not* elided -- but this is because, as far as the code
144-
// in the compiler is concerned -- `Fresh` variants act
145-
// equivalently to "some fresh name". They correspond to
146-
// early-bound regions on an impl, in other words.
142+
// It might seem surprising that `Fresh` counts as not *elided*
143+
// -- but this is because, as far as the code in the compiler is
144+
// concerned -- `Fresh` variants act equivalently to "some fresh name".
145+
// They correspond to early-bound regions on an impl, in other words.
147146
LifetimeName::Error | LifetimeName::Param(..) | LifetimeName::Static => false,
148147
}
149148
}

compiler/rustc_passes/src/check_attr.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,8 @@ impl CheckAttrVisitor<'_> {
16661666
E0552,
16671667
"unrecognized representation hint"
16681668
)
1669-
.help("valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`")
1669+
.help("valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, \
1670+
`i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`")
16701671
.emit();
16711672

16721673
continue;

0 commit comments

Comments
 (0)