Commit graph

101210 commits

Author SHA1 Message Date
Guillaume Gomez
1f25fd74a0 Add more information on search 2019-10-26 12:59:54 +02:00
bors
23f890f102 Auto merge of #65804 - Centril:rollup-arlxgch, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #64639 (Stabilize `#[non_exhaustive]` (RFC 2008))
 - #65074 (Fix the start/end byte positions in the compiler JSON output)
 - #65315 (Intern place projection)
 - #65685 (Fix check of `statx` and handle EPERM)
 - #65731 (Prevent unnecessary allocation in PathBuf::set_extension.)
 - #65740 (Fix default "disable-shortcuts" feature value)
 - #65787 (move panictry! to where it is used.)
 - #65789 (move Attribute::with_desugared_doc to librustdoc)
 - #65790 (move report_invalid_macro_expansion_item to item.rs)

Failed merges:

r? @ghost
2019-10-25 11:13:30 +00:00
Mazdak Farrokhzad
c0bbb4bcdc
Rollup merge of #65790 - Centril:move-report-invalid, r=davidtwco
move report_invalid_macro_expansion_item to item.rs

From https://github.com/rust-lang/rust/pull/65324.

r? @Mark-Simulacrum
2019-10-25 13:12:55 +02:00
Mazdak Farrokhzad
cbcbba24ac
Rollup merge of #65789 - Centril:with-desugared-doc, r=davidtwco
move Attribute::with_desugared_doc to librustdoc

From https://github.com/rust-lang/rust/pull/65324.

r? @varkor
2019-10-25 13:12:54 +02:00
Mazdak Farrokhzad
0bfe483c5c
Rollup merge of #65787 - Centril:panictry, r=davidtwco
move panictry! to where it is used.

From https://github.com/rust-lang/rust/pull/65324

r? @davidtwco
2019-10-25 13:12:53 +02:00
Mazdak Farrokhzad
07b5c2a46e
Rollup merge of #65740 - GuillaumeGomez:fix-disable-shortcut-feature, r=Dylan-DPC
Fix default "disable-shortcuts" feature value

Follow-up of https://github.com/rust-lang/rust/pull/65656

It fixes the bad handling of the default value of the feature (which would disable shortcut by default, which is bad!).

r? @Dylan-DPC
cc @kinnison
2019-10-25 13:12:51 +02:00
Mazdak Farrokhzad
3e3f21cd0a
Rollup merge of #65731 - fusion-engineering-forks:set-extension, r=dtolnay
Prevent unnecessary allocation in PathBuf::set_extension.

It was allocating a new `OsString` that was immediately dropped after using it with `set_file_name`. Now it directly changes the extension in the original buffer, without touching the rest of the file name or allocating a temporary string.
2019-10-25 13:12:50 +02:00
Mazdak Farrokhzad
f1d747a99d
Rollup merge of #65685 - oxalica:statx-eperm, r=alexcrichton
Fix check of `statx` and handle EPERM

Should fix #65662

https://github.com/rust-lang/rust/issues/65662#issuecomment-544593939
> I think a reasonable solution might be to do something like try to stat AT_CWD initially and if that fails with EPERM or ENOSYS we disable the syscall entirely, otherwise it's cached as always good to use.

r? @alexcrichton
2019-10-25 13:12:48 +02:00
Mazdak Farrokhzad
8bb039fb83
Rollup merge of #65315 - spastorino:intern-place-projection, r=oli-obk
Intern place projection

This should sit on top of https://github.com/rust-lang/rust/pull/65197. After that one merged, I'm gonna rebase on top of it.

The important commits are the last three and there's a bunch of code repetition that I'm going to remove but for that I need to refactor some things that probably need to be added before this PR.

Anyway this work helps as is because we can run perf tests :).

r? @oli-obk /cc @nikomatsakis
2019-10-25 13:12:46 +02:00
Mazdak Farrokhzad
1f93be1bb3
Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad
Fix the start/end byte positions in the compiler JSON output

Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output.

This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one.

The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions.

Fixes #65029
2019-10-25 13:12:45 +02:00
Mazdak Farrokhzad
959b6e324c
Rollup merge of #64639 - davidtwco:rfc-2008-stabilization, r=Centril
Stabilize `#[non_exhaustive]` (RFC 2008)

Fixes #44109.

This pull request stabilizes the `#[non_exhaustive]` attribute, which is used to indicate that a type will have more fields / variants added in the future. It can be applied to `struct`s, `enum`s and `enum` variants. See https://github.com/rust-lang/rust/issues/44109#issuecomment-533356866 for the stabilization report.

r? @Centril
2019-10-25 13:12:43 +02:00
Mazdak Farrokhzad
9e3e3a470e
with_desugared_doc: correctly refer to attr instead of self
Co-Authored-By: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
2019-10-25 10:43:08 +02:00
David Wood
e0590ea76f
RFC 2008: Stabilization
This commit stabilizes RFC 2008 (#44109) by removing the feature gate.

Signed-off-by: David Wood <david@davidtw.co>
2019-10-25 09:34:05 +01:00
bors
85943fd7c8 Auto merge of #65764 - Manishearth:clippyup, r=Manishearth
Update clippy

Fixes #65754

r? @ghost
2019-10-25 07:47:13 +00:00
bors
dd2df8f97d Auto merge of #65793 - Centril:rollup-v40xke9, r=Centril
Rollup of 9 pull requests

Successful merges:

 - #62959 (Add by-value iterator for arrays )
 - #65390 (Add long error explanation for E0576)
 - #65408 (reorder config.toml.example options and add one missing option)
 - #65414 (ignore uninhabited non-exhaustive variant fields)
 - #65666 (Deprecated proc_macro doesn't trigger warning on build library)
 - #65742 (Pre-expansion gate most of the things)
 - #65747 (Adjust the tracking issue for `untagged_unions`.)
 - #65763 (Changed APIT with explicit generic args span to specific arg spans)
 - #65775 (Fix more `ReEmpty` ICEs)

Failed merges:

 - #65519 (trait-based structural match implementation)

r? @ghost
2019-10-25 04:24:40 +00:00
Mazdak Farrokhzad
100c924527
Rollup merge of #65775 - matthewjasper:reempty, r=pnkfelix
Fix more `ReEmpty` ICEs

closes #65553

r? @pnkfelix
2019-10-25 06:18:14 +02:00
Mazdak Farrokhzad
2b7cc64e43
Rollup merge of #65763 - ObsidianMinor:diag/65642, r=varkor
Changed APIT with explicit generic args span to specific arg spans

Fixes #65642.
2019-10-25 06:18:12 +02:00
Mazdak Farrokhzad
8b9661bbb0
Rollup merge of #65747 - Centril:union-issue-fix, r=varkor
Adjust the tracking issue for `untagged_unions`.

Makes https://github.com/rust-lang/rust/issues/55149 the new tracking issue for `untagged_unions`.
Closes https://github.com/rust-lang/rust/issues/32836 which is the old tracking issue.

r? @varkor
2019-10-25 06:18:11 +02:00
Mazdak Farrokhzad
d6a18b6baf
Rollup merge of #65742 - Centril:gate-pre-expansion-subset, r=davidtwco
Pre-expansion gate most of the things

This is a subset of https://github.com/rust-lang/rust/pull/64672. A crater run has already been done and this PR implements conclusions according to https://github.com/rust-lang/rust/pull/64672#issuecomment-542703363.

r? @davidtwco
cc @petrochenkov
2019-10-25 06:18:09 +02:00
Mazdak Farrokhzad
fb602c7e4f
Rollup merge of #65666 - XiangQingW:proc_macro, r=petrochenkov
Deprecated proc_macro doesn't trigger warning on build library

Fix #65189
2019-10-25 06:18:08 +02:00
Mazdak Farrokhzad
50e8c41a81
Rollup merge of #65414 - davidtwco:issue-65157-non-exhaustive-always-useful, r=varkor
ignore uninhabited non-exhaustive variant fields

Fixes #65157.

This PR modifies the uninhabitedness checking so that the fields of
a non-exhaustive variant (which is not local) are ignored if they are
uninhabited. This is an improvement over the previous behaviour which
considered all non-local non-exhaustive variants useful because
unreachable patterns are now detected.

r? @arielb1
cc @varkor
2019-10-25 06:18:06 +02:00
Mazdak Farrokhzad
ee7f9de4c4
Rollup merge of #65408 - guanqun:remove-rust-optimize, r=Mark-Simulacrum
reorder config.toml.example options and add one missing option

r? @Mark-Simulacrum
2019-10-25 06:18:04 +02:00
Mazdak Farrokhzad
e25720f106
Rollup merge of #65390 - GuillaumeGomez:long-err-explanation-E0576, r=matthewjasper,kinnison
Add long error explanation for E0576

Part of #61137.
2019-10-25 06:18:02 +02:00
Mazdak Farrokhzad
a302155344
Rollup merge of #62959 - LukasKalbertodt:array-value-iter, r=scottmcm
Add by-value iterator for arrays

This adds an iterator that can iterate over arrays by value, yielding all elements by value. However, **this PR does _not_ add a corresponding `IntoIterator` impl for arrays**. The `IntoIterator` impl needs some discussion about backwards-compatibility that should take place in a separate PR. With this patch, this code should work (but there is currently still a bug):

```rust
#![feature(array_value_iter)]
use std::array::IntoIter;

let arr = [1, 2, 3];
for x in IntoIter::new(arr) {
    println!("{}", x);
}
```

**TODO**:
- [x] Get initial feedback
- [x] Add tests
- [x] Figure out why stage1 produces weird bugs ([comment](https://github.com/rust-lang/rust/pull/62959#issuecomment-516016524))
- [x] Add UI tests as mentioned [here](https://github.com/rust-lang/rust/pull/62959#discussion_r307061894) (will do that soon-ish)
- [x] Fix [this new bug](https://github.com/rust-lang/rust/pull/62959#issuecomment-544732159)

**Notes for reviewers**
- Is the use of `MaybeUninit` correct here? I think it has to be used due to the `Clone` impl which has to fill the dead array elements with something, but cannot fill it with a correct instance.
- Are the unit tests sufficient?

CC #25725
2019-10-25 06:18:01 +02:00
Mazdak Farrokhzad
5ff7349ef7 move report_invalid_macro_expansion_item to item.rs 2019-10-25 05:26:36 +02:00
Mazdak Farrokhzad
0a5b38f9c3 move Attribute::with_desugared_doc to librustdoc 2019-10-25 04:38:42 +02:00
Mazdak Farrokhzad
d7f6ba83fc move panictry! to where it is used. 2019-10-25 04:29:37 +02:00
bors
d54111afc0 Auto merge of #65771 - Centril:rollup-upfsvrb, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #65625 (Turn crate store into a resolver output)
 - #65627 (Forbid non-`structural_match` types in const generics)
 - #65710 (Update cargo)
 - #65729 (Update test cases for vxWorks)
 - #65746 (Tweak format string error to point at arguments always)
 - #65753 (Don't assert for different instance on impl trait alias)
 - #65755 (Avoid ICE when adjusting bad self ty)
 - #65766 (Update hashbrown to 0.6.2)

Failed merges:

r? @ghost
2019-10-25 00:40:55 +00:00
Matthew Jasper
d724174346 Fix more ReEmpty ICEs 2019-10-24 21:15:08 +01:00
Mazdak Farrokhzad
fd6795b46a
Rollup merge of #65766 - alexcrichton:less-inline-hashbrown, r=Mark-Simulacrum
Update hashbrown to 0.6.2

Pulls in rust-lang/hashbrown#119 which should be a good improvement for
compile times of hashmap-heavy crates.
2019-10-24 20:20:10 +02:00
Mazdak Farrokhzad
7b3896fdf2
Rollup merge of #65755 - estebank:icicle, r=davidtwco
Avoid ICE when adjusting bad self ty

Fix #65611.
2019-10-24 20:20:08 +02:00
Mazdak Farrokhzad
1b0367146a
Rollup merge of #65753 - csmoe:derive_fold, r=Centril
Don't assert for different instance on impl trait alias

Closes https://github.com/rust-lang/rust/issues/65679
r? @Centril @nikomatsakis
2019-10-24 20:20:07 +02:00
Mazdak Farrokhzad
1e4a2ee6d5
Rollup merge of #65746 - estebank:newcomer-format, r=Centril
Tweak format string error to point at arguments always

Add secondary span labels with no text to make it clear when there's a
mismatch bewteen the positional arguments in a format string and the
arguments to the macro. This shouldn't affect experienced users, but it
should make it easier for newcomers to more clearly understand how
`format!()` and `println!()` are supposed to be used.

```
error: 2 positional arguments in format string, but there is 1 argument
 --> file8.rs:2:14
  |
2 |     format!("{} {}", 1);
  |              ^^ ^^   -
```

instead of

```
error: 2 positional arguments in format string, but there is 1 argument
 --> file8.rs:2:14
  |
2 |     format!("{} {}", 1);
  |              ^^ ^^
```

r? @Centril
2019-10-24 20:20:05 +02:00
Mazdak Farrokhzad
efa50378d5
Rollup merge of #65729 - Wind-River:master_003, r=alexcrichton
Update test cases for vxWorks
2019-10-24 20:20:04 +02:00
Mazdak Farrokhzad
0da94a45e9
Rollup merge of #65710 - ehuss:update-cargo, r=alexcrichton
Update cargo

6 commits in 3a9abe3f065554a7fbc59f440df2baba4a6e47ee..3ba5f27170db10af7a92f2b682e049397197b8fa
2019-10-15 15:55:35 +0000 to 2019-10-22 15:05:18 +0000
- Fix typo in `cargo install --profile` help (rust-lang/cargo#7532)
- Use stricter -Z flag parsing. (rust-lang/cargo#7531)
- Set timestamp on generated files in archive to now (rust-lang/cargo#7523)
- Support rustc's `-Z panic-abort-tests` in Cargo (rust-lang/cargo#7460)
- rustfmt for nightly changes. (rust-lang/cargo#7526)
- Allow --all-features in root of virtual workspace. (rust-lang/cargo#7525)
2019-10-24 20:20:02 +02:00
Mazdak Farrokhzad
9c04bd1b4d
Rollup merge of #65627 - varkor:const-generics-forbid-non-structural_match, r=petrochenkov
Forbid non-`structural_match` types in const generics

Fixes https://github.com/rust-lang/rust/issues/60286.
2019-10-24 20:20:01 +02:00
Mazdak Farrokhzad
cdb7634f0c
Rollup merge of #65625 - petrochenkov:cstore, r=Mark-Simulacrum,Zoxc
Turn crate store into a resolver output

Crate store (`CStore`) is a vector of data (`CrateMetadata`) associated with extern crates loaded during the current compilation session.

All crates are loaded in the resolver when resolving either paths pointing to extern prelude or `extern crate` items. (There are also a couple of crates like panic runtime that are loaded kind of like implicit `extern crate`s, but that also happens in resolve.)

The use of `CStore` from `rustc_plugin` (which is outside of the resolver) was unnecessary because legacy plugins are not added to the crate store and don't use `CrateNum`s.

So, `CStore` can be produced by the resolver instead of being kept in some really global data (`rustc_interface::Compiler`) like now.

As a result of crate store being more "local" we can now remove some locks and `Lrc`s.
2019-10-24 20:19:59 +02:00
Vadim Petrochenkov
94216ce3ad rustc_interface: Remove ExpansionResult and some Steals 2019-10-24 21:12:05 +03:00
Vadim Petrochenkov
9f5a530b84 rustc_metadata: Minimize use of Lrc in crate store
Crate metadatas are still stored as `Lrc<CrateMetadata>` in `CStore` because crate store has to be cloneable due to `Resolver::clone_outputs`.
2019-10-24 20:54:16 +03:00
Vadim Petrochenkov
c5fee33e7a rustc_metadata: Remove RwLock from CStore 2019-10-24 20:54:16 +03:00
Vadim Petrochenkov
3534ca8f49 Turn crate store into a resolver output 2019-10-24 20:54:16 +03:00
Vadim Petrochenkov
5fd796ad06 rustc: Combine resolver outputs into a single struct 2019-10-24 20:51:33 +03:00
Vadim Petrochenkov
fb353f050a resolve: Privatize all resolver fields 2019-10-24 20:51:33 +03:00
Vadim Petrochenkov
222503a354 rustc: Add a convenience alias for dyn MetadataLoader + Sync 2019-10-24 20:51:33 +03:00
Vadim Petrochenkov
175d325ccb rustc_metadata: Move some code around
Plugin search doesn't need a crate loader, only crate locator
2019-10-24 20:51:33 +03:00
Vadim Petrochenkov
2cda75c48f rustc_metadata: Remove unnecessary use of crate store in plugin loader 2019-10-24 20:51:33 +03:00
Vadim Petrochenkov
2c16f84490 rustc_driver: Remove unnecessary use of crate store 2019-10-24 20:50:11 +03:00
csmoe
184a61f0bf Don't assert for different instance on impl trait alias 2019-10-25 01:15:37 +08:00
bors
10a52c25ca Auto merge of #65762 - mati865:msys2-bug, r=pietroalbini
workaround msys2 bug
2019-10-24 16:08:03 +00:00
Mateusz Mikuła
2fea52511e workaround msys2 bug
Co-Authored-By: Pietro Albini <pietro@pietroalbini.org>
2019-10-24 18:03:01 +02:00