Commit Graph

106399 Commits

Author SHA1 Message Date
bors
cef6894572 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
2020-02-02 09:19:40 +00:00
Mazdak Farrokhzad
00f0b0cd3a pretty: print attrs in struct expr 2020-02-02 09:25:54 +01:00
Friedrich von Never
b0a9e949e7
Strip unnecessary subexpression
It became unnecessary since a06baa56b9 reformatted the file.
2020-02-02 15:08:46 +07:00
Tyler Lanphear
f6c3894724 compiletest: error if compile-fail header in ui test. 2020-02-02 02:08:30 -05:00
bors
0cbcb17d33 Auto merge of #68754 - JohnTitor:clippy-up, r=JohnTitor
Update Clippy

Fixes #68745

r? @ghost
2020-02-02 06:09:00 +00:00
Tyler Lanphear
9fa54e594b stdarch: update submodule. 2020-02-01 22:04:18 -05:00
bors
bc4a339064 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.
2020-02-02 03:02:41 +00:00
David Ross
410114b9d2 Add tests for issue 59191 2020-02-01 18:59:11 -08:00
David Ross
276734d6a4 Fix 59191
This adds an explicit error for when macros replace the crate root with
a non-module item.
2020-02-01 18:58:40 -08:00
Yuki Okushi
c377ed606c Fix ICE with save-analysis 2020-02-02 09:23:47 +09:00
Yuki Okushi
ae22bf9d42 Catch more ICEs 2020-02-02 09:02:54 +09:00
Yuki Okushi
632d75e057 Update Clippy 2020-02-02 08:38:28 +09:00
bors
e5b150edaf 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
2020-02-01 23:31:51 +00:00
Yuki Okushi
87bb0c4389
Rollup merge of #68740 - JohnTitor:do-not-sugg-underscore, r=Centril
Do not suggest things named underscore

Fixes #68719

r? @estebank
2020-02-02 08:30:21 +09:00
Yuki Okushi
c7332abee2
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
2020-02-02 08:30:19 +09:00
Yuki Okushi
1529126411
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.
2020-02-02 08:30:18 +09:00
Yuki Okushi
44dc4c2617
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.
2020-02-02 08:30:16 +09:00
Yuki Okushi
518ed67ab1
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.
2020-02-02 08:30:15 +09:00
Yuki Okushi
b18b26924c
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.
2020-02-02 08:30:11 +09:00
Yuki Okushi
bf68a057b3
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`.
2020-02-02 08:30:09 +09:00
Dan Robertson
0b1ff27cd8 Basic run-pass tests for or-patterns
Add some basic run-pass ui tests for or-patterns.
2020-02-01 22:10:58 +00:00
Matthew Jasper
30058df867 Update existing tests for or-patterns 2020-02-01 22:10:58 +00:00
Matthew Jasper
a20969c489 Implement general or-patterns in let statements 2020-02-01 22:10:43 +00:00
Matthew Jasper
5cc4352bc4 Implement general or-patterns in match expressions 2020-02-01 22:10:03 +00:00
Matthew Jasper
64eab7750b Don't create unnecessary block 2020-02-01 22:08:35 +00:00
Matthew Jasper
eecee76652 Generate prebinding blocks lazily 2020-02-01 22:08:35 +00:00
Matthew Jasper
425e494fce Remove or_patterns from INCOMPLETE_FEATURES 2020-02-01 22:07:11 +00:00
Yuki Okushi
9d8058fb42 Do not ICE in type-alias-impl-trait with save-analysis 2020-02-02 06:39:50 +09:00
Yuki Okushi
726568bd1b Do not suggest things named underscore 2020-02-02 04:55:37 +09:00
Rob Pilling
07ee472cd1 Avoid qualified path recovery when not followed by identifier 2020-02-01 19:38:52 +00:00
Rob Pilling
991d2ee282 Improve wording and docs for qualified path recovery 2020-02-01 19:38:52 +00:00
Rob Pilling
45fb7232ab Move colon-check to recover_colon_before_qpath_proj() 2020-02-01 19:29:08 +00:00
Wesley Wiser
f5f86be1d4 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
2020-02-01 14:19:17 -05:00
Rob Pilling
88d64a0931 Simplify span usage and avoid .eat() 2020-02-01 19:07:58 +00:00
Jonas Schievink
791123d2c4 Deduplicate generator interior types 2020-02-01 20:02:56 +01:00
bors
13db6501c7 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.
2020-02-01 18:29:09 +00:00
Mazdak Farrokhzad
1a3141c86e pretty: raise recursion_limit = 256 2020-02-01 18:59:49 +01:00
Mazdak Farrokhzad
aef2df1aaa fix fallout in tests 2020-02-01 18:59:49 +01:00
Mazdak Farrokhzad
a0838462cf pretty: injected_crate_name -> has_injected_crate 2020-02-01 18:59:49 +01:00
Mazdak Farrokhzad
eadff06823 syntax: reexport attr globals 2020-02-01 18:59:49 +01:00
Mazdak Farrokhzad
f882b07977 remove rustc_ast_pretty dep from rustc 2020-02-01 18:59:49 +01:00
Mazdak Farrokhzad
154040097d pacify the parallel compiler 2020-02-01 18:59:49 +01:00
Mazdak Farrokhzad
e233331a51 syntax::print -> new crate rustc_ast_pretty 2020-02-01 18:59:49 +01:00
Mazdak Farrokhzad
98fd6a5c88 1. move allow_internal_unstable to rustc_attr
2. as a result, drop rustc_errors dep from syntax
2020-02-01 18:58:08 +01:00
Mazdak Farrokhzad
097d5e1c5e 1. move node_id to syntax
2. invert rustc_session & syntax deps
3. drop rustc_session dep in rustc_hir
2020-02-01 18:58:08 +01:00
Mazdak Farrokhzad
93a8283614 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.
2020-02-01 18:54:56 +01:00
Mazdak Farrokhzad
9be73dc63a syntax: simplify HasAttrs code 2020-02-01 18:54:55 +01:00
Mazdak Farrokhzad
64d0143c2c pretty: remove ParseSess dependency 2020-02-01 18:54:55 +01:00
Mazdak Farrokhzad
e03d1064f0 syntax: move GLOBALS to attr module 2020-02-01 18:54:55 +01:00
Mazdak Farrokhzad
50f0e2e9e6 {syntax -> rustc_ast_passes}::node_count 2020-02-01 18:54:55 +01:00