mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
more simple formatting
This commit is contained in:
parent
0ee5a1ac19
commit
d433efa649
@ -2088,15 +2088,15 @@ pub enum InlineAsmRegOrRegClass {
|
|||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
#[derive(Encodable, Decodable, HashStable_Generic)]
|
#[derive(Encodable, Decodable, HashStable_Generic)]
|
||||||
pub struct InlineAsmOptions: u16 {
|
pub struct InlineAsmOptions: u16 {
|
||||||
const PURE = 1 << 0;
|
const PURE = 1 << 0;
|
||||||
const NOMEM = 1 << 1;
|
const NOMEM = 1 << 1;
|
||||||
const READONLY = 1 << 2;
|
const READONLY = 1 << 2;
|
||||||
const PRESERVES_FLAGS = 1 << 3;
|
const PRESERVES_FLAGS = 1 << 3;
|
||||||
const NORETURN = 1 << 4;
|
const NORETURN = 1 << 4;
|
||||||
const NOSTACK = 1 << 5;
|
const NOSTACK = 1 << 5;
|
||||||
const ATT_SYNTAX = 1 << 6;
|
const ATT_SYNTAX = 1 << 6;
|
||||||
const RAW = 1 << 7;
|
const RAW = 1 << 7;
|
||||||
const MAY_UNWIND = 1 << 8;
|
const MAY_UNWIND = 1 << 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,11 +297,11 @@ impl ExprPrecedence {
|
|||||||
match self {
|
match self {
|
||||||
ExprPrecedence::Closure => PREC_CLOSURE,
|
ExprPrecedence::Closure => PREC_CLOSURE,
|
||||||
|
|
||||||
ExprPrecedence::Break |
|
ExprPrecedence::Break
|
||||||
ExprPrecedence::Continue |
|
| ExprPrecedence::Continue
|
||||||
ExprPrecedence::Ret |
|
| ExprPrecedence::Ret
|
||||||
ExprPrecedence::Yield |
|
| ExprPrecedence::Yield
|
||||||
ExprPrecedence::Yeet => PREC_JUMP,
|
| ExprPrecedence::Yeet => PREC_JUMP,
|
||||||
|
|
||||||
// `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
|
// `Range` claims to have higher precedence than `Assign`, but `x .. x = x` fails to
|
||||||
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
|
// parse, instead of parsing as `(x .. x) = x`. Giving `Range` a lower precedence
|
||||||
@ -318,43 +318,43 @@ impl ExprPrecedence {
|
|||||||
ExprPrecedence::AssignOp => AssocOp::Assign.precedence() as i8,
|
ExprPrecedence::AssignOp => AssocOp::Assign.precedence() as i8,
|
||||||
|
|
||||||
// Unary, prefix
|
// Unary, prefix
|
||||||
ExprPrecedence::Box |
|
ExprPrecedence::Box
|
||||||
ExprPrecedence::AddrOf |
|
| ExprPrecedence::AddrOf
|
||||||
// Here `let pats = expr` has `let pats =` as a "unary" prefix of `expr`.
|
// Here `let pats = expr` has `let pats =` as a "unary" prefix of `expr`.
|
||||||
// However, this is not exactly right. When `let _ = a` is the LHS of a binop we
|
// However, this is not exactly right. When `let _ = a` is the LHS of a binop we
|
||||||
// need parens sometimes. E.g. we can print `(let _ = a) && b` as `let _ = a && b`
|
// need parens sometimes. E.g. we can print `(let _ = a) && b` as `let _ = a && b`
|
||||||
// but we need to print `(let _ = a) < b` as-is with parens.
|
// but we need to print `(let _ = a) < b` as-is with parens.
|
||||||
ExprPrecedence::Let |
|
| ExprPrecedence::Let
|
||||||
ExprPrecedence::Unary => PREC_PREFIX,
|
| ExprPrecedence::Unary => PREC_PREFIX,
|
||||||
|
|
||||||
// Unary, postfix
|
// Unary, postfix
|
||||||
ExprPrecedence::Await |
|
ExprPrecedence::Await
|
||||||
ExprPrecedence::Call |
|
| ExprPrecedence::Call
|
||||||
ExprPrecedence::MethodCall |
|
| ExprPrecedence::MethodCall
|
||||||
ExprPrecedence::Field |
|
| ExprPrecedence::Field
|
||||||
ExprPrecedence::Index |
|
| ExprPrecedence::Index
|
||||||
ExprPrecedence::Try |
|
| ExprPrecedence::Try
|
||||||
ExprPrecedence::InlineAsm |
|
| ExprPrecedence::InlineAsm
|
||||||
ExprPrecedence::Mac => PREC_POSTFIX,
|
| ExprPrecedence::Mac => PREC_POSTFIX,
|
||||||
|
|
||||||
// Never need parens
|
// Never need parens
|
||||||
ExprPrecedence::Array |
|
ExprPrecedence::Array
|
||||||
ExprPrecedence::Repeat |
|
| ExprPrecedence::Repeat
|
||||||
ExprPrecedence::Tup |
|
| ExprPrecedence::Tup
|
||||||
ExprPrecedence::Lit |
|
| ExprPrecedence::Lit
|
||||||
ExprPrecedence::Path |
|
| ExprPrecedence::Path
|
||||||
ExprPrecedence::Paren |
|
| ExprPrecedence::Paren
|
||||||
ExprPrecedence::If |
|
| ExprPrecedence::If
|
||||||
ExprPrecedence::While |
|
| ExprPrecedence::While
|
||||||
ExprPrecedence::ForLoop |
|
| ExprPrecedence::ForLoop
|
||||||
ExprPrecedence::Loop |
|
| ExprPrecedence::Loop
|
||||||
ExprPrecedence::Match |
|
| ExprPrecedence::Match
|
||||||
ExprPrecedence::ConstBlock |
|
| ExprPrecedence::ConstBlock
|
||||||
ExprPrecedence::Block |
|
| ExprPrecedence::Block
|
||||||
ExprPrecedence::TryBlock |
|
| ExprPrecedence::TryBlock
|
||||||
ExprPrecedence::Async |
|
| ExprPrecedence::Async
|
||||||
ExprPrecedence::Struct |
|
| ExprPrecedence::Struct
|
||||||
ExprPrecedence::Err => PREC_PAREN,
|
| ExprPrecedence::Err => PREC_PAREN,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,11 +139,10 @@ impl LifetimeName {
|
|||||||
match self {
|
match self {
|
||||||
LifetimeName::ImplicitObjectLifetimeDefault | LifetimeName::Infer => true,
|
LifetimeName::ImplicitObjectLifetimeDefault | LifetimeName::Infer => true,
|
||||||
|
|
||||||
// It might seem surprising that `Fresh` counts as
|
// It might seem surprising that `Fresh` counts as not *elided*
|
||||||
// *not* elided -- but this is because, as far as the code
|
// -- but this is because, as far as the code in the compiler is
|
||||||
// in the compiler is concerned -- `Fresh` variants act
|
// concerned -- `Fresh` variants act equivalently to "some fresh name".
|
||||||
// equivalently to "some fresh name". They correspond to
|
// They correspond to early-bound regions on an impl, in other words.
|
||||||
// early-bound regions on an impl, in other words.
|
|
||||||
LifetimeName::Error | LifetimeName::Param(..) | LifetimeName::Static => false,
|
LifetimeName::Error | LifetimeName::Param(..) | LifetimeName::Static => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1666,7 +1666,8 @@ impl CheckAttrVisitor<'_> {
|
|||||||
E0552,
|
E0552,
|
||||||
"unrecognized representation hint"
|
"unrecognized representation hint"
|
||||||
)
|
)
|
||||||
.help("valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`")
|
.help("valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, \
|
||||||
|
`i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`")
|
||||||
.emit();
|
.emit();
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user