Commit Graph

121304 Commits

Author SHA1 Message Date
bors
f28c6de106 Auto merge of #5648 - returntrip:master, r=matthiaskrgr
Add license symlink

To make it easier for Linux distributions to ship the licenses text within the rustc_tools_util crate directory.

changelog: none
2020-05-26 15:23:50 +00:00
bors
291385b3e0 Auto merge of #5609 - phansch:empty-line-after-outer-attr-fix, r=flip1995
Make empty_line_after_outer_attr an early lint

Fixes #5567

Unfortunately I couldn't find a way to reproduce the issue without syn/quote. Considering that most real-world macros use syn and/or quote, I think it's okay to pull them in anyway.

changelog: Fix false positive in [`empty_line_after_outer_attr`]
2020-05-26 15:10:35 +00:00
Philipp Hansch
fd86b3150e
Be less specific about quote and syn versions 2020-05-26 16:52:02 +02:00
Philipp Hansch
cdff59e156
Using dev-dependencies doesn't seem to work w/ compiletest 2020-05-26 16:52:02 +02:00
Philipp Hansch
e3f6a8fc20
Specify quote and syn versions 2020-05-26 16:52:02 +02:00
Philipp Hansch
67167be167
Make empty_line_after_outer_attr an early lint 2020-05-26 16:52:02 +02:00
Alex Crichton
afd88f2a33 Export ZERO_AR_DATE for macos linker invocations
This commit attempts to improve reproducibility of builds on macOS by
exporting the `ZERO_AR_DATE=1` environment variable for all invocations
of the linker. While it looks like this env var is targeted at just the
`ar` command (which does actually read this) it appears that recent-ish
versions of the linker *also* read this environment variable. This
env var forces the linker to set a deterministic zero value for the
mtime in the N_OSO field of the object file.

Currently it's believe that older versions of the linker will simply
ignore this env var, while newer versions will read it and produce a
deterministic output for compilations with debuginfo.

Closes #47086
Closes #66568
2020-05-26 07:38:43 -07:00
Guillaume Gomez
398511a135 Import missing functions from storage.js 2020-05-26 15:11:44 +02:00
Guillaume Gomez
a423d2d4b0 Improve formatting 2020-05-26 15:11:44 +02:00
Guillaume Gomez
05a221216a Remove font-display settings 2020-05-26 14:11:35 +02:00
bors
a00025ab21 Auto merge of #5638 - ebroto:issue_5628_add_suggestion_for_reversed_empty_ranges, r=phansch
reversed_empty_ranges: add suggestion for &slice[N..N]

As discussed in the issue thread, the user accepted this solution. Let me know if this is what we want, or if changing the way we lint the N..N case is prefered.

changelog: reversed_empty_ranges: add suggestion for &slice[N..N]

Closes #5628
2020-05-26 11:56:16 +00:00
bors
578692d9b0 Auto merge of #5562 - flip1995:clippyup_up, r=phansch
Update contributing section about syncing Clippy

[Rendered](https://github.com/flip1995/rust-clippy/blob/clippyup_up/CONTRIBUTING.md#fixing-build-failures-caused-by-rust)

r? @oli-obk Did I get the sync process right?

changelog: none
2020-05-26 11:42:15 +00:00
bors
aeca4d6428 Auto merge of #71900 - GuillaumeGomez:clean-up-rustdoc, r=ollie27,kinnison
Clean up rustdoc source code

Fixes #70498.

r? @kinnison

cc @rust-lang/rustdoc
2020-05-26 10:42:41 +00:00
Amanieu d'Antras
de53276aac Fix test 2020-05-26 11:27:27 +01:00
Amanieu d'Antras
7aa8946c72
Update src/librustc_ast_lowering/expr.rs
Co-authored-by: Oliver Scherer <github35764891676564198441@oli-obk.de>
2020-05-26 11:13:04 +01:00
Amanieu d'Antras
6faa82be42 Eagerly lower asm sub-expressions to HIR even if there is an error
Fixes #72570
2020-05-26 11:06:25 +01:00
Guillaume Gomez
f41d284ea0 Fix eslint lints 2020-05-26 11:18:10 +02:00
Guillaume Gomez
872ddf243e Reexported functions are now declared directly as "windows" field 2020-05-26 11:18:10 +02:00
Guillaume Gomez
deaf5e200e Move "global" code into anonymous functions 2020-05-26 11:18:10 +02:00
Guillaume Gomez
0fa4762a80 Move focusSearchBar and defocusSearchBar functions to the top of the file with other functions 2020-05-26 11:18:10 +02:00
Guillaume Gomez
37bdb3bb3b Update UI test 2020-05-26 11:16:02 +02:00
Joe Richey
71ef8414bd Add checks and tests for computing abs(offset_bytes)
The previous code paniced if offset_bytes == i64::MIN. This commit:
  - Properly computes the absoulte value to avoid this panic
  - Adds a test for this edge case

Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-26 02:06:18 -07:00
Joe Richey
6367b544b7 librustc_middle: Add function for computing unsigned abs
This is tricky to get right if we want to avoid panicking or wrapping.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-26 02:06:15 -07:00
Guillaume Gomez
b9ba4b3810
Small cell example update 2020-05-26 10:47:54 +02:00
Yuki Okushi
3d4f4787a6
Update allowed crates list 2020-05-26 16:38:09 +09:00
bors
cb272d5d21 Auto merge of #72093 - jonas-schievink:unmut, r=oli-obk
Avoid `Operand::Copy` with `&mut T`

This is generally unsound to do, as the copied type is assumed to implement
`Copy`.

Closes https://github.com/rust-lang/rust/issues/46420
2020-05-26 07:20:52 +00:00
bors
182ac89f16 Auto merge of #5636 - ebroto:issue_5041, r=phansch
multiple_crate_versions: skip dev and build deps

changelog: multiple_crate_versions: skip dev and build deps

Closes #5041
2020-05-26 06:23:58 +00:00
Jeremy Fitzhardinge
ffa493ab57 Implement warning for unused dependencies.
This will print a diagnostic for crates which are mentioned as `--extern`
arguments on the command line, but are never referenced from the source.

This diagnostic is controlled by `-Wunused-crate-dependencies` or
`#![warn(unused_crate_dependencies)]` and is "allow" by default.

There are cases where certain crates need to be linked in but are not
directly referenced - for example if they are providing symbols for C
linkage. In this case the warning can be suppressed with
`use needed_crate as _;`.

Thanks to @petrochenkov for simplified core.

Resolves issue #57274
2020-05-25 22:47:55 -07:00
Yuki Okushi
9f8628b38c
cargo update -p atty --aggressive
Updating atty v0.2.11 -> v0.2.14
    Removing c2-chacha v0.2.3
    Updating cc v1.0.52 -> v1.0.54
    Updating ppv-lite86 v0.2.6 -> v0.2.8
    Updating rand_chacha v0.2.1 -> v0.2.2
    Removing redox_termios v0.1.1
    Removing termion v1.5.1
2020-05-26 13:35:21 +09:00
Yuki Okushi
a6e58ae3ce
cargo update -p rls-analysis
Removing itertools v0.7.8
    Updating rls-analysis v0.18.0 -> v0.18.1
    Updating rls-span v0.5.1 -> v0.5.2
2020-05-26 13:33:06 +09:00
Yuki Okushi
b4b76b8206
cargo update -p regex --aggressive
Updating aho-corasick v0.7.3 -> v0.7.10
    Updating memchr v2.3.2 -> v2.3.3
    Updating regex v1.1.6 -> v1.3.7
    Updating regex-syntax v0.6.6 -> v0.6.17
    Removing thread_local v0.3.6
    Removing ucd-util v0.1.3
    Removing utf8-ranges v1.0.2
2020-05-26 13:06:07 +09:00
Yuki Okushi
1f0a395079
cargo update -p colored
Updating colored v1.6.0 -> v1.9.3
    Removing lazy_static v0.2.11
2020-05-26 13:05:49 +09:00
Aaron Hill
4e2696f54a
Only capture tokens for items with outer attributes
Suggested by @petrochenkov in https://github.com/rust-lang/rust/issues/43081#issuecomment-633389225
2020-05-25 23:44:40 -04:00
Pyry Kontio
66da735096 Add tracing issue for total_cmp 2020-05-26 11:59:23 +09:00
bors
9eedd138ee Auto merge of #71487 - rcoh:71471-shebang, r=petrochenkov
Fix bug in shebang handling

Shebang handling was too agressive in stripping out the first line in cases where it is actually _not_ a shebang, but instead, valid rust (#70528). This is a second attempt at resolving this issue (the first attempt was reverted, for, among other reasons, causing an ICE in certain cases (#71372, #71471).

The behavior is now codified by a number of UI tests, but simply:
For the first line to be a shebang, the following must all be true:
1. The line must start with `#!`
2. The line must contain a non-whitespace character after `#!`
3. The next character in the file, ignoring comments & whitespace must not be `[`

I believe this is a strict superset of what we used to allow, so perhaps a crater run is unnecessary, but probably not a terrible idea.

Fixes #70528
2020-05-26 01:43:40 +00:00
Eric Huss
a0431e26fe Update cargo 2020-05-25 17:56:32 -07:00
Eric Huss
0fdbfd3f05 Update books 2020-05-25 17:17:27 -07:00
Dhruv Jauhar
c3dc8c455c Rename upvar_list to closure_captures
As part of supporting RFC 2229, we will be capturing all the places that
are mentioned in a closure. Currently the upvar_list field gives access
to a FxIndexMap<HirId, Upvar> map. Eventually this will change, with the
upvar_list having a more general structure that expresses captured
paths, not just the mentioned upvars. We will make those changes in
subsequent PRs.

This commit modifies the name of the upvar_list map to closure_captures
in TypeckTables.

Co-authored-by: Dhruv Jauhar <dhruvjhr@gmail.com>
Co-authored-by: Aman Arora <me@aman-arora.com>
2020-05-25 16:41:56 -07:00
bors
698c5c6d95 Auto merge of #72589 - Dylan-DPC:rollup-7l2a2bo, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #72061 (add regression tests for stalled_on const vars)
 - #72424 (fix ICE when debug-printing MIR)
 - #72450 (Fix ice-#72442)
 - #72451 (Perform MIR NRVO even if types don't match)
 - #72538 (Removed all instances of const_field.)

Failed merges:

r? @ghost
2020-05-25 22:04:44 +00:00
Dylan DPC
b6a8915b20
Rollup merge of #72538 - rakshith-ravi:refactor/remove-const-query, r=oli-obk
Removed all instances of const_field.

Fixes #72264

r? @oli-obk
2020-05-25 23:58:59 +02:00
Dylan DPC
036688f875
Rollup merge of #72451 - ecstatic-morse:nrvo-type-mismatch, r=matthewjasper
Perform MIR NRVO even if types don't match

This is the most straightforward way to resolve #72428, but it could cause problems in codegen since the type of `_0` may no longer match the return type of the body.
2020-05-25 23:58:57 +02:00
Dylan DPC
a7ff5a0077
Rollup merge of #72450 - csmoe:issue-72442, r=oli-obk
Fix ice-#72442

Closes #72442
Closes #72426
r? @oli-obk
2020-05-25 23:58:56 +02:00
Dylan DPC
0498845e54
Rollup merge of #72424 - RalfJung:mir-print-ice, r=oli-obk
fix ICE when debug-printing MIR

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

This bug also makes debugging Miri harder as `MIRI_LOG=info` ICEs.
2020-05-25 23:58:54 +02:00
Dylan DPC
b3f1b9541a
Rollup merge of #72061 - lcnr:const-inference-test, r=eddyb
add regression tests for stalled_on const vars

closes #70180

Afaict this has been fixed sometime after #70213

`trait_ref_type_vars` correctly adds const infers and I did not find any remaining `FIXME`s which correspond to this issue.
7c59a81a5f/src/librustc_trait_selection/traits/fulfill.rs (L555-L557)

Added both examples from the issue as regression tests and renamed `trait_ref_type_vars` -> `trait_ref_infer_vars`.

r? @eddyb
2020-05-25 23:58:53 +02:00
bors
2a6cfa7f05 Auto merge of #5647 - ebroto:5644_allow_ptr_arg_in_arg_position, r=flip1995
ptr_arg: honor `allow` attribute on arguments

The `intravisit::Visitor` impl for `LateContextAndPass` only takes into account the attributes of a function parameter inside the `check_param` method. `ptr_arg` starts its heuristics at `check_item` / `check_impl_item` / `check_trait_item`, so the `allow` is not taken into account automatically.

changelog: ptr_arg: honor `allow` attribute on arguments

Fixes #5644
2020-05-25 21:47:07 +00:00
Eduardo Broto
a1824e187c ptr_arg: honor allow attr on arguments 2020-05-25 23:09:06 +02:00
returntrip
f2154e9837 To make it easier for Linux distributions, ship the licenses text within
each crate directory.
2020-05-25 23:06:08 +02:00
Joe Richey
55577b411c
librustc_mir: Add back use statement
Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-25 13:40:01 -07:00
bors
dd06d2983f Auto merge of #4429 - jeremystucki:or_fun_call, r=flip1995
Update 'or_fun_call' to ignore calls to len

Resolves #1653

changelog: Update `or_fun_call`: Allow calls to `len` for Slice, Array & Vec.
2020-05-25 20:15:34 +00:00
Joe Richey
6b20f58c0d miri_unleached: We now allow offset in const fn
Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-25 13:09:02 -07:00