Commit Graph

95388 Commits

Author SHA1 Message Date
Robert Collins
6392bc9fcd Add DocFS layer to rustdoc
* Move fs::create_dir_all calls into DocFS to provide a clean
  extension point if async extension there is needed.
* Convert callsites of create_dir_all to ensure_dir to reduce syscalls.
* Convert fs::write usage to DocFS.write
  (which also removes a lot of try_err! usage for easier reading)
* Convert File::create calls to use Vec buffers and then DocFS.write
  in order to consistently reduce syscalls as well, make
  deferring to threads cleaner and avoid leaving dangling content if
  writing to existing files....
* Convert OpenOptions usage similarly - I could find no discussion on
  the use of create_new for that one output file vs all the other
  files render creates, if link redirection attacks are a concern
  DocFS will provide a good central point to introduce systematic
  create_new usage. (fs::write/File::create is vulnerable to link
  redirection attacks).
* DocFS::write defers to rayon for IO on Windows producing a modest
  speedup: before this patch on my development workstation:

$ time cargo +mystg1 doc -p winapi:0.3.7
 Documenting winapi v0.3.7
    Finished dev [unoptimized + debuginfo] target(s) in 6m 11s

real    6m11.734s

Afterwards:
$ time cargo +mystg1 doc -p winapi:0.3.7
   Compiling winapi v0.3.7
 Documenting winapi v0.3.7
    Finished dev [unoptimized + debuginfo] target(s) in 49.53s

real    0m49.643s

I haven't measured how much time is in the compilation logic vs in the
IO and outputting etc, but this takes it from frustating to tolerable
for me, at least for now.
2019-06-21 12:00:49 +02:00
Jeremy Stucki
004efa2705
Remove needless lifetimes 2019-06-21 11:39:28 +02:00
Michael Woerister
0d67510a48 Remove warnings about incr. comp. generating less debugging output. 2019-06-21 10:07:59 +02:00
Oliver Scherer
d46a373b39 Further reduce the likelyhood of hash collisions 2019-06-21 09:56:02 +02:00
Oliver Scherer
0102942e8c Documentation typo 2019-06-21 09:54:11 +02:00
ljedrz
0a511cce79 revert the NodeId to HirId parameter change to get_path_res 2019-06-21 08:57:34 +02:00
bors
56a12b2ad0 Auto merge of #62003 - christianpoveda:master, r=oli-obk
Replace MemoryExtra by Memory in intptrcast methods

r? @RalfJung @oli-obk
2019-06-21 06:37:17 +00:00
John Kåre Alsaker
6b86302db3 Update LLVM to fix VS 2019 compilation 2019-06-21 08:31:41 +02:00
Yuki Okushi
b4c73a297c Add test for issue-27697 2019-06-21 15:18:00 +09:00
bors
dbec74ffa7 Auto merge of #61948 - ehuss:update-mdbook, r=steveklabnik
Update mdbook

This updates to mdbook 0.3.0. This release includes the following changes:
https://github.com/rust-lang-nursery/mdBook/blob/master/CHANGELOG.md#mdbook-030
One of the biggest changes is the update to pulldown-cmark.

This also bumps the submodules (except the nomicon which has some broken links).

## reference

6 commits in f8ae436d936f6f4891d3c1bbb1af5865eb8aeadb..08ae27a4921ca53967656a7391c82f6c0ddd1ccc
2019-05-31 14:59:12 +0200 to 2019-06-17 11:24:13 -0700
- Document `underscore_const_names` (rust-lang-nursery/reference#620)
- Describe `#[repr(align(x))]` semantics on `enum`s (rust-lang-nursery/reference#619)
- Fix typo in lazy_static example. (rust-lang-nursery/reference#622)
- Rust 2015 supports Kleene ? macro operator (rust-lang-nursery/reference#617)
- Bitrig support has been removed (rust-lang-nursery/reference#615)
- Fix spell error in attributes/diagnostics.md (rust-lang-nursery/reference#614)

## book

8 commits in 62a8c6f25fbd981c80a046f3b04be9684749af3b..9aacfcc4c5b102c8cda195932addefd32fe955d2
2019-05-28 15:48:23 -0400 to 2019-06-16 21:27:26 -0400
- Add a script to help diff rendered books
- Update mdbook links (rust-lang/book#1989)
- Update for markdown changes. (rust-lang/book#1984)
- Make all mentions of crates.io consistent
- Propagate corrections made in layout
- Add link to Swedish translation
- Propagate small edits made in layout
- Remove snapshot files that have been checked with layout

## rust-by-example

3 commits in d8eec1dd65470b9a68e80ac1cba8fad0daac4916..b27472962986e85c94f4183b1a6d2207660d3ed6
2019-06-08 10:15:22 -0300 to 2019-06-17 15:52:07 -0300
- Update `macro_rules!` formatting. (rust-lang/rust-by-example#1205)
- Add Cargo comment to the `try!` macro example. (rust-lang/rust-by-example#1203)
- Fix typo (rust-lang/rust-by-example#1204)

## rustc-guide

15 commits in 3ac9cfc9c9ab2e366feebf18718112737f572352..f55e97c145cf37fd664db2e0e2f2d05df328bf4f
2019-06-02 19:36:58 -0500 to 2019-06-15 17:29:12 -0500
- fix typos
- Update for TyCtxt<'a, 'gcx, 'tcx> -> TyCtxt<'tcx>.
- fix ci failures, typos, broken links
- Some edits to address review comments
- Notes about closure de-sugaring
- add note about rebuilding llvm
- Changes to config.toml require a clean
- Fix a few typos in type inference chapter
- Add triagebot (rust-lang/rustc-guide#337)
- Update how-to-build-and-run.md
- Update how-to-build-and-run.md
- Update compiler-debugging.md
- use debug instead of debuginfo-level
- Replaced tabs with spaces
- correct indentation

## edition-guide

4 commits in 581c6cccfaf995394ea9dcac362dc8e731c18558..f8072acde5ce29c7570d7986180bbded2d22e287
2019-05-06 12:47:44 -0700 to 2019-06-14 23:27:05 +0200
- Small fixes (rust-lang-nursery/edition-guide#179)
- Cleanup unused NLL link (rust-lang-nursery/edition-guide#167)
- Part 2: Rust 2015 now supports ? macro rep op (rust-lang-nursery/edition-guide#163)
- Part 1: Rust 2015 now supports ? macro rep op (rust-lang-nursery/edition-guide#162)

## embedded-book

1 commits in f0c75b75f9c18537b78f5d17c1015247e9a49c86..ef27b517dcd0b990c888c0d7caeff52a5a115619
2019-06-03 10:49:02 +0000 to 2019-06-18 22:59:47 +0000
- Fix link for more strict commonmark interpretation.  (rust-embedded/book#194)
2019-06-21 03:24:56 +00:00
Eric Huss
2dafa91310 Update mdbook 2019-06-20 19:47:44 -07:00
Wesley Wiser
164ed087ab [const-prop] Move local storage into a Frame on InterpCx
This moves us closer to just using `InterpCx` for interpretation.
2019-06-20 21:12:10 -04:00
Wesley Wiser
573b61ae26 [const-prop] Introduce getter/setter functions 2019-06-20 21:12:10 -04:00
bors
9d5b6efdf6 Auto merge of #60293 - nagisa:rustdoc-all-the-auto-traits, r=eddyb
rustdoc: generate implementors for all auto traits

Previously we would only generate a list of synthetic implementations
for two well known traits – Send and Sync. With this patch all the auto
traits known to rustc are considered. This includes such traits like
Unpin and user’s own traits.

Sadly the implementation still iterates through the list of crate items
and checks them against the traits, which for non-std crates containing
their own auto-traits will still not include types defined in std/core.

It is an improvement nontheless.
2019-06-20 23:44:52 +00:00
Dylan MacKenzie
f045008f94 Kill conflicting borrows of places with projections.
Resolves #62007.

Due to a bug, the previous version of this check did not actually kill
any conflicting borrows unless the borrowed place had no projections.
Specifically, `entry_set` will always be empty when `statement_effect`
is called. It does not contain the set of borrows which are live at this
point in the program.
2019-06-20 16:30:43 -07:00
Christian Poveda
e152c38f65 Fix merge issues 2019-06-20 17:01:48 -05:00
Christian Poveda
752a1a4668 Updated tag methods for consistency 2019-06-20 16:52:17 -05:00
Guillaume Gomez
640bdbdb1d Improve theme checker by removing unneeded conditions 2019-06-20 22:59:56 +02:00
Guillaume Gomez
165a95b371 Add test for empty css file check 2019-06-20 22:59:56 +02:00
Guillaume Gomez
cfd754d892 Fix theme-checker failure 2019-06-20 22:59:56 +02:00
bors
1d9981f04e Auto merge of #62006 - Centril:rollup-4my59er, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #61900 (implement Error::source for Box<T: Error>)
 - #61979 (Implement Debug for PlaceBase)
 - #61981 (Closures implement Copy and Clone, generators don't)
 - #61996 (Add unit tests for unescaping raw (byte) strings)
 - #62000 (Add test for issue-54189)

Failed merges:

r? @ghost
2019-06-20 20:55:02 +00:00
Mazdak Farrokhzad
9e5ace6f43
Rollup merge of #62000 - JohnTitor:add-test-issue-54189, r=cramertj
Add test for issue-54189

Closes #54189
2019-06-20 22:14:29 +02:00
Mazdak Farrokhzad
7e9ecfae5a
Rollup merge of #61996 - Xanewok:unescape-raw-strings, r=matklad
Add unit tests for unescaping raw (byte) strings

Adds unit tests for functionality introduced in #60793.

r? @matklad @petrochenkov
2019-06-20 22:14:28 +02:00
Mazdak Farrokhzad
fdbc4ce686
Rollup merge of #61981 - rust-lang:generators-clone-doc, r=cramertj
Closures implement Copy and Clone, generators don't
2019-06-20 22:14:26 +02:00
Mazdak Farrokhzad
4129463683
Rollup merge of #61979 - spastorino:fmt-place-base, r=oli-obk
Implement Debug for PlaceBase

r? @oli-obk

More tiny bits that can be extracted from Place 2.0 PR
2019-06-20 22:14:25 +02:00
Mazdak Farrokhzad
d3898a6731
Rollup merge of #61900 - s3bk:master, r=sfackler
implement Error::source for Box<T: Error>

fixes https://github.com/rust-lang/rust/issues/61899
2019-06-20 22:14:24 +02:00
Christian Poveda
9cc28d4541 Replace MemoryExtra by Memory in intptrcast methods 2019-06-20 14:07:34 -05:00
bors
f693d339f1 Auto merge of #61827 - golddranks:lldb_fix, r=nikomatsakis
Fix rust-lldb wrapper scripts.

Currently the `rust-lldb` wrapper provided by Rust project is broken. The error messages it produces on launch are as follows:
```
warning: ignoring unknown option: --one-line-before-file=command script import "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/etc/lldb_rust_formatters.py"
warning: ignoring unknown option: --one-line-before-file=type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust
warning: ignoring unknown option: --one-line-before-file=type category enable Rust
(lldb) target create "target/debug/nagare"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/python2.7/site-packages/lldb/__init__.py", line 1481, in <module>
    class SBAddress(object):
  File "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/python2.7/site-packages/lldb/__init__.py", line 1647, in SBAddress
    __swig_getmethods__["module"] = GetModule
NameError: name '__swig_getmethods__' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
...etc.
```

The errors stem from two regressions: one caused by an LLVM upgrade and one caused by unintended upgrade to SWIG 4.0 (SWIG is a wrapper generator that is used to generate Python bindings for LLVM and LLDB.)

(Edit: found the exact dates) The SWIG breakage happened because of a Homebrew version upgrade on `nightly-2019-05-01-x86_64-apple-darwin` and the LLVM breakage happened on `nightly-2019-01-27-x86_64-apple-darwin` (likely to have been caused by https://github.com/rust-lang/rust/pull/57675 ).

The fix is to update the LLVM parameter syntax and to "downgrade" to SWIG 3.0.x. SWIG 3.0.x is not going to be supported by Homebrew forever, but should be good for now, until LLDB upgrades to  support SWIG 4.0.0. Here's some more info about Homebrew support: https://github.com/Homebrew/homebrew-core/pull/39929 & https://github.com/Homebrew/homebrew-core/pull/40882 I'm going to send a bug & fix to LLDB about SWIG 4.0.0 to get the situation fixed in the future.

It would be good to also backport this to beta, since it's such a small change, and will fix an obvious regression.
2019-06-20 17:57:04 +00:00
Yuki Okushi
127edbac34 Add test for issue-54189 2019-06-21 00:19:11 +09:00
bors
f0c2bdf52e Auto merge of #61998 - eddyb:type-name-params, r=oli-obk
rustc_mir: support type parameters by printing them as `_`.

Fixes #61894.
r? @oli-obk
2019-06-20 15:11:08 +00:00
Eduard-Mihai Burtescu
3606003a5b rustc_mir: support type parameters by printing them as _. 2019-06-20 17:48:02 +03:00
Simonas Kazlauskas
4c8d00a3ec rustdoc: generate implementors for all auto traits
Previously we would only generate a list of synthetic implementations
for two well known traits – Send and Sync. With this patch all the auto
traits known to rustc are considered. This includes such traits like
Unpin and user’s own traits.

Sadly the implementation still iterates through the list of crate items
and checks them against the traits, which for non-std crates containing
their own auto-traits will still not include types defined in std/core.

It is an improvement nontheless.
2019-06-20 17:36:43 +03:00
Santiago Pastorino
f0d9d55138 Implement Debug for PlaceBase 2019-06-20 14:25:58 +02:00
bors
c1a5edd939 Auto merge of #61929 - 95th:master, r=GuillaumeGomez
Fix Into trait docs links

https://doc.rust-lang.org/std/convert/trait.Into.html
2019-06-20 12:18:25 +00:00
ljedrz
73cb9ab526 rename hir::map::get_by_hir_id to get 2019-06-20 12:50:06 +02:00
ljedrz
a64456e48e remove hir::map::get 2019-06-20 12:47:26 +02:00
ljedrz
ae72c91247 make blocks::Code work with HirId 2019-06-20 12:47:26 +02:00
ljedrz
fe044a8bc2 rename hir::map::expect_expr_by_hir_id to expect_expr 2019-06-20 12:47:26 +02:00
ljedrz
2d1e223a0e remove uses of the NodeId hir::map::expr 2019-06-20 12:47:26 +02:00
ljedrz
21e63dddbe remove definitions::def_index_to_node_id (unused) 2019-06-20 12:47:26 +02:00
ljedrz
3ed7585635 make hir::def_kind work with HirId 2019-06-20 12:47:26 +02:00
ljedrz
98cc18a5db rename hir::map::name_by_hir_id to ::name 2019-06-20 12:47:26 +02:00
ljedrz
468647cabb remove hir::map::name 2019-06-20 12:47:25 +02:00
ljedrz
f6eb39203b replace NodeId with HirId in infer::SubregionOrigin 2019-06-20 12:47:25 +02:00
ljedrz
b710e08868 remove TyCtx::expr_span (unused) 2019-06-20 12:47:25 +02:00
ljedrz
44109169a6 replace NodeId with HirId in traits::ObligationCauseCode 2019-06-20 12:47:25 +02:00
Gurwinder Singh
34188fb636 Fix Into trait links 2019-06-20 15:02:27 +05:30
Igor Matuszewski
047421e69e Add unit tests for unescaping raw (byte) strings 2019-06-20 09:51:15 +02:00
bors
4fb77a0398 Auto merge of #61983 - Centril:rollup-wnfo07y, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #60454 (Add custom nth_back to Skip)
 - #60772 (Implement nth_back for slice::{Iter, IterMut})
 - #61782 (suggest tuple struct syntax)
 - #61968 (rustc: disallow cloning HIR nodes.)

Failed merges:

r? @ghost
2019-06-20 07:46:11 +00:00
Mazdak Farrokhzad
942a7fec30
Rollup merge of #61968 - eddyb:hir-noclone, r=petrochenkov
rustc: disallow cloning HIR nodes.

Besides being inefficient, cloning also risks creating broken HIR (without properly recreating all the IDs and whatnot, in which case you might as well reconstruct the entire node without ever `Clone`-ing anything).

We detect *some* detrimental situations (based on the occurrence of `HirId`s, I believe?), but it's better to statically disallow it, IMO.

One of the examples that is fixed by this PR is `tcx.hir().fn_decl{,_by_hir_id}`, which was cloning an entire `hir::FnDecl` *every single time it was called*.

r? @petrochenkov cc @rust-lang/compiler
2019-06-20 08:36:03 +02:00