Commit Graph

120726 Commits

Author SHA1 Message Date
Dylan MacKenzie
307153e611 Switch to non-doc comment 2020-05-22 13:31:02 -07:00
Dylan MacKenzie
f17e2c93a6 Use OnceCell for predecessor cache 2020-05-22 13:31:02 -07:00
Dylan MacKenzie
c282c1c654 Use OnceCell instead of Once 2020-05-22 13:31:02 -07:00
Dylan MacKenzie
9f82785c81 Replace rustc_data_structures::sync::Once with OnceCell 2020-05-22 13:26:39 -07:00
Dylan DPC
bf1b998be6
Rollup merge of #72461 - GuillaumeGomez:cleanup-e0600, r=Dylan-DPC
Clean up E0600 explanation

r? @Dylan-DPC
2020-05-22 21:45:04 +02:00
Dylan DPC
141ce5f2ad
Rollup merge of #72459 - yoshuawuyts:into-future, r=nikomatsakis
Add core::future::IntoFuture

This patch reintroduces the `core::future::IntoFuture` trait. However unlike earlier PRs this patch does not integrate it into the `async/.await` lowering since that lead to performance regressions. By introducing the trait separately from the integration, the integration PR can be more narrowly scoped, and people can start trying out the `IntoFuture` trait today. Thanks heaps!

cc/ @rust-lang/wg-async-foundations

## References
- Original PR adding `IntoFuture` https://github.com/rust-lang/rust/pull/65244
- Open issue to re-land `IntoFuture` (assigned to me) https://github.com/rust-lang/rust/issues/67982
- Tracking issue for `IntoFuture` https://github.com/rust-lang/rust/issues/67644
2020-05-22 21:45:01 +02:00
Dylan DPC
3083ce7ab1
Rollup merge of #72453 - dtolnay:open, r=Mark-Simulacrum
Add flag to open docs:  x.py doc --open

This aligns with Cargo's flag `cargo doc --open`.

Tested with:

```bash
   # opens doc/index.html
x.py doc --stage 0 --open
x.py doc --stage 0 --open src/doc

   # opens doc/book/index.html
x.py doc --stage 0 --open src/doc/book

   # opens doc/std/index.html
x.py doc --stage 0 --open src/libstd

   # opens doc/proc_macro/index.html
x.py doc --stage 0 --open src/libproc_macro

   # opens both
x.py doc --stage 0 --open src/libstd src/libproc_macro
```
2020-05-22 21:45:00 +02:00
Dylan DPC
01adfe1bc3
Rollup merge of #72395 - Elinvynia:highfive, r=Mark-Simulacrum
Allow rust-highfive to label issues it creates.

This is my first meaningful PR, I am unsure how to test this code so any pointers would be welcome!

I am about 50% sure it works.
2020-05-22 21:44:58 +02:00
Dylan DPC
84fbbded1e
Rollup merge of #72385 - spastorino:add-exclude-labels, r=Mark-Simulacrum
Add some teams to prioritization exclude_labels

r? @Mark-Simulacrum @LeSeulArtichaut
2020-05-22 21:44:56 +02:00
Dylan DPC
47f3c440ec
Rollup merge of #72375 - GuillaumeGomez:cleanup-e0599, r=Dylan-DPC
Improve E0599 explanation

r? @Dylan-DPC
2020-05-22 21:44:54 +02:00
Dylan DPC
dd78839432
Rollup merge of #71289 - xliiv:70802-intra-self, r=GuillaumeGomez
Allow using `Self::` in doc

Closes #70802
2020-05-22 21:44:52 +02:00
Aaron Hill
5685e4dd90
Fix rebase fallout 2020-05-22 15:12:11 -04:00
Aaron Hill
30c00fd26a
Add test for macro_rules! invoking a proc-macro with capture groups 2020-05-22 15:07:41 -04:00
Aaron Hill
2af0218bf1
Recursively expand nonterminals 2020-05-22 15:07:36 -04:00
Aaron Hill
7a4c1865fb
Move functions to librustc_parse 2020-05-22 15:01:08 -04:00
Mateusz Mikuła
4b516279a9 Revert MSYS2 CI workaround 2020-05-22 19:08:39 +02:00
Matthew Jasper
9754b3fc1d Document collect_bounding_regions 2020-05-22 18:03:08 +01:00
Matthew Jasper
f9f3063cfa Update tests 2020-05-22 18:03:08 +01:00
Matthew Jasper
3d8a0733ae Remove dead ScopeTree code 2020-05-22 18:03:08 +01:00
Matthew Jasper
52d628f250 Remove unused error reporting code 2020-05-22 18:03:08 +01:00
Matthew Jasper
7d73e4cc47 Remove ReScope 2020-05-22 18:03:08 +01:00
David Tolnay
07b1de4e9a
Report error from opener in bootstrap
On my machine, an error looks like:

    Finished release [optimized] target(s) in 0.29s
    Opening doc /git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html
    command 'xdg-open (internal)' did not execute successfully; exit code: 4
    command stderr:
    gio: file:///git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html: Error when getting information for file “/git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html”: No such file or directory

    Build completed successfully in 0:00:08
2020-05-22 09:51:46 -07:00
Matthew Jasper
c102312c2b Remove the parts of regionck referencing ReScope 2020-05-22 17:38:20 +01:00
Matthew Jasper
187bfb333b Improve the error when an opaque type captures ReEmtpty 2020-05-22 17:38:20 +01:00
Matthew Jasper
33f90f213d Check for upper bound universe errors more carefully 2020-05-22 17:38:20 +01:00
LeSeulArtichaut
01630b26dd Implement Sync for `process::Command on unix and vxworks 2020-05-22 18:33:12 +02:00
bors
215f2d3294 Auto merge of #72464 - RalfJung:rollup-xhm7w7u, r=RalfJung
Rollup of 7 pull requests

Successful merges:

 - #71829 (Fix suggestion to borrow in struct)
 - #72123 (Stabilize process_set_argv0 feature for Unix)
 - #72235 (Clean up E0590 explanation)
 - #72345 (Clean up E0593 explanation)
 - #72376 ([self-profling] Record the cgu name when doing codegen for a module)
 - #72399 (Add fast-path optimization for Ipv4Addr::fmt)
 - #72435 (rustllvm: Fix warnings about unused function parameters)

Failed merges:

r? @ghost
2020-05-22 15:33:32 +00:00
Elinvynia
dc4b9fd863 Allow rust-highfive to label issues it creates.
Replace sets with lists.
2020-05-22 17:28:22 +02:00
Ralf Jung
e7503ca7bf
Rollup merge of #72435 - petrochenkov:cratetypesopt, r=Mark-Simulacrum
rustllvm: Fix warnings about unused function parameters

And then perform corresponding cleanups on Rust side.

Fixes https://github.com/rust-lang/rust/issues/72427
2020-05-22 16:58:37 +02:00
Ralf Jung
37587af8d5
Rollup merge of #72399 - Lucretiel:ipv4-display-fast, r=kennytm
Add fast-path optimization for Ipv4Addr::fmt

Don't use an intermediary buffer when writing an IPv4 address without any specific alignment options
2020-05-22 16:58:36 +02:00
Ralf Jung
a116e7b02f
Rollup merge of #72376 - wesleywiser:record_cgu_name, r=Mark-Simulacrum
[self-profling] Record the cgu name when doing codegen for a module
2020-05-22 16:58:31 +02:00
Ralf Jung
f7ed13b6a5
Rollup merge of #72345 - GuillaumeGomez:cleanup-e0593, r=Dylan-DPC
Clean up E0593 explanation

r? @Dylan-DPC
2020-05-22 16:58:29 +02:00
Ralf Jung
02eb002ee3
Rollup merge of #72235 - GuillaumeGomez:cleanup-E0590, r=Dylan-DPC
Clean up E0590 explanation

r? @Dylan-DPC
2020-05-22 16:58:26 +02:00
Ralf Jung
53d0046983
Rollup merge of #72123 - jsgf:stabilize-arg0, r=sfackler
Stabilize process_set_argv0 feature for Unix

This stabilizes process_set_argv0 targeting 1.45.0. It has been
useful in practice and seems useful as-is.

The equivalent feature could be implemented for Windows, but as far as I
know nobody has. That can be done separately.

Tracking issue: #66510
2020-05-22 16:58:24 +02:00
Ralf Jung
9c34481c49
Rollup merge of #71829 - kper:issue71136, r=matthewjasper
Fix suggestion to borrow in struct

The corresponding issue is #71136.
The compiler suggests that borrowing `the_foos` might solve the problem. This is obviously incorrect.
```
struct Foo(u8);

#[derive(Clone)]
struct FooHolster {
    the_foos: Vec<Foo>,
}
```

I propose as fix to check if there is any colon in the span. However, there might a case where `my_method(B { a: 1, b : foo })` would be appropriate to show a suggestion for `&B ...`.  To fix that too, we can simply check if there is a bracket in the span. This is only possible because both spans are different.
Issue's span: `the_foos: Vec<Foo>`
other's span: `B { a : 1, b : foo }`
2020-05-22 16:58:19 +02:00
Tymoteusz Jankowski
fc0675bf75
Allow using Self:: in doc 2020-05-22 13:57:05 +02:00
Guillaume Gomez
985ebf2c4a Clean up E0590 explanation 2020-05-22 13:26:11 +02:00
Guillaume Gomez
6e5cb37b66 Clean up E0600 explanation 2020-05-22 13:24:34 +02:00
bors
a9ca1ec928 Auto merge of #72460 - RalfJung:rollup-28fs06y, r=RalfJung
Rollup of 4 pull requests

Successful merges:

 - #71610 (InvalidUndefBytes: Track size of undef region used)
 - #72161 (Replace fcntl-based file lock with flock)
 - #72306 (Break tokens before checking if they are 'probably equal')
 - #72325 (Always generated object code for `#![no_builtins]`)

Failed merges:

r? @ghost
2020-05-22 11:24:24 +00:00
Ralf Jung
1119421e26
Rollup merge of #72325 - alexcrichton:ignore-linker-plugin-lto, r=nnethercote
Always generated object code for `#![no_builtins]`

This commit updates the code generation for `#![no_builtins]` to always
produce object files instead of conditionally respecting
`-Clinker-plugin-lto` and sometimes producing bitcode. This is intended
to address rust-lang/cargo#8239.

The issue at hand here is that Cargo has tried to get "smarter" about
codegen in whole crate graph scenarios. When LTO is enabled it attempts
to avoid codegen on as many crates as possible, opting to pass
`-Clinker-plugin-lto` where it can to only generate bitcode. When this
is combined with `-Zbuild-std`, however, it means that
`compiler-builtins` only generates LLVM bitcode instead of object files.
Rustc's own LTO passes then explicitly skip `compiler-builtins` (because
it wouldn't work anyway) which means that LLVM bitcode gets sent to the
linker, which chokes most of the time.

The fix in this PR is to not actually respect `-Clinker-plugin-lto` for
`#![no_builtins]` crates. These crates, even if slurped up by the linker
rather than rustc, will not work with LTO. They define symbols which are
only referenced as part of codegen, so LTO's aggressive internalization
would trivially remove the symbols only to have the linker realize later
that the symbol is undefined. Since pure-bitcode never makes sense for
these libraries, the `-Clinker-plugin-lto` flag is silently ignored.
2020-05-22 11:32:25 +02:00
Ralf Jung
62d4e9eedd
Rollup merge of #72306 - Aaron1011:feature/turbo-spacing, r=petrochenkov
Break tokens before checking if they are 'probably equal'

Fixes #68489
Fixes #70987

When checking two `TokenStreams` to see if they are 'probably equal',
we ignore the `IsJoint` information associated with each `TokenTree`.
However, the `IsJoint` information determines whether adjacent tokens
will be 'glued' (if possible) when construction the `TokenStream` - e.g.
`[Gt Gt]` can be 'glued' to `BinOp(Shr)`.

Since we are ignoring the `IsJoint` information, 'glued' and 'unglued'
tokens are equivalent for determining if two `TokenStreams` are
'probably equal'. Therefore, we need to 'unglue' all tokens in the
stream to avoid false negatives (which cause us to throw out the cached
tokens, losing span information).
2020-05-22 11:32:23 +02:00
Ralf Jung
a8018e224e
Rollup merge of #72161 - nbdd0121:master, r=cuviper
Replace fcntl-based file lock with flock

WSL1 does not support `fcntl`-based lock and will always report success,
therefore creating a race condition when multiple rustc processes are
modifying shared data such as `search-index.js`. WSL1 does however
support `flock`.

`flock` is supported by all unix-like platforms. The only caveat is that
Linux 2.6.11 or earlier does not support `flock` on NFS mounts, but as
the minimum supported Linux version is 2.6.18, it is not an issue.

Fixes #72157
2020-05-22 11:32:21 +02:00
Ralf Jung
2059112eb4
Rollup merge of #71610 - divergentdave:InvalidUndefBytes-range, r=RalfJung
InvalidUndefBytes: Track size of undef region used

This PR adds a size to `UndefinedBehaviorInfo::InvalidUndefBytes`, to keep track of how many undefined bytes in a row were accessed, and changes a few methods to pass this information through. This additional information will eventually be used in Miri to improve diagnostics for this UB error. See also rust-lang/miri#1354 for prior discussion.

I expect Miri will break the next time its submodule is updated, due to this change to the `InvalidUndefBytes`. (The current commit for src/tools/miri predates rust-lang/miri#1354, and thus does not try to destructure the `InvalidUndefBytes` variant) I have a corresponding change prepared for that repository.

r? @RalfJung
2020-05-22 11:32:18 +02:00
Yoshua Wuyts
9ff502029d Add core::future::IntoFuture
This patch adds `core::future::IntoFuture`. However unlike earlier PRs this patch does not integrate it into the `async/.await` lowering. That integration should be done in a follow-up PR.
2020-05-22 10:55:01 +02:00
Kevin Per
e776121431 Using !span.from_expansion() instead of snippets 2020-05-22 10:52:06 +02:00
csmoe
16ba3e129d bless issue-72442 2020-05-22 16:16:37 +08:00
bors
de6060b09d Auto merge of #72458 - RalfJung:rollup-g1w1vws, r=RalfJung
Rollup of 6 pull requests

Successful merges:

 - #71607 (clarify interaction of pin drop guarantee and panics)
 - #72125 (remove broken link)
 - #72133 (Add target thumbv7a-uwp-windows-msvc)
 - #72304 (rustc_target: Avoid an inappropriate use of `post_link_objects`)
 - #72309 (Some renaming and minor refactoring for `NativeLibraryKind`)
 - #72438 (Enable ARM TME (Transactional Memory Extensions))

Failed merges:

r? @ghost
2020-05-22 08:04:45 +00:00
Aaron Hill
52bb09abba
Rewrite Parser::collect_tokens
The previous implementation did not work when called on an opening
delimiter, or when called re-entrantly from the same `TokenCursor` stack
depth.
2020-05-22 03:26:45 -04:00
Ralf Jung
64beaffd6a
Rollup merge of #72438 - vertexclique:vcq/aarch64-tme-features, r=Amanieu
Enable ARM TME (Transactional Memory Extensions)

Enables ARM TME coming up with LLVM 10. Related ARM TME intrinsics are included by the merge of #67900.

Enables: https://github.com/rust-lang/stdarch/pull/855
2020-05-22 08:54:55 +02:00
Ralf Jung
afbbb86200
Rollup merge of #72309 - petrochenkov:linkunspec, r=matthewjasper
Some renaming and minor refactoring for `NativeLibraryKind`
2020-05-22 08:54:53 +02:00