121526 Commits

Author SHA1 Message Date
Michael Wright
6122612232 Increase cargo_metadata version to 0.9.1
`clippy_lints` makes use of `dep_kinds` on `NodeDep` but this was only
added in versoin 0.9.1. Compiling with 0.9.0 will fail because of this.
2020-05-31 17:38:59 +02:00
Dennis Duda
036da3a6dc Make remote-test-client work as cargo runner again
Since cargo appends executable/args, the support_lib count
parameter has to come first.
2020-05-31 17:36:17 +02:00
Dennis Duda
0199fdc0f7 Update help text of remote-test-client to reflect changed command 2020-05-31 17:23:46 +02:00
Dennis Duda
577ac2f836 Fix set_permissions call for non-windows 2020-05-31 17:23:46 +02:00
Dennis Duda
41d540fcb7 Unify temp path generation for non-android 2020-05-31 17:23:46 +02:00
Dennis Duda
a367956100 Make remote-test-client and remote-test-server compatible with windows
`compiletest` and `remote-test-client`:

The command line for `remote-test-client` was changed slightly
to allow cross-platform compatible paths. The old way of supplying
the support libs was by joining their paths with the executable path
with `:`. This caused Windows-style paths to be split after the
directory letter. Now, the number of support libs is provided
as a parameter as well, and the support lib paths are split off
from the regular args in the client.

`remote-test-server`:

- Marked Unix-only parts as such and implemented Windows alternatives
- On Windows `LD_LIBRARY_PATH` doesn't exist. Libraries are
  loaded from `PATH` though, so that's the way around it.
- Tiny cleanup: `Command::args`/`envs` instead of manually
  looping over them
- The temp path for Windows has to be set via environment variable,
  since there isn't a global temp directory that would work on every
  machine (as a static string)
2020-05-31 17:23:46 +02:00
Bastian Kauschke
9f83d36edc remove trivial calls to mk_const 2020-05-31 17:16:55 +02:00
bors
8aa8f42556 Auto merge of #5667 - djugei:master, r=flip1995
moved cast_ptr_alignment to pedantic and expanded documentation

fixes: #5618
changelog: cast_ptr_alignment moved to pedantic
2020-05-31 14:26:03 +00:00
Jonas Schievink
309661e84f InstCombine: Don't optimize &mut *x into x 2020-05-31 16:22:23 +02:00
djugei
18b5ceed79
ran update_lints 2020-05-31 16:00:29 +02:00
bors
8b191b5a6e Auto merge of #5666 - flip1995:rollup-yjyvvbg, r=flip1995
Rollup of 3 pull requests

Successful merges:

 - #5637 (new lint: vec_resize_to_zero)
 - #5656 (len_zero: skip ranges if feature `range_is_empty` is not enabled)
 - #5663 (add testcase that no longer ICEs)

Failed merges:

r? @ghost

changelog: rollup
2020-05-31 13:57:08 +00:00
djugei
0bcfae92f8
moved cast_ptr_alignment to pedantic and expanded documentation 2020-05-31 15:41:33 +02:00
bors
f6072cab13 Auto merge of #72813 - RalfJung:rollup-4ko6q8j, r=RalfJung
Rollup of 5 pull requests

Successful merges:

 - #72683 (from_u32_unchecked: check validity, and fix UB in Wtf8)
 - #72715 (Account for trailing comma when suggesting `where` clauses)
 - #72745 (generalize Borrow<[T]> for Interned<'tcx, List<T>>)
 - #72749 (Update stdarch submodule to latest head)
 - #72781 (Use `LocalDefId` instead of `NodeId` in `resolve_str_path_error`)

Failed merges:

r? @ghost
2020-05-31 13:39:05 +00:00
Ralf Jung
f793c0b1bf always print MIR Location when validator finds a problem 2020-05-31 15:23:45 +02:00
Ralf Jung
9a4bdbff9e more checks for SwitchInt 2020-05-31 15:07:16 +02:00
Philipp Krones
00c656d8ee
Rollup merge of #5663 - matthiaskrgr:crash_test_3969, r=Manishearth
add testcase that no longer ICEs

Fixes #3969

changelog: none
2020-05-31 14:57:34 +02:00
Philipp Krones
873c9fc8f2
Rollup merge of #5656 - ebroto:len_zero_ranges, r=matthiaskrgr
len_zero: skip ranges if feature `range_is_empty` is not enabled

If the feature is not enabled, calling `is_empty()` on a range is ambiguous. Moreover, the two possible resolutions are unstable methods, one inherent to the range and the other being part of the `ExactSizeIterator` trait.

Since `len_zero` only checks for existing `is_empty()` inherent methods, we only take into account the `range_is_empty` feature.

Related: https://github.com/rust-lang/rust/issues/48111#issuecomment-445132965

changelog: len_zero: avoid linting ranges without #![feature(range_is_empty)]

Fixes: #3807
2020-05-31 14:57:33 +02:00
Philipp Krones
0fff522071
Rollup merge of #5637 - montrivo:feature/vec_resize_to_zero, r=yaahc,flip1995
new lint: vec_resize_to_zero

implements #5444

changelog: new lint vec_resize_to_zero
2020-05-31 14:57:32 +02:00
bors
871f3ed92e Auto merge of #5655 - matthiaskrgr:source_mod, r=flip1995
cargo_dev: add ra-setup

It takes an absolute path to a rustc repo and adds path-dependencies
that point towards the respective rustc subcrates into the Cargo.tomls of
the clippy and clippy_lints crate.

This allows rustc-analyzer to show proper type annotations etc on rustc-internals inside the clippy repo.

Usage: cargo dev ra-setup /absolute/path/to/rust/

cc https://github.com/rust-analyzer/rust-analyzer/issues/3517
cc https://github.com/rust-lang/rust-clippy/issues/5514

changelog: none
2020-05-31 12:55:26 +00:00
Ralf Jung
e07e42433f replace DUMMY_SP by proper span 2020-05-31 14:49:33 +02:00
Guillaume Gomez
7a2efa3a10 Put input timeout clearance inside a function 2020-05-31 14:27:33 +02:00
bors
5713574991 Auto merge of #5665 - flip1995:rustup, r=matthiaskrgr
Rustup

r? @matthiaskrgr

I finally got to doing the rustup. Sorry for taking so long, I was busy the last few days.

@ebroto FYI: I had to add b6c58f0 to make Clippy pass the rustc test suite.

changelog: none
2020-05-31 12:23:08 +00:00
Guillaume Gomez
1fbc037da6 Clean up E0622 explanation 2020-05-31 14:09:15 +02:00
flip1995
37381d33a4
Fix sync fallout 2020-05-31 14:05:57 +02:00
flip1995
e6f5dd52a4
Merge remote-tracking branch 'upstream/master' into rustup 2020-05-31 13:40:23 +02:00
Ralf Jung
532dabdb8e Miri tests: skip parts of test_char_range 2020-05-31 12:12:45 +02:00
Ralf Jung
cbc73dc263
Rollup merge of #72781 - marmeladema:rustdoc-def-id-resolve-str-path-error, r=petrochenkov
Use `LocalDefId` instead of `NodeId` in `resolve_str_path_error`

Together with https://github.com/rust-lang/rust/pull/72777 this should remove all uses of `NodeId` in `rustdoc`.

cc #50928

r? @petrochenkov
2020-05-31 12:03:30 +02:00
Ralf Jung
e16bd0206b
Rollup merge of #72749 - vertexclique:vcq/update-stdarch, r=Amanieu
Update stdarch submodule to latest head

Includes avx512 work & aarch64 tme.
2020-05-31 12:03:28 +02:00
Ralf Jung
e0b25905af
Rollup merge of #72745 - lcnr:interned-cleanup, r=petrochenkov
generalize Borrow<[T]> for Interned<'tcx, List<T>>
2020-05-31 12:03:26 +02:00
Ralf Jung
b714f5c9ac
Rollup merge of #72715 - estebank:trailing-comma-where, r=petrochenkov
Account for trailing comma when suggesting `where` clauses

Fix #72693.
2020-05-31 12:03:24 +02:00
Ralf Jung
3bbb475f00
Rollup merge of #72683 - RalfJung:char-debug-check, r=Mark-Simulacrum
from_u32_unchecked: check validity, and fix UB in Wtf8

Fixes https://github.com/rust-lang/rust/issues/72760
2020-05-31 12:03:22 +02:00
bors
4b1f86adbe Auto merge of #72759 - alexcrichton:update-compiler-builtins, r=Mark-Simulacrum
Update compiler-builtins

Pulls in a fix for #72758, more details on the linked issue.

[Crate changes included here][changes]

[changes]: https://github.com/rust-lang/compiler-builtins/compare/0.1.28...0.1.31

Closes #72758
2020-05-31 09:54:44 +00:00
Ivan Tham
71404633e8 Merge raw_vec into_box with previous impl<T, Global>
There are two separate `impl<T, Global>` which no special reason, it would be
better to merge both of them.
2020-05-31 17:19:06 +08:00
Ivan Tham
79449986b7 Rearrange impl blocks with Deref as first
The other blocks depends on Deref to make it easier for readers when
reimplementing or reading the implementations.
2020-05-31 17:16:47 +08:00
Ralf Jung
5707838480 validate basic sanity for TerminatorKind 2020-05-31 10:50:19 +02:00
Bastian Kauschke
0441763694 remove fixme for stalled_on 2020-05-31 10:01:45 +02:00
bors
b6fa392238 Auto merge of #72743 - lcnr:predicate_f, r=nikomatsakis
fix EncodeWithShorthand for Predicate

r? @nikomatsakis
2020-05-31 04:44:38 +00:00
XIAO Tian
1a68c8e8d9 Fix associate type diagnostics 2020-05-31 12:13:30 +08:00
XIAO Tian
3bf9eb0f7a Add a test for wrong assoc type diagnostics 2020-05-31 12:13:30 +08:00
bors
ea7181b5f7 Auto merge of #72116 - petrhosek:fuchsia-ld-flags, r=tmandry
Update the Fuchsia linker defaults

This updates the linker defaults aligning them with Clang. Specifically,
we use 4K pages on all platforms, we always use BIND_NOW, we prefer all
loadable segments be separate and page aligned, and we support RELR
relocations.
2020-05-31 01:07:37 +00:00
Mahmut Bulut
15201af7ed Update stdarch submodule to latest head 2020-05-31 00:12:59 +02:00
Vadim Petrochenkov
81e06dac84 Add a test for $:ident in proc macro input 2020-05-31 00:24:56 +03:00
bors
8c5402efdd Auto merge of #72794 - RalfJung:rollup-gzs4nl4, r=RalfJung
Rollup of 13 pull requests

Successful merges:

 - #72543 (Account for missing lifetime in opaque and trait object return types)
 - #72625 (Improve inline asm error diagnostics)
 - #72637 (expand `env!` with def-site context)
 - #72650 (Sort sidebar elements)
 - #72657 (Allow types (with lifetimes/generics) in impl_lint_pass)
 - #72666 (Add -Z profile-emit=<path> for Gcov gcda output.)
 - #72668 (Fix missing parentheses Fn notation error)
 - #72669 (rustc_session: Cleanup session creation)
 - #72728 (Make bootstrap aware of relative libdir in stage0 compiler)
 - #72757 (rustc_lexer: Optimize shebang detection slightly)
 - #72772 (miri validation: clarify valid values of 'char')
 - #72773 (Fix is_char_boundary documentation)
 - #72777 (rustdoc: remove calls to `local_def_id_from_node_id`)

Failed merges:

r? @ghost
2020-05-30 21:23:19 +00:00
Vadim Petrochenkov
4d5ce340cd test-macros: Avoid always producing errors in #[derive(Print)] 2020-05-31 00:17:33 +03:00
Ralf Jung
581eafcdf7
Rollup merge of #72777 - marmeladema:rustdoc-remove-local-def-id-from-node-id, r=petrochenkov
rustdoc: remove calls to `local_def_id_from_node_id`

rustdoc calls `local_def_id_from_node_id(CRATE_NODE_ID)` when it can just creates a top level `DefId` using `DefId::local(CRATE_DEF_INDEX)`.

cc #50928

r? @petrochenkov
2020-05-30 23:09:04 +02:00
Ralf Jung
b7f6a0b322
Rollup merge of #72773 - Rantanen:is_char_boundary-docs, r=joshtriplett
Fix is_char_boundary documentation

Given the "start _and/or end_" wording in the original, the way I understood it was that the `str::is_char_boundary` method would also return `true` for the last byte in a UTF-8 code point sequence. (Which would have meant that for a string consisting of nothing but 1 and 2 byte UTF-8 code point sequences, it would return nothing but `true`.)

In practice the method returns `true` only for the starting byte of each sequence and the end of the string: [Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e9f5fc4d6bf2f1bf57a75f3c9a180770)

I was also somewhat tempted to remove the _The start and end of the string are considered to be boundaries_, since that's implied by the first sentence, but I decided to avoid bikeshedding over it and left it as it was since it's not wrong in relation to how the method behaves.
2020-05-30 23:09:02 +02:00
Ralf Jung
356d1e9f4f
Rollup merge of #72772 - RalfJung:valid-char, r=petrochenkov
miri validation: clarify valid values of 'char'

The old text said "expected a valid unicode codepoint", which is not actually correct -- it has to be a scalar value (which is a code point that is not part of a surrogate pair).
2020-05-30 23:09:00 +02:00
Ralf Jung
32481bc80a
Rollup merge of #72757 - petrochenkov:shebang, r=varkor
rustc_lexer: Optimize shebang detection slightly

Sorry, I just couldn't resist.
It shouldn't make any difference in practice.

Also, documented a previously unnoticed case with doc comments treated as regular comments during shebang detection.
2020-05-30 23:08:58 +02:00
Ralf Jung
8f1c0d0a10
Rollup merge of #72728 - o01eg:fix-72661, r=Mark-Simulacrum
Make bootstrap aware of relative libdir in stage0 compiler

Follows up #72692

Fixes #72661
2020-05-30 23:08:57 +02:00
Ralf Jung
278e26eaf6
Rollup merge of #72669 - petrochenkov:smclean, r=Mark-Simulacrum
rustc_session: Cleanup session creation

Noticed while reviewing https://github.com/rust-lang/rust/pull/72618.
2020-05-30 23:08:55 +02:00