Skip to content

Rollup of 12 pull requests #67648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
01599fc
note other end-point when typeck range pats
Centril Dec 13, 2019
e77b9d3
refactor parse_field
Centril Dec 4, 2019
8480b31
extract recover_struct_comma_after_dotdot
Centril Dec 4, 2019
701b974
extract find_struct_error_after_field_looking_code
Centril Dec 4, 2019
66b8ae4
extract error_struct_lit_not_allowed_here
Centril Dec 4, 2019
f6e2bdc
extract is_certainly_not_a_block
Centril Dec 4, 2019
de2e443
make parse_async_block conventional
Centril Dec 6, 2019
7262dcc
refactor loop parsing a bit
Centril Dec 6, 2019
44ff4df
more recovery in if-parsing
Centril Dec 6, 2019
7bcc325
refactor parse_if_expr
Centril Dec 6, 2019
ad6f91a
refactor parse_fn_block_param
Centril Dec 6, 2019
f647c11
simplify parse_fn_block_decl
Centril Dec 6, 2019
aa8adba
simplify parse_literal_maybe_minus
Centril Dec 6, 2019
0bb3dad
extract error_float_lits-must_have_int_part
Centril Dec 6, 2019
98701b2
extract parse_index_expr & refactor parse_dot_suffix
Centril Dec 6, 2019
287ba5d
extract parse_fn_call_expr
Centril Dec 6, 2019
a15d0cd
extract parse_tuple_field_access_expr
Centril Dec 6, 2019
ff5762b
extract recover_field_access_by_float_lit
Centril Dec 6, 2019
9c6bbf1
extract error_unexpected_after_dot and de-fatalize
Centril Dec 6, 2019
bc95228
extract parse_dot_suffix_expr
Centril Dec 7, 2019
7ae12c9
extract parse_dot_base_expr
Centril Dec 7, 2019
af5ac23
simplify parse_dot_call_or_expr
Centril Dec 7, 2019
84f9bf1
refactor parse_address_of -> parse_borrow_expr
Centril Dec 7, 2019
00cc8a1
simplify parse_assoc_op_cast
Centril Dec 7, 2019
80eeefb
extract recover_not_expr
Centril Dec 7, 2019
ada388b
extract is_mistaken_not_ident_negation
Centril Dec 7, 2019
f6ab439
extract parse_deref_expr
Centril Dec 7, 2019
4cfcfe9
extract parse_neg_expr
Centril Dec 7, 2019
efdea63
extract parse_prefix_expr
Centril Dec 7, 2019
8456c40
extract parse_not_expr
Centril Dec 7, 2019
e43a7ef
simplify parse_prefix_range_expr
Centril Dec 7, 2019
05c26a4
refactor assoc op parsing
Centril Dec 7, 2019
7a246ac
fix rebase fallout
Centril Dec 23, 2019
3c56a65
reuse `capacity` variable in slice::repeat
king6cong Dec 24, 2019
43cb37e
Use issue = "none" instead of "0" in intrinsics
KamilaBorowska Dec 25, 2019
b98633b
Store callbacks in global statics
Mark-Simulacrum Dec 25, 2019
4dcc627
Fix skipped setting of syntax::GLOBALS
Mark-Simulacrum Dec 25, 2019
b8ccc0f
Remove `compiler_builtins_lib` documentation
kraai Dec 25, 2019
21e636f
Remove redundant link texts
kraai Dec 26, 2019
2f43313
Convert collapsed to shortcut reference links
kraai Dec 26, 2019
be9a3c6
Update .mailmap
pvdrz Dec 26, 2019
9c0f3f7
Document safety of Path casting
Mark-Simulacrum Dec 26, 2019
e3c814e
prune ill-conceived BTreeMap iter_mut assertion and test more
ssomers Dec 20, 2019
1e40681
Don't ICE on the use of integer addresses for ZST constants in patter…
oli-obk Dec 13, 2019
b5b5258
Retire `to_ptr` which should already have no users but still kept get…
oli-obk Dec 13, 2019
bb1ecee
Simplify `force_allocation_maybe_sized`
oli-obk Dec 13, 2019
13694de
Comment on a few odd things that we should look at
oli-obk Dec 13, 2019
a0bd1a6
Prevent an ICE on invalid transmutes
oli-obk Dec 13, 2019
0e969b7
Interning even happens when validation of a constant fails
oli-obk Dec 14, 2019
a7a011d
Immediately evaluate and validate constants when we want them as oper…
oli-obk Dec 20, 2019
6b651b1
Add regression test for ZST statics being allowed to "read" from them…
oli-obk Dec 20, 2019
41d5818
Explain ParamEnv::reveal_all usage
oli-obk Dec 22, 2019
8a88ff1
Comments should start capitalized and end in a period
oli-obk Dec 22, 2019
cb8d1c3
Explain what we are doing with parameter environments for statics
oli-obk Dec 22, 2019
6937ca2
Explain the currently necessary existance of `TransmuteSizeDiff`
oli-obk Dec 22, 2019
72ebce0
Remove unintended noisy log statement
oli-obk Dec 22, 2019
0e3fafa
Typo
oli-obk Dec 22, 2019
9520551
Explain why `const_eval` is ok here
oli-obk Dec 22, 2019
1acbf4b
Early abort instead of building up zero sized values
oli-obk Dec 22, 2019
20c1b3f
Add a `const_eval` helper to `InterpCx`
oli-obk Dec 22, 2019
1531c39
Documentation nit
oli-obk Dec 22, 2019
b476344
Reintroduce the recursion comment
oli-obk Dec 22, 2019
aaffe12
Use the targetted const eval functions
oli-obk Dec 23, 2019
12a4c2c
Fix rebase fallout
oli-obk Dec 23, 2019
f65a91e
Make ui test bitwidth independent
oli-obk Dec 24, 2019
143f62f
Rollup merge of #67112 - Centril:expr-polish, r=estebank
Mark-Simulacrum Dec 26, 2019
0db3e03
Rollup merge of #67192 - oli-obk:const_zst_addr, r=RalfJung,varkor
Mark-Simulacrum Dec 26, 2019
2896a4c
Rollup merge of #67287 - Centril:mismatch-range-improve-diag, r=estebank
Mark-Simulacrum Dec 26, 2019
6ef9970
Rollup merge of #67459 - ssomers:#67438, r=RalfJung
Mark-Simulacrum Dec 26, 2019
ae68d83
Rollup merge of #67576 - king6cong:slice_repeat, r=Dylan-DPC
Mark-Simulacrum Dec 26, 2019
6f7b2c7
Rollup merge of #67602 - xfix:use-issue-none-instead-of-0-in-intrinsi…
Mark-Simulacrum Dec 26, 2019
d6a0826
Rollup merge of #67614 - Mark-Simulacrum:global-callbacks, r=Zoxc
Mark-Simulacrum Dec 26, 2019
67468b7
Rollup merge of #67617 - kraai:remove-compiler_builtins_lib-docs, r=D…
Mark-Simulacrum Dec 26, 2019
bcdc0a7
Rollup merge of #67629 - kraai:remove-redundant-link-texts, r=stevekl…
Mark-Simulacrum Dec 26, 2019
d619606
Rollup merge of #67632 - kraai:remove-collapsed-reference-links, r=st…
Mark-Simulacrum Dec 26, 2019
6a827fb
Rollup merge of #67633 - christianpoveda:patch-1, r=Mark-Simulacrum
Mark-Simulacrum Dec 26, 2019
bcb7553
Rollup merge of #67635 - Mark-Simulacrum:path-doc-unsafe, r=dtolnay
Mark-Simulacrum Dec 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify parse_literal_maybe_minus
  • Loading branch information
Centril committed Dec 23, 2019
commit aa8adba8fbd408d94af21fbf768ffab95f7866ef
12 changes: 4 additions & 8 deletions src/librustc_parse/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1280,17 +1280,13 @@ impl<'a> Parser<'a> {
pub fn parse_literal_maybe_minus(&mut self) -> PResult<'a, P<Expr>> {
maybe_whole_expr!(self);

let minus_lo = self.token.span;
let minus_present = self.eat(&token::BinOp(token::Minus));
let lo = self.token.span;
let literal = self.parse_lit()?;
let hi = self.prev_span;
let expr = self.mk_expr(lo.to(hi), ExprKind::Lit(literal), AttrVec::new());
let minus_present = self.eat(&token::BinOp(token::Minus));
let lit = self.parse_lit()?;
let expr = self.mk_expr(lit.span, ExprKind::Lit(lit), AttrVec::new());

if minus_present {
let minus_hi = self.prev_span;
let unary = self.mk_unary(UnOp::Neg, expr);
Ok(self.mk_expr(minus_lo.to(minus_hi), unary, AttrVec::new()))
Ok(self.mk_expr(lo.to(self.prev_span), self.mk_unary(UnOp::Neg, expr), AttrVec::new()))
} else {
Ok(expr)
}
Expand Down