]> git.lizzy.rs Git - rust.git/log
rust.git
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 agoChange expansion error to be non-fatal
David [Sun, 2 Feb 2020 19:28:32 +0000 (11:28 -0800)]
Change expansion error to be non-fatal

Changes the error handler for inner attributes that replace the root
with a non-module. Previously it would emit a fatal error. It now emits
an empty expasion and a non-fatal error like the existing handler for a
failed expansion.

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 agoPull out a special case in `merge_from_succ`.
Nicholas Nethercote [Mon, 3 Feb 2020 02:32:59 +0000 (13:32 +1100)]
Pull out a special case in `merge_from_succ`.

This is a small perf win.

4 years agoFix up `merge_from_succ`.
Nicholas Nethercote [Mon, 3 Feb 2020 01:11:11 +0000 (12:11 +1100)]
Fix up `merge_from_succ`.

This function has a variable `changed` that is erroneously used for two
related-but-different purpose:
- to detect if the current element has changed;
- to detect if any elements have changed.

As a result, its use for the first purpose is broken, because if any
prior element changed then the code always thinks the current element
has changed. This is only a performance bug, not a correctness bug,
because we frequently end up calling `assign_unpacked` unnecessarily to
overwrite the element with itself.

This commit adds `any_changed` to correctly distinguish between the two
purposes. This is a small perf win for some benchmarks.

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 agoDeal with spans showing `std` lib
Esteban Küber [Sun, 2 Feb 2020 21:51:23 +0000 (13:51 -0800)]
Deal with spans showing `std` lib

Address #53081

4 years agoPoint at reason in object unsafe trait with `Self` in supertraits or `where`-clause
Esteban Küber [Sun, 2 Feb 2020 20:51:30 +0000 (12:51 -0800)]
Point at reason in object unsafe trait with `Self` in supertraits or `where`-clause

4 years agofix rebase
Esteban Küber [Sun, 2 Feb 2020 20:50:07 +0000 (12:50 -0800)]
fix rebase

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 agoAccount for `?Sized` type parameter bounds
Esteban Küber [Sun, 2 Feb 2020 10:03:54 +0000 (02:03 -0800)]
Account for `?Sized` type parameter bounds

4 years agoRemove duplicated code
Esteban Küber [Sun, 2 Feb 2020 09:38:12 +0000 (01:38 -0800)]
Remove duplicated code

4 years agoSuggest `?Sized` on type parameters
Esteban Küber [Sun, 2 Feb 2020 08:54:13 +0000 (00:54 -0800)]
Suggest `?Sized` on type parameters

4 years agoadd tests for structured suggestion
Esteban Küber [Sat, 1 Feb 2020 03:04:58 +0000 (19:04 -0800)]
add tests for structured suggestion

4 years agoUse more appropriate spans on object unsafe traits and provide structured suggestions...
Esteban Küber [Sat, 1 Feb 2020 02:48:35 +0000 (18:48 -0800)]
Use more appropriate spans on object unsafe traits and provide structured suggestions when possible

4 years agoWording changes to object unsafe trait errors
Esteban Küber [Sat, 1 Feb 2020 00:47:00 +0000 (16:47 -0800)]
Wording changes to object unsafe trait errors

Stemming from the thread at https://twitter.com/indygreg/status/1223279056398929920

4 years agoPoint at `Sized` requirements
Esteban Küber [Fri, 31 Jan 2020 04:12:46 +0000 (20:12 -0800)]
Point at `Sized` requirements

Make #47990 easier to understand

4 years agoreview comments
Esteban Küber [Fri, 31 Jan 2020 03:35:48 +0000 (19:35 -0800)]
review comments

4 years agoRemove duplicated code
Esteban Küber [Thu, 30 Jan 2020 18:34:38 +0000 (10:34 -0800)]
Remove duplicated code

4 years agoSlight rewording of diagnostic message
Esteban Küber [Thu, 30 Jan 2020 18:20:47 +0000 (10:20 -0800)]
Slight rewording of diagnostic message

4 years agoUse more accurate failed predicate spans
Esteban Küber [Thu, 30 Jan 2020 00:55:37 +0000 (16:55 -0800)]
Use more accurate failed predicate spans

4 years agoPoint at return type obligations instead of at `fn` ident
Esteban Küber [Wed, 29 Jan 2020 22:16:31 +0000 (14:16 -0800)]
Point at return type obligations instead of  at `fn` ident

4 years agoPoint at the `Sized` obligation in `where` clauses
Esteban Küber [Wed, 29 Jan 2020 21:27:53 +0000 (13:27 -0800)]
Point at the `Sized` obligation in `where` clauses

4 years agoTweak `Self: Sized` restriction diagnostic output
Esteban Küber [Wed, 29 Jan 2020 20:59:04 +0000 (12:59 -0800)]
Tweak `Self: Sized` restriction diagnostic output

4 years agoreview comments
Esteban Küber [Sat, 25 Jan 2020 22:28:23 +0000 (14:28 -0800)]
review comments

4 years agofix test
Esteban Küber [Mon, 20 Jan 2020 03:22:15 +0000 (19:22 -0800)]
fix test

4 years agoWhen object unsafe trait uses itself in associated item suggest using `Self`
Esteban Küber [Mon, 20 Jan 2020 01:27:37 +0000 (17:27 -0800)]
When object unsafe trait uses itself in associated item suggest using `Self`

4 years agoPoint at `Sized` bound
Esteban Küber [Sun, 19 Jan 2020 22:53:37 +0000 (14:53 -0800)]
Point at `Sized` bound

4 years agoPoint at arguments or output when fn obligations come from them, or ident when they...
Esteban Küber [Sat, 18 Jan 2020 22:57:56 +0000 (14:57 -0800)]
Point at arguments or output when fn obligations come from them, or ident when they don't

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 agoStrip unnecessary subexpression
Friedrich von Never [Sun, 2 Feb 2020 08:08:46 +0000 (15:08 +0700)]
Strip unnecessary subexpression

It became unnecessary since a06baa56b95674fc626b3c3fd680d6a65357fe60 reformatted the file.

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 agostdarch: update submodule.
Tyler Lanphear [Sun, 2 Feb 2020 00:11:33 +0000 (19:11 -0500)]
stdarch: update submodule.

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 agoAdd tests for issue 59191
David Ross [Sun, 2 Feb 2020 02:07:26 +0000 (18:07 -0800)]
Add tests for issue 59191

4 years agoFix 59191
David Ross [Sun, 2 Feb 2020 02:04:07 +0000 (18:04 -0800)]
Fix 59191

This adds an explicit error for when macros replace the crate root with
a non-module item.

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