121168 Commits

Author SHA1 Message Date
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
Joe Richey
88a37a2086 test/ui/consts: Add tests for const ptr offsets
Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-25 13:09:02 -07:00
Joe Richey
9b3dfd8ea9 core: Make pointer offset methods "const fn"
Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-25 13:09:02 -07:00
Joe Richey
08df3116e9 librustc_mir: Add support for const fn offset/arith_offset
Miri's pointer_offset_inbounds implementation has been moved into
librustc_mir as ptr_offset_inbounds (to avoid breaking miri on a
nightly update). The comments have been slightly reworked to better
match `offset`'s external documentation about what causes UB.

The intrinsic implementations are taken directly from miri.

Signed-off-by: Joe Richey <joerichey@google.com>
2020-05-25 13:09:02 -07:00
Pyry Kontio
8bc31ff905 Fix the same typos again orz 2020-05-26 05:07:00 +09:00
Pyry Kontio
6973fd716b Add bit twiddling 2020-05-26 05:07:00 +09:00
Pyry Kontio
bd68de89b5 remove unneeded and unidiomatic must_use 2020-05-26 05:07:00 +09:00
Jonas Schievink
fe1753af84 Always validate MIR after optimizing 2020-05-25 22:04:48 +02:00
Samrat Man Singh
91dcbbbf50 Allow unlabeled breaks from desugared ? in labeled blocks 2020-05-26 01:18:07 +05:30
Jonas Schievink
e04318e0fa Add a small MIR validation pass 2020-05-25 21:44:36 +02:00
Jonas Schievink
4ca626258a Avoid Operand::Copy with &mut T 2020-05-25 21:44:36 +02:00
Jeremy Stucki
d9f55322cc
Update ui test 2020-05-25 21:41:28 +02:00
Jeremy Stucki
bcfeb4de15
Fix build 2020-05-25 21:41:20 +02:00
Jeremy Stucki
566377f627
Ignore calls to 'len' 2020-05-25 21:41:20 +02:00
Jeremy Stucki
6bd9cd99a3
Add tests 2020-05-25 21:41:19 +02:00
bors
acd484e51d Auto merge of #5641 - ThibsG:DocCommonTools, r=flip1995
Add common lint tools doc

This PR starts adding some documentation about linting tools.

`Retrieving all methods of a type` is not covered at this time.

fixes partially: #3843

changelog: none
2020-05-25 19:33:52 +00:00
bors
6de17b043d Auto merge of #5635 - montrivo:bugfix/option_option_test_case, r=flip1995
option_option test case #4298

Adds regression test case for #4298.

The bug seems still present although rust Playground said otherwise.

changelog: none
2020-05-25 19:22:08 +00:00
Eduardo Broto
60d38ee1dd reversed_empty_ranges: add suggestion for &slice[N..N] 2020-05-25 20:06:15 +02:00
ThibsG
827041252c Add common lint tools doc 2020-05-25 20:03:55 +02:00
ThibsG
705bfdcc46 Extend useless_conversion lint with TryInto 2020-05-25 20:00:39 +02:00
ThibsG
4f8909fad9 Extend useless_conversion lint with TryFrom 2020-05-25 20:00:39 +02:00
Eduardo Broto
ec0a00e539 Use find_map instead of find() + map() 2020-05-25 20:00:08 +02:00
Eduardo Broto
8642fc97dd multiple_crate_versions: skip dev and build deps 2020-05-25 20:00:08 +02:00
Eduardo Broto
cff5cff2f3 Make the name of the crate available in cargo UI tests 2020-05-25 20:00:08 +02:00
Pyry Kontio
d6650e0d2b
Fix typo in src/libcore/num/f32.rs
Co-authored-by: bluss <bluss@users.noreply.github.com>
2020-05-26 02:45:06 +09:00
Pyry Kontio
b6eec22dd4
Fix typo in src/libcore/num/f32.rs
Co-authored-by: bluss <bluss@users.noreply.github.com>
2020-05-26 02:44:55 +09:00
bors
c41916d9bd Auto merge of #5616 - euclio:no-derive-suggestion, r=phansch,flip1995
new_without_default: do not suggest deriving

---

changelog: do not suggest deriving `Default` in `new_without_default`

This commit changes the behavior of the `new_without_default` lint to not suggest deriving `Default`. This suggestion is misleading if the `new` implementation does something different than what a derived `Default` implementation would do, because then the two methods would not be equivalent.

Instead, the `can_derive_default` check is removed, and we always suggest implementing `Default` in terms of `new()`.
2020-05-25 17:19:00 +00:00
bors
f93bb2a50b Auto merge of #72575 - Dylan-DPC:rollup-zo679hv, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #72153 (exhaustively check `ty::Kind` during structural match checking)
 - #72308 (Emit a better diagnostic when function actually has a 'self' parameter)
 - #72560 (Enable `glacier` command via triagebot)
 - #72567 (Clean up E0608 explanation)

Failed merges:

r? @ghost
2020-05-25 17:14:44 +00:00
bors
7ca335a97d Auto merge of #5639 - nickrtorres:unnecessary-mut-passed-doc-cleanup, r=phansch
Clarify the documentation of the `unnecessary_mut_passed` lint

fixes #5433 by replacing "giving" with "passing"

changelog: Clarifies documentation for `unnecessary_mut_passed`
2020-05-25 17:02:12 +00:00
bors
f162dc3ea0 Auto merge of #5646 - flip1995:rustup, r=matthiaskrgr
Rustup

r? @phansch

changelog: none
2020-05-25 16:42:50 +00:00
Dylan DPC
aa8d64b005
Rollup merge of #72567 - GuillaumeGomez:cleanup-e0608, r=Dylan-DPC
Clean up E0608 explanation

r? @Dylan-DPC
2020-05-25 18:07:48 +02:00