]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoSupport linking from a .rlink file
Victor Ding [Thu, 23 Jan 2020 10:48:48 +0000 (21:48 +1100)]
Support linking from a .rlink file

Flag `-Z no-link` was previously introduced, which allows creating
an `.rlink` file to perform compilation without linking.
This change enables linking from an `.rlink` file.

4 years agoAuto merge of #68601 - 0dvictor:split, r=tmandry
bors [Tue, 4 Feb 2020 05:48:54 +0000 (05:48 +0000)]
Auto merge of #68601 - 0dvictor:split, r=tmandry

Split `join_codegen_and_link()` into two steps

`join_codegen_and_link()` is split to `join_codegen()` and `link()`.

4 years agoSplit `join_codegen_and_link()` into two steps
Victor Ding [Tue, 28 Jan 2020 13:16:14 +0000 (00:16 +1100)]
Split `join_codegen_and_link()` into two steps

`join_codegen_and_link()` is split to `join_codegen()` and `link()`.

4 years agoAuto merge of #67668 - matthewjasper:or-patterns, r=pnkfelix
bors [Mon, 3 Feb 2020 22:02:26 +0000 (22:02 +0000)]
Auto merge of #67668 - matthewjasper:or-patterns, r=pnkfelix

Implement MIR lowering for or-patterns

This is the last thing needed to get meaningful run-pass tests for or-patterns. There probably need to be more tests before stabilizing this, but the most important cases should have been covered.

Note: we can generate exponentially large MIR CFGs when using or-patterns containing bindings, type ascriptions, or that are for a match arm with a guard. `src/test/mir-opt/exponential-or.rs` shows the best case for what we currently do.

cc #54883
closes #60350
closes #67514

cc @Centril
r? @pnkfelix

4 years agoAvoid scheduling repeated `StorageDead`s
Matthew Jasper [Sat, 25 Jan 2020 00:10:40 +0000 (00:10 +0000)]
Avoid scheduling repeated `StorageDead`s

Also add some comments

4 years agoMake use of `Place: Copy`
Matthew Jasper [Sat, 11 Jan 2020 20:30:42 +0000 (20:30 +0000)]
Make use of `Place: Copy`

4 years agoApply suggestions from code review
matthewjasper [Mon, 30 Dec 2019 17:47:10 +0000 (17:47 +0000)]
Apply suggestions from code review

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoAddress review comments
Matthew Jasper [Sun, 29 Dec 2019 17:28:41 +0000 (17:28 +0000)]
Address review comments

4 years agoMake `Candidate` private
Matthew Jasper [Sun, 29 Dec 2019 17:00:23 +0000 (17:00 +0000)]
Make `Candidate` private

4 years agoAdd more tests for or-patterns
Matthew Jasper [Fri, 27 Dec 2019 18:11:20 +0000 (18:11 +0000)]
Add more tests for or-patterns

4 years agoAuto merge of #68803 - Dylan-DPC:rollup-b4x6ghj, r=Dylan-DPC
bors [Mon, 3 Feb 2020 18:40:54 +0000 (18:40 +0000)]
Auto merge of #68803 - Dylan-DPC:rollup-b4x6ghj, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #68678 (Install robots.txt into rust-docs tarballs)
 - #68711 (Added upper bound of what vecs and boxes can allocate)
 - #68744 (Do not ICE in `type-alias-impl-trait` with save-analysis)
 - #68777 (Clean up E0263 explanation)
 - #68787 (Optimize core::ptr::align_offset (part 1))
 - #68797 (Fix links to types instead of modules)
 - #68798 (Test that `#[track_caller]` as `fn()` respects RT / CTFE equivalence)
 - #68800 (Stabilize `core::iter::once_with()`)

Failed merges:

r? @ghost

4 years agoRollup merge of #68800 - JohnTitor:stabilize-once-with, r=Centril
Dylan DPC [Mon, 3 Feb 2020 17:58:37 +0000 (18:58 +0100)]
Rollup merge of #68800 - JohnTitor:stabilize-once-with, r=Centril

Stabilize `core::iter::once_with()`

Fixes #57581

FCP: https://github.com/rust-lang/rust/issues/57581#issuecomment-576178031

r? @SimonSapin

4 years agoRollup merge of #68798 - Centril:caller-loc-ctfe-rt-equiv, r=RalfJung
Dylan DPC [Mon, 3 Feb 2020 17:58:36 +0000 (18:58 +0100)]
Rollup merge of #68798 - Centril:caller-loc-ctfe-rt-equiv, r=RalfJung

Test that `#[track_caller]` as `fn()` respects RT / CTFE equivalence

r? @RalfJung cc @anp @eddyb

4 years agoRollup merge of #68797 - GuillaumeGomez:link-to-types, r=Dylan-DPC
Dylan DPC [Mon, 3 Feb 2020 17:58:35 +0000 (18:58 +0100)]
Rollup merge of #68797 - GuillaumeGomez:link-to-types, r=Dylan-DPC

Fix links to types instead of modules

r? @Dylan-DPC

4 years agoRollup merge of #68787 - amosonn:patch-1, r=nagisa
Dylan DPC [Mon, 3 Feb 2020 17:58:33 +0000 (18:58 +0100)]
Rollup merge of #68787 - amosonn:patch-1, r=nagisa

Optimize core::ptr::align_offset (part 1)

r? @nagisa
See #68616 for main discussion.

4 years agoRollup merge of #68777 - GuillaumeGomez:clean-up-e0263, r=Dylan-DPC
Dylan DPC [Mon, 3 Feb 2020 17:58:32 +0000 (18:58 +0100)]
Rollup merge of #68777 - GuillaumeGomez:clean-up-e0263, r=Dylan-DPC

Clean up E0263 explanation

r? @Dylan-DPC

4 years agoRollup merge of #68744 - JohnTitor:fix-ice-save-analysis, r=cramertj
Dylan DPC [Mon, 3 Feb 2020 17:58:30 +0000 (18:58 +0100)]
Rollup merge of #68744 - JohnTitor:fix-ice-save-analysis, r=cramertj

Do not ICE in `type-alias-impl-trait` with save-analysis

FIxes #68621
Fixes #68750

4 years agoRollup merge of #68711 - hman523:fix-68593, r=Dylan-DPC
Dylan DPC [Mon, 3 Feb 2020 17:58:27 +0000 (18:58 +0100)]
Rollup merge of #68711 - hman523:fix-68593, r=Dylan-DPC

Added upper bound of what vecs and boxes can allocate

Fixed issue #68593
I added a line of documentation to these two files to reflect that vectors and boxes ensure that they never allocate more than `isize::MAX` bytes.
r? @steveklabnik

4 years agoRollup merge of #68678 - Mark-Simulacrum:robots, r=pietroalbini
Dylan DPC [Mon, 3 Feb 2020 17:58:23 +0000 (18:58 +0100)]
Rollup merge of #68678 - Mark-Simulacrum:robots, r=pietroalbini

Install robots.txt into rust-docs tarballs

Fixes #68677.

I believe this might just work out from the central-station perspective, but even if it doesn't, this is a prerequisite step anyway.

4 years agoStabilize `core::iter::once_with()`
Yuki Okushi [Mon, 3 Feb 2020 15:47:04 +0000 (00:47 +0900)]
Stabilize `core::iter::once_with()`

4 years agotrack_caller test caller_location ctfe/rt equivalence wrt. fnptrs
Mazdak Farrokhzad [Mon, 3 Feb 2020 15:15:30 +0000 (16:15 +0100)]
track_caller test caller_location ctfe/rt equivalence wrt. fnptrs

4 years agoFix links to types instead of modules
Guillaume Gomez [Mon, 3 Feb 2020 15:12:35 +0000 (16:12 +0100)]
Fix links to types instead of modules

4 years agoAuto merge of #68665 - eddyb:debuginfo-early-create-var, r=nagisa
bors [Mon, 3 Feb 2020 13:06:44 +0000 (13:06 +0000)]
Auto merge of #68665 - eddyb:debuginfo-early-create-var, r=nagisa

codegen: create DIVariables ahead of using them with llvm.dbg.declare.

Instead of having `rustc_codegen_llvm` bundle creation of a `DIVariable` and `llvm.dbg.declare` into a single operation, they are now two separate methods, and the `DIVariable` is created earlier, specifically when `mir::VarDebugInfo`s are being partitioned into locals.

While this isn't currently needed, it's a prerequisite for #48300, which adds fragmented debuginfo, where one `mir::VarDebugInfo` has multiple parts of itself mapped to different `mir::Place`s.
For debuggers to see one composite variable instead of several ones with the same name, we need to create a single `DIVariable` and share it between multiple `llvm.dbg.declare` calls, which are likely pointing to different MIR locals.
That makes the `per_local_var_debug_info` partitioning a good spot to do this in, as we can create *exactly* one `DIVariable` per `mir::VarDebugInfo`, and refer to it as many things as needed.

I'm opening this PR separately because I want to test its perf impact in isolation (see https://github.com/rust-lang/rust/pull/48300#issuecomment-580121438).

r? @nagisa or @oli-obk cc @michaelwoerister @nikomatsakis

4 years agorustc_codegen_llvm: avoid redundant calls to span_start.
Eduard-Mihai Burtescu [Mon, 3 Feb 2020 10:14:05 +0000 (12:14 +0200)]
rustc_codegen_llvm: avoid redundant calls to span_start.

4 years agorustc_codegen_ssa: convert mir::VarDebugInfo into a custom PerLocalVarDebugInfo.
Eduard-Mihai Burtescu [Wed, 22 Jan 2020 17:45:22 +0000 (19:45 +0200)]
rustc_codegen_ssa: convert mir::VarDebugInfo into a custom PerLocalVarDebugInfo.

4 years agorustc_codegen_ssa: split declare_local into create_dbg_var and dbg_var_addr.
Eduard-Mihai Burtescu [Sun, 26 Jan 2020 16:50:13 +0000 (18:50 +0200)]
rustc_codegen_ssa: split declare_local into create_dbg_var and dbg_var_addr.

4 years agoAuto merge of #68778 - RalfJung:raw-addr-of, r=eddyb
bors [Mon, 3 Feb 2020 09:54:09 +0000 (09:54 +0000)]
Auto merge of #68778 - RalfJung:raw-addr-of, r=eddyb

add raw-addr-of variant to mir_raw_fat_ptr

As suggested at https://github.com/rust-lang/rust/pull/48300#discussion_r372520388

r? @eddyb

4 years agoAuto merge of #68772 - matthewjasper:relate-opt, r=davidtwco
bors [Mon, 3 Feb 2020 06:38:34 +0000 (06:38 +0000)]
Auto merge of #68772 - matthewjasper:relate-opt, r=davidtwco

Avoid exponential behaviour when relating types

When equating bound types we check subtyping in both directions. Since closures are invariant in their substs, we end up comparing the two types an exponential number of times. If there are no bound variables this isn't needed.

Closes #68061

4 years agoAuto merge of #68756 - JohnTitor:fix-ice-save-analysis-2, r=davidtwco
bors [Mon, 3 Feb 2020 03:28:08 +0000 (03:28 +0000)]
Auto merge of #68756 - JohnTitor:fix-ice-save-analysis-2, r=davidtwco

Fix ICE with save-analysis

Fixes #68749

It should be fine since it's the same way as `visit_expr`.

4 years agoAuto merge of #68735 - JohnTitor:fix-ice-0202, r=estebank
bors [Mon, 3 Feb 2020 00:04:16 +0000 (00:04 +0000)]
Auto merge of #68735 - JohnTitor:fix-ice-0202, r=estebank

Use `next_point` to avoid ICE

Fixes #68730

r? @estebank (I think you're familiar with that)

4 years agoOptimize core::ptr::align_offset
Amos Onn [Sun, 2 Feb 2020 01:18:33 +0000 (02:18 +0100)]
Optimize core::ptr::align_offset

- As explained in the comment inside mod_inv, it is valid to work mod
  `usize::max_value()` right until the end.

4 years agoOptimize core::ptr::align_offset
Amos Onn [Tue, 28 Jan 2020 21:14:04 +0000 (22:14 +0100)]
Optimize core::ptr::align_offset

- When calculating the inverse, it's enough to work `mod a/g` instead
  of `mod a`.

4 years agoOptimize core::ptr::align_offset
Amos Onn [Thu, 30 Jan 2020 19:04:24 +0000 (20:04 +0100)]
Optimize core::ptr::align_offset

- Stopping condition inside mod_inv can be >= instead of >
- Remove intrinsics::unchecked_rem, we are working modulu powers-of-2 so
we can simply mask

4 years agoAuto merge of #68720 - wesleywiser:llvm_time_trace, r=davidtwco
bors [Sun, 2 Feb 2020 20:33:47 +0000 (20:33 +0000)]
Auto merge of #68720 - wesleywiser:llvm_time_trace, r=davidtwco

Add support for enabling the LLVM time-trace feature

I found this helpful while investigating an LLVM performance issue.
Passing `-Z llvm-time-trace` causes a `llvm_timings.json` file to be
created. This file can be inspected in with the Chrome Profiler
tools or with any other compatible tool like SpeedScope.

More information on the LLVM feature:

- https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-profiler-for-Clang/

- https://reviews.llvm.org/rL357340

4 years agoadd raw-addr-of variant to mir_raw_fat_ptr
Ralf Jung [Sun, 2 Feb 2020 19:51:24 +0000 (20:51 +0100)]
add raw-addr-of variant to mir_raw_fat_ptr

4 years agoAuto merge of #68774 - RalfJung:miri, r=RalfJung
bors [Sun, 2 Feb 2020 16:58:49 +0000 (16:58 +0000)]
Auto merge of #68774 - RalfJung:miri, r=RalfJung

bump Miri

Fixes https://github.com/rust-lang/rust/issues/68757

Cc @oli-obk r? @ghost

4 years agoClean up E0263 explanation
Guillaume Gomez [Sun, 2 Feb 2020 14:28:18 +0000 (15:28 +0100)]
Clean up E0263 explanation

4 years agobump Miri
Ralf Jung [Sun, 2 Feb 2020 13:51:30 +0000 (14:51 +0100)]
bump Miri

4 years agoAuto merge of #68771 - Centril:rollup-zllcup9, r=Centril
bors [Sun, 2 Feb 2020 13:16:43 +0000 (13:16 +0000)]
Auto merge of #68771 - Centril:rollup-zllcup9, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #68733 (Update option.rs)
 - #68760 (Issue error on `compile-fail` header in UI test)
 - #68763 (Do not suggest duplicate bounds)
 - #68764 (parser: syntactically allow `self` in all `fn` contexts)
 - #68769 (parser: avoid re-wrapping NtItem)

Failed merges:

r? @ghost

4 years agoRollup merge of #68769 - Centril:unwrap, r=petrochenkov
Mazdak Farrokhzad [Sun, 2 Feb 2020 13:15:53 +0000 (14:15 +0100)]
Rollup merge of #68769 - Centril:unwrap, r=petrochenkov

parser: avoid re-wrapping NtItem

r? @petrochenkov

4 years agoRollup merge of #68764 - Centril:self-semantic, r=petrochenkov
Mazdak Farrokhzad [Sun, 2 Feb 2020 13:15:52 +0000 (14:15 +0100)]
Rollup merge of #68764 - Centril:self-semantic, r=petrochenkov

parser: syntactically allow `self` in all `fn` contexts

Part of https://github.com/rust-lang/rust/pull/68728.

`self` parameters are now *syntactically* allowed as the first parameter irrespective of item context (and in function pointers). Instead, semantic validation (`ast_validation`) is used.

r? @petrochenkov

4 years agoRollup merge of #68763 - JohnTitor:do-not-sugg-dup-bounds, r=estebank
Mazdak Farrokhzad [Sun, 2 Feb 2020 13:15:51 +0000 (14:15 +0100)]
Rollup merge of #68763 - JohnTitor:do-not-sugg-dup-bounds, r=estebank

Do not suggest duplicate bounds

Fixes #68205
Fixes #68695

r? @estebank

4 years agoRollup merge of #68760 - Tyg13:compile_fail_ui_test, r=Centril
Mazdak Farrokhzad [Sun, 2 Feb 2020 13:15:49 +0000 (14:15 +0100)]
Rollup merge of #68760 - Tyg13:compile_fail_ui_test, r=Centril

Issue error on `compile-fail` header in UI test

Fixes #68732

r? @Centril

4 years agoRollup merge of #68733 - cata0309:patch-1, r=Dylan-DPC
Mazdak Farrokhzad [Sun, 2 Feb 2020 13:15:48 +0000 (14:15 +0100)]
Rollup merge of #68733 - cata0309:patch-1, r=Dylan-DPC

Update option.rs

I updated the example of the `expect` examples so they won't contain depressing sentences any more !

4 years agoparser: avoid re-wrapping NtItem
Mazdak Farrokhzad [Fri, 31 Jan 2020 06:24:23 +0000 (07:24 +0100)]
parser: avoid re-wrapping NtItem

4 years agoparser: address review comments re. `self`.
Mazdak Farrokhzad [Sun, 2 Feb 2020 10:10:27 +0000 (11:10 +0100)]
parser: address review comments re. `self`.

4 years agoAvoid exponential behaviour when relating types
Matthew Jasper [Sun, 2 Feb 2020 11:54:11 +0000 (11:54 +0000)]
Avoid exponential behaviour when relating types

4 years agoDo not suggest duplicate bounds
Yuki Okushi [Sun, 2 Feb 2020 08:55:11 +0000 (17:55 +0900)]
Do not suggest duplicate bounds

4 years agoparser: move restrictions re. `self` to `ast_validation`.
Mazdak Farrokhzad [Wed, 29 Jan 2020 00:30:01 +0000 (01:30 +0100)]
parser: move restrictions re. `self` to `ast_validation`.

4 years agoAuto merge of #68737 - Centril:fix-68710, r=petrochenkov
bors [Sun, 2 Feb 2020 09:19:40 +0000 (09:19 +0000)]
Auto merge of #68737 - Centril:fix-68710, r=petrochenkov

pretty: print attrs in struct expr

Fixes https://github.com/rust-lang/rust/issues/68710 by printing the attributes on struct expression fields.

r? @petrochenkov
cc @dtolnay

4 years agopretty: print attrs in struct expr
Mazdak Farrokhzad [Sat, 1 Feb 2020 17:45:03 +0000 (18:45 +0100)]
pretty: print attrs in struct expr

4 years agocompiletest: error if `compile-fail` header in ui test.
Tyler Lanphear [Sun, 2 Feb 2020 06:05:53 +0000 (01:05 -0500)]
compiletest: error if `compile-fail` header in ui test.

4 years agoAuto merge of #68754 - JohnTitor:clippy-up, r=JohnTitor
bors [Sun, 2 Feb 2020 06:09:00 +0000 (06:09 +0000)]
Auto merge of #68754 - JohnTitor:clippy-up, r=JohnTitor

Update Clippy

Fixes #68745

r? @ghost

4 years agoAuto merge of #68672 - jonas-schievink:dedup-witness, r=Zoxc
bors [Sun, 2 Feb 2020 03:02:41 +0000 (03:02 +0000)]
Auto merge of #68672 - jonas-schievink:dedup-witness, r=Zoxc

Deduplicate types in the generator witness

For the `await-call-tree` benchmark this often reduces the types inside the witness from 12 to 2.

4 years agoFix ICE with save-analysis
Yuki Okushi [Sun, 2 Feb 2020 00:23:47 +0000 (09:23 +0900)]
Fix ICE with save-analysis

4 years agoCatch more ICEs
Yuki Okushi [Sun, 2 Feb 2020 00:02:54 +0000 (09:02 +0900)]
Catch more ICEs

4 years agoUpdate Clippy
Yuki Okushi [Sat, 1 Feb 2020 23:38:28 +0000 (08:38 +0900)]
Update Clippy

4 years agoAuto merge of #68752 - JohnTitor:rollup-zz3u4xl, r=JohnTitor
bors [Sat, 1 Feb 2020 23:31:51 +0000 (23:31 +0000)]
Auto merge of #68752 - JohnTitor:rollup-zz3u4xl, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #68460 (Use BufWriter for emitting MIR)
 - #68681 (Suggest path separator for single-colon typos)
 - #68688 ([docs] remind bug reporters to update nightly)
 - #68704 (Ignore `build` dir formatting)
 - #68727 (Remove a comment about pretty printer in formatting tests)
 - #68736 (Remove `Alloc` in favor of `AllocRef`)
 - #68740 (Do not suggest things named underscore)

Failed merges:

r? @ghost

4 years agoRollup merge of #68740 - JohnTitor:do-not-sugg-underscore, r=Centril
Yuki Okushi [Sat, 1 Feb 2020 23:30:21 +0000 (08:30 +0900)]
Rollup merge of #68740 - JohnTitor:do-not-sugg-underscore, r=Centril

Do not suggest things named underscore

Fixes #68719

r? @estebank

4 years agoRollup merge of #68736 - TimDiekmann:remove-alloc, r=Amanieu
Yuki Okushi [Sat, 1 Feb 2020 23:30:19 +0000 (08:30 +0900)]
Rollup merge of #68736 - TimDiekmann:remove-alloc, r=Amanieu

Remove `Alloc` in favor of `AllocRef`

`AllocRef` was reexported as `Alloc` in #68529  in order to not break toolstate in the week before the next stable release.

r? @Amanieu

4 years agoRollup merge of #68727 - xfix:remove-comment-about-pretty-printer-in-format-tests...
Yuki Okushi [Sat, 1 Feb 2020 23:30:18 +0000 (08:30 +0900)]
Rollup merge of #68727 - xfix:remove-comment-about-pretty-printer-in-format-tests, r=jonas-schievink

Remove a comment about pretty printer in formatting tests

rustc is now using rustfmt, not the old formatter.

4 years agoRollup merge of #68704 - jonas-schievink:ignore-build-fmt, r=Mark-Simulacrum
Yuki Okushi [Sat, 1 Feb 2020 23:30:16 +0000 (08:30 +0900)]
Rollup merge of #68704 - jonas-schievink:ignore-build-fmt, r=Mark-Simulacrum

Ignore `build` dir formatting

I've noticed that rustfmt tries to parse and check the formatting of code in `build` if `.git` is missing (which includes test artifacts and generated code). This should fix that.

4 years agoRollup merge of #68688 - jbr:remind-bug-reporters-to-update-if-on-nightly, r=centril
Yuki Okushi [Sat, 1 Feb 2020 23:30:15 +0000 (08:30 +0900)]
Rollup merge of #68688 - jbr:remind-bug-reporters-to-update-if-on-nightly, r=centril

[docs] remind bug reporters to update nightly

Hi and thanks for rust! Today I reported a bug in nightly that was already fixed, so I thought other potential bug reporters might appreciate a reminder to update before reporting.  I wasn't sure if this would apply for other channels as well.

4 years agoRollup merge of #68681 - bobrippling:fix-matched-angle-brackets, r=Centril
Yuki Okushi [Sat, 1 Feb 2020 23:30:11 +0000 (08:30 +0900)]
Rollup merge of #68681 - bobrippling:fix-matched-angle-brackets, r=Centril

Suggest path separator for single-colon typos

This commit adds guidance for when a user means to type a path, but ends
up typing a single colon, such as `<<Impl as T>:Ty>`.

This change seemed pertinent as the current error message is
particularly misleading, emitting `error: unmatched angle bracket`,
despite the angle bracket being matched later on, leaving the user to
track down the typo'd colon.

4 years agoRollup merge of #68460 - sinkuu:emit_mir_buffered, r=Mark-Simulacrum
Yuki Okushi [Sat, 1 Feb 2020 23:30:09 +0000 (08:30 +0900)]
Rollup merge of #68460 - sinkuu:emit_mir_buffered, r=Mark-Simulacrum

Use BufWriter for emitting MIR

I noticed that `--emit=mir` takes long time on a large crate. https://github.com/rust-lang/rust/pull/64344 seem to have fixed `-Zdump-mir`, but not `--emit=mir`.

4 years agoBasic run-pass tests for or-patterns
Dan Robertson [Sun, 14 Jul 2019 01:33:02 +0000 (01:33 +0000)]
Basic run-pass tests for or-patterns

Add some basic run-pass ui tests for or-patterns.

4 years agoUpdate existing tests for or-patterns
Matthew Jasper [Fri, 27 Dec 2019 17:53:00 +0000 (17:53 +0000)]
Update existing tests for or-patterns

4 years agoImplement general or-patterns in `let` statements
Matthew Jasper [Fri, 27 Dec 2019 17:31:21 +0000 (17:31 +0000)]
Implement general or-patterns in `let` statements

4 years agoImplement general or-patterns in `match` expressions
Matthew Jasper [Fri, 27 Dec 2019 13:39:43 +0000 (13:39 +0000)]
Implement general or-patterns in `match` expressions

4 years agoDon't create unnecessary block
Matthew Jasper [Fri, 27 Dec 2019 12:42:52 +0000 (12:42 +0000)]
Don't create unnecessary block

4 years agoGenerate prebinding blocks lazily
Matthew Jasper [Fri, 27 Dec 2019 12:25:53 +0000 (12:25 +0000)]
Generate prebinding blocks lazily

4 years agoRemove or_patterns from INCOMPLETE_FEATURES
Matthew Jasper [Fri, 27 Dec 2019 12:03:03 +0000 (12:03 +0000)]
Remove or_patterns from INCOMPLETE_FEATURES

4 years agoDo not ICE in `type-alias-impl-trait` with save-analysis
Yuki Okushi [Sat, 1 Feb 2020 21:39:50 +0000 (06:39 +0900)]
Do not ICE in `type-alias-impl-trait` with save-analysis

4 years agoDo not suggest things named underscore
Yuki Okushi [Sat, 1 Feb 2020 19:40:55 +0000 (04:40 +0900)]
Do not suggest things named underscore

4 years agoAvoid qualified path recovery when not followed by identifier
Rob Pilling [Sat, 1 Feb 2020 19:24:51 +0000 (19:24 +0000)]
Avoid qualified path recovery when not followed by identifier

4 years agoImprove wording and docs for qualified path recovery
Rob Pilling [Sat, 1 Feb 2020 19:21:54 +0000 (19:21 +0000)]
Improve wording and docs for qualified path recovery

4 years agoMove colon-check to recover_colon_before_qpath_proj()
Rob Pilling [Sat, 1 Feb 2020 19:10:42 +0000 (19:10 +0000)]
Move colon-check to recover_colon_before_qpath_proj()

4 years agoAdd support for enabling the LLVM time-trace feature
Wesley Wiser [Fri, 31 Jan 2020 23:58:28 +0000 (18:58 -0500)]
Add support for enabling the LLVM time-trace feature

I found this helpful while investigating an LLVM performance issue.
Passing `-Z llvm-time-trace` causes a `llvm_timings.json` file to be
created. This file can be inspected in either the Chrome Profiler tools
or with any other compatible tool like SpeedScope.

More information on the LLVM feature:

- https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-profiler-for-Clang/

- https://reviews.llvm.org/rL357340

4 years agoSimplify span usage and avoid .eat()
Rob Pilling [Sat, 1 Feb 2020 19:06:15 +0000 (19:06 +0000)]
Simplify span usage and avoid .eat()

4 years agoDeduplicate generator interior types
Jonas Schievink [Fri, 31 Jan 2020 14:59:14 +0000 (15:59 +0100)]
Deduplicate generator interior types

4 years agoAuto merge of #68133 - Centril:slimmer-syntax, r=petrochenkov
bors [Sat, 1 Feb 2020 18:29:09 +0000 (18:29 +0000)]
Auto merge of #68133 - Centril:slimmer-syntax, r=petrochenkov

Slimmer syntax

High-level summary of changes:

- The `syntax::node_count` pass is moved into `rustc_ast_passes`. This works towards improving #65031 by making compiling `syntax` go faster.

- The `syntax::{GLOBALS, with_globals, ..}` business is consolidated into `syntax::attr` for cleaner code and future possible improvements.

- The pretty printer loses its dependency on `ParseSess`, opting to use `SourceMap` & friends directly instead.

- Some drive by cleanup of `syntax::attr::HasAttr` happens.

- Builtin attribute logic (`syntax::attr::builtin`) + `syntax::attr::allow_internal_unstable` is moved into a new `rustc_attr` crate. More logic from `syntax::attr` should be moved into that crate over time. This also means that `syntax` loses all mentions of `ParseSess`, which enables the next point.

- The pretty printer `syntax::print` is moved into a new crate `rustc_ast_pretty`.

- `rustc_session::node_id` is moved back as `syntax::node_id`. As a result, `syntax` gets to drop dependencies on `rustc_session` (and implicitly `rustc_target`), `rustc_error_codes`, and `rustc_errors`. Moreover `rustc_hir` gets to drop its dependency on `rustc_session` as well. At this point, these crates are mostly "pure data crates", which is approaching a desirable end state.

  - We should consider renaming `syntax` to `rustc_ast` now.

4 years agopretty: raise recursion_limit = 256
Mazdak Farrokhzad [Tue, 21 Jan 2020 23:42:29 +0000 (00:42 +0100)]
pretty: raise recursion_limit = 256

4 years agofix fallout in tests
Mazdak Farrokhzad [Sat, 18 Jan 2020 18:21:05 +0000 (19:21 +0100)]
fix fallout in tests

4 years agopretty: injected_crate_name -> has_injected_crate
Mazdak Farrokhzad [Sat, 18 Jan 2020 18:01:50 +0000 (19:01 +0100)]
pretty: injected_crate_name -> has_injected_crate

4 years agosyntax: reexport attr globals
Mazdak Farrokhzad [Sat, 18 Jan 2020 17:57:06 +0000 (18:57 +0100)]
syntax: reexport attr globals

4 years agoremove rustc_ast_pretty dep from rustc
Mazdak Farrokhzad [Fri, 17 Jan 2020 13:48:38 +0000 (14:48 +0100)]
remove rustc_ast_pretty dep from rustc

4 years agopacify the parallel compiler
Mazdak Farrokhzad [Fri, 17 Jan 2020 13:42:27 +0000 (14:42 +0100)]
pacify the parallel compiler

4 years agosyntax::print -> new crate rustc_ast_pretty
Mazdak Farrokhzad [Sat, 11 Jan 2020 16:02:46 +0000 (17:02 +0100)]
syntax::print -> new crate rustc_ast_pretty

4 years ago1. move allow_internal_unstable to rustc_attr
Mazdak Farrokhzad [Sat, 11 Jan 2020 15:21:30 +0000 (16:21 +0100)]
1. move allow_internal_unstable to rustc_attr
2. as a result, drop rustc_errors dep from syntax

4 years ago1. move node_id to syntax
Mazdak Farrokhzad [Sat, 11 Jan 2020 14:03:15 +0000 (15:03 +0100)]
1. move node_id to syntax
2. invert rustc_session & syntax deps
3. drop rustc_session dep in rustc_hir

4 years agoMove builtin attribute logic to new rustc_attr crate.
Mazdak Farrokhzad [Sat, 11 Jan 2020 12:15:20 +0000 (13:15 +0100)]
Move builtin attribute logic to new rustc_attr crate.

For now, this is all the crate contains, but more
attribute logic & types will be moved there over time.

4 years agosyntax: simplify HasAttrs code
Mazdak Farrokhzad [Sat, 11 Jan 2020 11:33:11 +0000 (12:33 +0100)]
syntax: simplify HasAttrs code

4 years agopretty: remove ParseSess dependency
Mazdak Farrokhzad [Sat, 11 Jan 2020 09:33:18 +0000 (10:33 +0100)]
pretty: remove ParseSess dependency

4 years agosyntax: move GLOBALS to attr module
Mazdak Farrokhzad [Sat, 11 Jan 2020 08:59:14 +0000 (09:59 +0100)]
syntax: move GLOBALS to attr module

4 years ago{syntax -> rustc_ast_passes}::node_count
Mazdak Farrokhzad [Sat, 11 Jan 2020 08:48:57 +0000 (09:48 +0100)]
{syntax -> rustc_ast_passes}::node_count

4 years agoRemove `Alloc` in favor of `AllocRef`
Tim Diekmann [Sat, 1 Feb 2020 17:40:12 +0000 (18:40 +0100)]
Remove `Alloc` in favor of `AllocRef`

`AllocRef` was reexported as `Alloc` in order to not break toolstate in the week before the next stable release.

4 years agoUse `next_point` to avoid ICE
Yuki Okushi [Sat, 1 Feb 2020 17:39:53 +0000 (02:39 +0900)]
Use `next_point` to avoid ICE

4 years agoUpdate option.rs
Marincia Catalin [Sat, 1 Feb 2020 17:05:50 +0000 (19:05 +0200)]
Update option.rs

I updated the example of the `expect` examples so they won't contain depressing sentences any more !

4 years agoAuto merge of #68180 - ajpaverd:cfguard-rust, r=nagisa
bors [Sat, 1 Feb 2020 15:02:58 +0000 (15:02 +0000)]
Auto merge of #68180 - ajpaverd:cfguard-rust, r=nagisa

Add support for Control Flow Guard on Windows.

LLVM now supports Windows Control Flow Guard (CFG): https://github.com/llvm/llvm-project/commit/d157a9bc8ba1085cc4808c6941412322a7fd884e
This patch adds support for rustc to emit the required LLVM module flags to enable CFG metadata (cfguard=1) or metadata and checks (cfguard=2). The LLVM module flags are ignored on unsupported targets and operating systems.

4 years agoRemove a comment about pretty printer in formatting tests
Konrad Borowski [Sat, 1 Feb 2020 12:29:00 +0000 (13:29 +0100)]
Remove a comment about pretty printer in formatting tests

rustc is now using rustfmt, not the old formatter.