Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a0ab5a3
Add Result::cloned{,_err} and Result::copied{,_err}
ksqsf Jul 31, 2019
c784720
Fix issue and impl
ksqsf Jul 31, 2019
5a36b0d
Make these methods public
ksqsf Jul 31, 2019
6c13081
Rename {copied,cloned} to {copied,cloned}_ok, and add {copied,cloned}…
ksqsf Jul 31, 2019
4b2f598
Revert "cloned/copied"
ksqsf Aug 1, 2019
9733f0d
Fix doc tests
ksqsf Aug 1, 2019
61e5286
Remove Err variants of cloned and copied
ksqsf Aug 2, 2019
b2b9b81
Account for doc comments coming from proc macros without spans
estebank Aug 27, 2019
7ed542d
add regression test
estebank Aug 27, 2019
820aa5b
Stabilize pin_into_inner in 1.39.0
ghedo Aug 28, 2019
5da1123
Update zx_time_t to an i64
tmandry Aug 30, 2019
403701f
Don't try to use /dev/null on Fuchsia
tmandry Aug 30, 2019
7bfa2be
fuchsia: Don't fail to spawn if no stdin exists
tmandry Aug 31, 2019
5f91ad0
fuchsia: Fix default environment behavior when spawning
tmandry Aug 31, 2019
3c4d157
Fix unlock ordering in SGX synchronization primitives
Aug 31, 2019
754a875
Add some more tests for underscore imports
matthewjasper Aug 31, 2019
b0bb301
Update xLTO compatibility table in rustc book.
michaelwoerister Sep 2, 2019
8c74eb7
Move path parsing earlier.
nnethercote Sep 3, 2019
23c76ff
Added warning around code with reference to uninit bytes
Sep 3, 2019
b03d3dc
Changed comment to better reflect std's exceptional situation
Sep 3, 2019
fa893a3
use TokenStream rather than &[TokenTree] for built-in macros
matklad Aug 31, 2019
6136495
use consistent naming for buildin expansion functions
matklad Sep 3, 2019
091e975
Rollup merge of #63166 - ksqsf:master, r=alexcrichton
Centril Sep 4, 2019
128baa4
Rollup merge of #63930 - estebank:rustdoc-ice, r=GuillaumeGomez
Centril Sep 4, 2019
820a380
Rollup merge of #63985 - ghedo:stabilize_pin_into_inner, r=alexcrichton
Centril Sep 4, 2019
e9160d0
Rollup merge of #64023 - tmandry:libstd-fuchsia-fixes, r=cramertj
Centril Sep 4, 2019
7d45eaf
Rollup merge of #64030 - jethrogb:jb/sgx-sync-issues, r=alexcrichton
Centril Sep 4, 2019
c334526
Rollup merge of #64041 - matklad:token-stream-tt, r=petrochenkov
Centril Sep 4, 2019
04bf85d
Rollup merge of #64043 - matthewjasper:underscore-import-tests, r=ale…
Centril Sep 4, 2019
2df6c7b
Rollup merge of #64092 - michaelwoerister:update-xlto-table-rustc-boo…
Centril Sep 4, 2019
7cd097e
Rollup merge of #64120 - nnethercote:move-path-parsing-earlier, r=pet…
Centril Sep 4, 2019
3a68bee
Rollup merge of #64123 - danielhenrymantilla:add_comment_about_uninit…
Centril Sep 4, 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
Move path parsing earlier.
It's a hot enough path that moving it slightly earlier gives a tiny but
easy speedup.
  • Loading branch information
nnethercote committed Sep 3, 2019
commit 8c74eb77902dc5c4fdf853e9159dd5fadd00601d
56 changes: 30 additions & 26 deletions src/libsyntax/parse/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,36 @@ impl<'a> Parser<'a> {
hi = path.span;
return Ok(self.mk_expr(lo.to(hi), ExprKind::Path(Some(qself), path), attrs));
}
if self.token.is_path_start() {
let path = self.parse_path(PathStyle::Expr)?;

// `!`, as an operator, is prefix, so we know this isn't that
if self.eat(&token::Not) {
// MACRO INVOCATION expression
let (delim, tts) = self.expect_delimited_token_tree()?;
hi = self.prev_span;
ex = ExprKind::Mac(Mac {
path,
tts,
delim,
span: lo.to(hi),
prior_type_ascription: self.last_type_ascription,
});
} else if self.check(&token::OpenDelim(token::Brace)) {
if let Some(expr) = self.maybe_parse_struct_expr(lo, &path, &attrs) {
return expr;
} else {
hi = path.span;
ex = ExprKind::Path(None, path);
}
} else {
hi = path.span;
ex = ExprKind::Path(None, path);
}

let expr = self.mk_expr(lo.to(hi), ex, attrs);
return self.maybe_recover_from_bad_qpath(expr, true);
}
if self.check_keyword(kw::Move) || self.check_keyword(kw::Static) {
return self.parse_lambda_expr(attrs);
}
Expand Down Expand Up @@ -1007,32 +1037,6 @@ impl<'a> Parser<'a> {
let (await_hi, e_kind) = self.parse_incorrect_await_syntax(lo, self.prev_span)?;
hi = await_hi;
ex = e_kind;
} else if self.token.is_path_start() {
let path = self.parse_path(PathStyle::Expr)?;

// `!`, as an operator, is prefix, so we know this isn't that
if self.eat(&token::Not) {
// MACRO INVOCATION expression
let (delim, tts) = self.expect_delimited_token_tree()?;
hi = self.prev_span;
ex = ExprKind::Mac(Mac {
path,
tts,
delim,
span: lo.to(hi),
prior_type_ascription: self.last_type_ascription,
});
} else if self.check(&token::OpenDelim(token::Brace)) {
if let Some(expr) = self.maybe_parse_struct_expr(lo, &path, &attrs) {
return expr;
} else {
hi = path.span;
ex = ExprKind::Path(None, path);
}
} else {
hi = path.span;
ex = ExprKind::Path(None, path);
}
} else {
if !self.unclosed_delims.is_empty() && self.check(&token::Semi) {
// Don't complain about bare semicolons after unclosed braces
Expand Down