Omit integer suffix when unnecessary
See PR # 21378 for context
This commit is contained in:
parent
ca4b9674c2
commit
9683745fed
15 changed files with 142 additions and 142 deletions
|
@ -740,7 +740,7 @@ impl<'a> Parser<'a> {
|
|||
// would encounter a `>` and stop. This lets the parser handle trailing
|
||||
// commas in generic parameters, because it can stop either after
|
||||
// parsing a type or after parsing a comma.
|
||||
for i in iter::count(0us, 1) {
|
||||
for i in iter::count(0, 1) {
|
||||
if self.check(&token::Gt)
|
||||
|| self.token == token::BinOp(token::Shr)
|
||||
|| self.token == token::Ge
|
||||
|
@ -917,7 +917,7 @@ impl<'a> Parser<'a> {
|
|||
};
|
||||
self.span = next.sp;
|
||||
self.token = next.tok;
|
||||
self.tokens_consumed += 1us;
|
||||
self.tokens_consumed += 1;
|
||||
self.expected_tokens.clear();
|
||||
// check after each token
|
||||
self.check_unknown_macro_variable();
|
||||
|
@ -2625,7 +2625,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
|
||||
pub fn check_unknown_macro_variable(&mut self) {
|
||||
if self.quote_depth == 0us {
|
||||
if self.quote_depth == 0 {
|
||||
match self.token {
|
||||
token::SubstNt(name, _) =>
|
||||
self.fatal(&format!("unknown macro variable `{}`",
|
||||
|
@ -2694,7 +2694,7 @@ impl<'a> Parser<'a> {
|
|||
token_str)[])
|
||||
},
|
||||
/* we ought to allow different depths of unquotation */
|
||||
token::Dollar | token::SubstNt(..) if p.quote_depth > 0us => {
|
||||
token::Dollar | token::SubstNt(..) if p.quote_depth > 0 => {
|
||||
p.parse_unquoted()
|
||||
}
|
||||
_ => {
|
||||
|
@ -5633,7 +5633,7 @@ impl<'a> Parser<'a> {
|
|||
return Ok(item);
|
||||
}
|
||||
if self.token.is_keyword(keywords::Unsafe) &&
|
||||
self.look_ahead(1us, |t| t.is_keyword(keywords::Trait))
|
||||
self.look_ahead(1, |t| t.is_keyword(keywords::Trait))
|
||||
{
|
||||
// UNSAFE TRAIT ITEM
|
||||
self.expect_keyword(keywords::Unsafe);
|
||||
|
@ -5650,7 +5650,7 @@ impl<'a> Parser<'a> {
|
|||
return Ok(item);
|
||||
}
|
||||
if self.token.is_keyword(keywords::Unsafe) &&
|
||||
self.look_ahead(1us, |t| t.is_keyword(keywords::Impl))
|
||||
self.look_ahead(1, |t| t.is_keyword(keywords::Impl))
|
||||
{
|
||||
// IMPL ITEM
|
||||
self.expect_keyword(keywords::Unsafe);
|
||||
|
@ -5680,7 +5680,7 @@ impl<'a> Parser<'a> {
|
|||
return Ok(item);
|
||||
}
|
||||
if self.token.is_keyword(keywords::Unsafe)
|
||||
&& self.look_ahead(1us, |t| *t != token::OpenDelim(token::Brace)) {
|
||||
&& self.look_ahead(1, |t| *t != token::OpenDelim(token::Brace)) {
|
||||
// UNSAFE FUNCTION ITEM
|
||||
self.bump();
|
||||
let abi = if self.eat_keyword(keywords::Extern) {
|
||||
|
@ -5958,7 +5958,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
}
|
||||
let mut rename_to = path[path.len() - 1us];
|
||||
let mut rename_to = path[path.len() - 1];
|
||||
let path = ast::Path {
|
||||
span: mk_sp(lo, self.last_span.hi),
|
||||
global: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue