Commit Graph

660 Commits

Author SHA1 Message Date
Dylan DPC
6545985888
Rollup merge of #76274 - scottmcm:fix-76271, r=petrochenkov
Allow try blocks as the argument to return expressions

Fixes #76271

I don't think this needs to be edition-aware (phew) since `return try` in 2015 is also the start of an expression, just with a struct literal instead of a block (`return try { x: 4, y: 5 }`).
2020-09-07 01:17:46 +02:00
bors
ffaf158608 Auto merge of #76331 - Aaron1011:fix/group-compat-hack-test, r=petrochenkov
Account for version number in NtIdent hack

Issue #74616 tracks a backwards-compatibility hack for certain macros.
This has is implemented by hard-coding the filenames and macro names of
certain code that we want to continue to compile.

However, the initial implementation of the hack was based on the
directory structure when building the crate from its repository (e.g.
`js-sys/src/lib.rs`). When the crate is build as a dependency, it will
include a version number from the clone from the cargo registry (e.g.
`js-sys-0.3.17/src/lib.rs`), which would fail the check.

This commit modifies the backwards-compatibility hack to check that
desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the
proper part of the path.

See https://github.com/rust-lang/rust/issues/76070#issuecomment-687215646
for more details.
2020-09-06 06:15:28 +00:00
Aaron Hill
9e7ef659e1
Account for version number in NtIdent hack
Issue #74616 tracks a backwards-compatibility hack for certain macros.
This has is implemented by hard-coding the filenames and macro names of
certain code that we want to continue to compile.

However, the initial implementation of the hack was based on the
directory structure when building the crate from its repository (e.g.
`js-sys/src/lib.rs`). When the crate is build as a dependency, it will
include a version number from the clone from the cargo registry (e.g.
`js-sys-0.3.17/src/lib.rs`), which would fail the check.

This commit modifies the backwards-compatibility hack to check that
desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the
proper part of the path.

See https://github.com/rust-lang/rust/issues/76070#issuecomment-687215646
for more details.
2020-09-04 13:10:23 -04:00
Aleksey Kladov
09d3db2e59 Optimize Cursor::look_ahead
Cloning a tt is cheap, but not free (there's Arc inside).
2020-09-03 23:28:22 +02:00
Aleksey Kladov
ccf41dd5eb Rename IsJoint -> Spacing
To match better naming from proc-macro
2020-09-03 17:32:45 +02:00
Scott McMurray
791f93c796 Allow try blocks as the argument to return expressions
Fixes 76271
2020-09-02 23:39:50 -07:00
bors
b4acb11033 Auto merge of #76170 - matklad:notrivia, r=petrochenkov
Remove trivia tokens

r? @ghost
2020-09-02 03:19:38 +00:00
Aleksey Kladov
5326361fc0 Remove trivia tokens 2020-09-01 11:39:11 +02:00
Aaron Hill
090b16717a
Factor out StmtKind::MacCall fields into MacCallStmt struct
In PR #76130, I add a fourth field, which makes using a tuple variant
somewhat unwieldy.
2020-08-30 18:38:53 -04:00
mark
9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00