Commit graph

91662 commits

Author SHA1 Message Date
Yuki OKUSHI
0778847833 Use ErrorReported 2019-03-29 04:42:03 +09:00
Yuki OKUSHI
6c8e3a5378 Remove unused variable 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
f0de8e82b8 Return correct values 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
0e76b34aa7 WIP: remove report_as_error 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
ee0e1b7615 Set ok value 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
526b355858 Remove err_count 2019-03-29 04:32:36 +09:00
Yuki OKUSHI
3ba7454152 Use track_errors 2019-03-29 04:32:36 +09:00
mark
9f14e146ed deny duplicate matcher bindings by default 2019-03-28 14:27:16 -05:00
CrLF0710
d9bdd01ac0 Stablize {f32,f64}::copysign(). 2019-03-29 03:20:50 +08:00
Pietro Albini
8fd3be596f
fix broken download link in the armhf-gnu image 2019-03-28 19:51:05 +01:00
Matt Brubeck
8dbae794b0 Use write_all instead of write in example code 2019-03-28 11:28:50 -07:00
John Kåre Alsaker
e9a8befd2d Remove unnecessary with_globals calls 2019-03-28 18:58:43 +01:00
hgallagher1993
4644c3a6aa Add check for when left and right overlap and change span for explanation to point at operator 2019-03-28 13:54:29 -04:00
Eric Huss
7a5c82d579 Add edition-guide to toolstate.
Also, add me to reference, alercah has taken a step back from involvement.
2019-03-28 10:23:15 -07:00
John Kåre Alsaker
dee389f749 Run module lint passes in parallel 2019-03-28 16:29:09 +01:00
John Kåre Alsaker
cd32f9bcca Remove LintSession and run incremental and whole crate lints in parallel 2019-03-28 16:29:08 +01:00
John Kåre Alsaker
41316f0449 Combine all builtin late lints 2019-03-28 16:29:07 +01:00
Mazdak Farrokhzad
0f26958cea
Rollup merge of #59429 - estebank:for-loop-move-nll, r=petrochenkov
When moving out of a for loop head, suggest borrowing it in nll mode

Follow up to #59195 for NLL.
2019-03-28 13:35:44 +01:00
Mazdak Farrokhzad
06a9196055
Rollup merge of #59408 - euclio:compiletest-normalization, r=oli-obk
compiletest: make path normalization smarter

Fixes #59109.
2019-03-28 13:35:43 +01:00
Mazdak Farrokhzad
b75b165589
Rollup merge of #59398 - phansch:rustfix_coverage, r=oli-obk
Add a way to track Rustfix UI test coverage

This came out of the first Rustfix WG meeting.

One of the goals is to enable Rustfix tests for all UI tests that
trigger lints with `MachineApplicable` suggestions. In order to do that
we first want to create a tracking issue that lists all files with
missing `// run-rustfix` headers.

This PR adds a `--rustfix-coverage` flag to `./x.py` and compiletest to
list the files with the missing headers in `/tmp/rustfix_missing_coverage.txt`.

From that file we can create the tracking issue and at some point also
enforce the `// run-rustfix` flag on UI tests with `MachineApplicable`
lints.
2019-03-28 13:35:41 +01:00
Mazdak Farrokhzad
a92d689b12
Rollup merge of #59371 - dlrobertson:rename_va_list_copy, r=joshtriplett
ffi: rename VaList::copy to VaList::with_copy

Rename `VaList::copy` to `VaList::with_copy`

r? @joshtriplett
2019-03-28 13:35:40 +01:00
Mazdak Farrokhzad
f591d25f43
Rollup merge of #59363 - peterjoel:issue_59361_edition_opt_shortlist, r=nagisa
#59361 Moved rustc edition opt to short list

Addresses #59361, in case that issue is accepted.
2019-03-28 13:35:38 +01:00
Mazdak Farrokhzad
9ca8f6aa79
Rollup merge of #59320 - alexcrichton:wasm-clang, r=sanxiyn
rustc: Allow using `clang` for wasm32 targets

This commit adds support code for using `clang` directly to link the
wasm32-unknown-unknown target. Currently the target is only really
configured to link with LLD directly, but this ensures that `clang` can
be configured as well.

While not immediately useful in the near term it's likely that more
wasm32 targets will pop up over time with Clang's new native support for
WebAssembly in the 8.0.0 release. Getting support into rustc early
should make it easier to experiment with these targets and try out
various changes here and there.
2019-03-28 13:35:36 +01:00
Mazdak Farrokhzad
f6d2a3feb7
Rollup merge of #59318 - alexcrichton:check-for-clang, r=michaelwoerister
rustc: Update linker flavor inference from filename

This commit fixes what is believed to be a preexisting bug in the linker
flavor inference and additionally adds a new features. Previously if the
linker didn't end in `exe` the entire file name was compared to infer
the linker's flavor. This commit fixes the code to instead
unconditionally inspect `file_stem()` which is the relevant part we're
looking at to figure out what the linker flavor is.

Additionally this commit now also adds recognition of `clang` and clang
wrappers that end in `-clang` (which look like gcc wrappers). This
should allow clang-specific wrappers to get correctly inferred to the
`Gcc` linker flavor rather than the default linker flavor configured for
a target.
2019-03-28 13:35:35 +01:00
Mazdak Farrokhzad
4720fcac4c
Rollup merge of #59216 - stepnivlk:type_dependent_defs-wrappers, r=oli-obk
Type dependent defs wrappers

First of all, forgive me if something would seem lame to you or I offend some rule (although I tried to read through docs), this is my first PR.

Issue: https://github.com/rust-lang/rust/issues/59094

This PR adds 3 helper methods to `TypeckTables`:
* `opt_type_dependent_def`
* `opt_type_dependent_def_id`
* `type_dependent_def_id`

I didn't add `type_dependent_def` as was proposed in the issue simply because it wasn't used anywhere in the code. Only non-option wrapped`type_dependent_defs()[]` accesses were found in clippy which always called `def_id()` on result.
Speaking of clippy, should I open separate PR in its own repo, given it's used as submodule here?

Sry it took me so long, as I said I'm new here and I had tough week :).
2019-03-28 13:35:33 +01:00
Mazdak Farrokhzad
edad34b3d7
Rollup merge of #59091 - Zoxc:eval_always, r=michaelwoerister
Combine input and eval_always query types

Hardcoding `Krate` as a dependency of `eval_always` queries doesn't really make sense if we want to use the query system before HIR lowering / hashing. Without that hardcoding they become pretty much identical to `input` queries, so I combined them to a single type. This will regress the `clean` incremental scenario, but that isn't terribly common.

r? @michaelwoerister
2019-03-28 13:35:31 +01:00
Mazdak Farrokhzad
f90ac4f04a
Rollup merge of #58717 - hellow554:nonzero_parse, r=oli-obk
Add FromStr impl for NonZero types

This is a WIP implementation because I do have some questions regarding the solution.

Somebody should ping the lang team on this I guess.
Please see the annotations on the code for more details.

Closes #58604
2019-03-28 13:35:29 +01:00
Felix S. Klock II
528366d3ff Revise and generalize the macros-unlinted tests.
Review feedback asked for the test to be generalized to include macros
2.0; that generalization is dyn-2015-idents-in-decl-macros-unlinted.rs

As a drive-by, I also decided to revise the test to make it clear
*why* we cannot generally lint these cases. (I already had similar
demonstrations in dyn-2015-edition-keyword-ident-lint.rs, but it does
not hurt to try to emphasize matters.)

I also added some commentary on the cases where we could choose to
make the lint smarter, namely the situations where a macro is
*definitely* using `dyn` as an identifier (because it is using it as a
path component).
2019-03-28 13:08:56 +01:00
Felix S. Klock II
f043d2da65 Revise test slightly so that dyn in macro invocation *must* be parsed as keyword in test.
Back-story: After reflection this morning, I realized that the
previous form of this test would allow the macro invocation to treat
the `dyn` input as a raw-identifier rather than a keyword, and since
the input was discarded by that version of the macro, the test would
pass despite the detail that the input `dyn` should not have been
parsed as a raw-identifier.

This revision fixes that oversight, by actually *using* the macro
input to construct a `Box<dyn Trait>` type.
2019-03-28 12:49:50 +01:00
Esteban Küber
e3918cf621 Recover from parse error in tuple syntax 2019-03-28 04:47:37 -07:00
gnzlbg
81402db501 Update stdsimd 2019-03-28 10:13:08 +01:00
Marcel Hellwig
8f3e862797 fixed shift overflow
Fix according to oli-obk
(https://github.com/rust-lang/rust/pull/58717#issuecomment-477494457)
2019-03-28 10:12:17 +01:00
bors
237bf3244f Auto merge of #59478 - Centril:rollup, r=Centril
Rollup of 12 pull requests

Successful merges:

 - #57987 (Fix some AArch64 typos)
 - #58581 (Refactor generic parameter encoder functions)
 - #58803 (fs::copy() unix: set file mode early)
 - #58848 (Prevent cache issues on version updates)
 - #59198 (Do not complain about unmentioned fields in recovered patterns)
 - #59351 (Include llvm-ar with llvm-tools component)
 - #59413 (HirIdify hir::ItemId)
 - #59441 (Remove the block on natvis for lld-link.)
 - #59448 (Use consistent phrasing for all macro summaries)
 - #59456 (Add documentation about `for` used as higher ranked trait bounds)
 - #59472 (Document that `std::io::BufReader` discards contents on drop)
 - #59474 (Fix link capitalization in documentation of std::io::BufWriter.)

Failed merges:

r? @ghost
2019-03-28 08:56:34 +00:00
Mazdak Farrokhzad
d403cd787c
Rollup merge of #59474 - czipperz:bufwriter-fix-link-capitalization, r=Centril
Fix link capitalization in documentation of std::io::BufWriter.
2019-03-28 08:43:43 +01:00
Mazdak Farrokhzad
2d171d8350
Rollup merge of #59472 - czipperz:bufreader-document-drop-discards, r=Centril
Document that `std::io::BufReader` discards contents on drop

Resolves #55546
2019-03-28 08:43:42 +01:00
Mazdak Farrokhzad
d5b8048245
Rollup merge of #59456 - czipperz:for-keyword-document-higher-ranked-trait-bounds, r=Centril
Add documentation about `for` used as higher ranked trait bounds

Resolves #55416
2019-03-28 08:43:40 +01:00
Mazdak Farrokhzad
2ee038af8c
Rollup merge of #59448 - benesch:macro-doc, r=Centril
Use consistent phrasing for all macro summaries

None
2019-03-28 08:43:39 +01:00
Mazdak Farrokhzad
02c1e3dfc1
Rollup merge of #59441 - TheGoddessInari:natvis, r=alexcrichton
Remove the block on natvis for lld-link.

Since #56642 bumped minimum LLVM version to 6.0.0, Rust should be able to honor or ignore Windows natvis support with lld-link.

It looks like  https://github.com/llvm-mirror/lld/commit/9133ca57b was in LLVM 7.0, while https://github.com/llvm-mirror/lld/commit/27b9c4285 made it into 6.0, at least if the release branches are anything to go by.

Fixes #59383.
2019-03-28 08:43:37 +01:00
Mazdak Farrokhzad
95ef5eb3af
Rollup merge of #59413 - Zoxc:hirid, r=oli-obk
HirIdify hir::ItemId

Version of https://github.com/rust-lang/rust/pull/59092.

r? @oli-obk
2019-03-28 08:43:36 +01:00
Mazdak Farrokhzad
e04b7b8f54
Rollup merge of #59351 - phil-opp:llvm-ar, r=alexcrichton
Include llvm-ar with llvm-tools component

Adds the `llvm-ar` tool to the `llvm-tools` component. This is useful for [building and linking native code](https://doc.rust-lang.org/cargo/reference/build-scripts.html#case-study-building-some-native-code) in cargo build scripts without needing to use the platform specific `ar`. According to #58663 it is also useful for WASM.

 `llvm-ar` is very small (~82KB), so it does not significantly increase the size of the `llvm-tools` component.

Fixes #58663
2019-03-28 08:43:34 +01:00
Mazdak Farrokhzad
dcd531ea15
Rollup merge of #59198 - estebank:recovered-pattern, r=zackmdavis
Do not complain about unmentioned fields in recovered patterns

When the parser has to recover from malformed code in a pattern, do not
complain about missing fields.

Fix #59145.
2019-03-28 08:43:32 +01:00
Mazdak Farrokhzad
20f063a939
Rollup merge of #58848 - GuillaumeGomez:fix-cache-issues, r=Mark-Simulacrum,ollie27
Prevent cache issues on version updates

Fixes #58827.

cc @rust-lang/infra
2019-03-28 08:43:30 +01:00
Mazdak Farrokhzad
83d91d3ac4
Rollup merge of #58803 - haraldh:fs_copy_fix, r=alexcrichton
fs::copy() unix: set file mode early

A convenience method like fs::copy() should try to prevent pitfalls a
normal user doesn't think about.

In case of an empty umask, setting the file mode early prevents
temporarily world readable or even writeable files,
because the default mode is 0o666.

In case the target is a named pipe or special device node, setting the
file mode can lead to unwanted side effects, like setting permissons on
`/dev/stdout` or for root setting permissions on `/dev/null`.

copy_file_range() returns EINVAL, if the destination is a FIFO/pipe or
a device like "/dev/null", so fallback to io::copy, too.

Fixes: https://github.com/rust-lang/rust/issues/26933
Fixed: https://github.com/rust-lang/rust/issues/37885
2019-03-28 08:43:29 +01:00
Mazdak Farrokhzad
5a90b66de3
Rollup merge of #58581 - varkor:const-generics-encoder-refactor, r=eddyb
Refactor generic parameter encoder functions

Addresses https://github.com/rust-lang/rust/pull/58503#discussion_r257488950.

r? @eddyb
2019-03-28 08:43:27 +01:00
Mazdak Farrokhzad
c313647a95
Rollup merge of #57987 - parched:va-args, r=joshtriplett
Fix some AArch64 typos

cc @dlrobertson
2019-03-28 08:43:23 +01:00
bors
6bfe4b7b51 Auto merge of #59336 - gnzlbg:hint_black_box, r=alexcrichton
Moves test::black_box to core::hint and fix black_box on wasm32 and asm.js

This changes removes a cyclic dependency between the "test" and "libtest"
crates, where "libtest" depends on "test" for "black_box", but "test" depends on
"libtest" for everything else.

I've chosen the "hint" module because there seems to be enough consensus in the
discussion of RFC2360 that this module is where such an intrinsic would belong,
but this PR does not implement that RFC! If that RFC ever gets merged, the API, docs,
etc. of this API will need to change. This PR just move the implementation of the
already existing API.

For backwards compatibility reasons I've chosen to also keep the "test" feature
gate for these instead of adding a new feature gate. If we change the feature
gate, we'll potentially all benchmarks, and while that's something that we could
do, it seems unnecessary to do that now - if RFC2360 gets merged, we'll need to
do that anyways. Backwards compatibility is also why we continue to re-export
"black_box" from the "test" crate.

This PR also fixes black_box on the wasm32 target, which now supports inline assembly, and uses volatile loads on the asm.js target.

r? @Amanieu (cc @rust-lang/libs)
2019-03-28 05:44:01 +00:00
Chris Gregory
e1e0e53f16 Fix link capitalization in documentation of std::io::BufWriter. 2019-03-27 23:01:24 -04:00
Esteban Küber
a51ca0268d Expand test 2019-03-27 19:44:08 -07:00
Esteban Küber
4e7ec07bb9 Account for short-hand field syntax when suggesting borrow 2019-03-27 19:44:08 -07:00
Esteban Küber
326ec800b9 Account for fully overlapping multiline annotations
When two multiline span labels point at the same span, we special
case the output to avoid weird behavior:

```
        foo(
   _____^
  |_____|
 ||         bar,
 ||     );
 ||      ^
 ||______|
  |______foo
         baz
```

instead showing

```
       foo(
  _____^
 |         bar,
 |     );
 |      ^
 |      |
 |______foo
        baz
```
2019-03-27 19:35:30 -07:00