Commit Graph

107628 Commits

Author SHA1 Message Date
Yuki Okushi
ef311d5ab4
Rollup merge of #69628 - nnethercote:fix-DiagnosticBuilder-into_diagnostic-leak, r=Centril
Fix a leak in `DiagnosticBuilder::into_diagnostic`.

Fixes #69600.

r? @Centril
2020-03-03 17:50:13 +09:00
Yuki Okushi
c9d421f5c0
Rollup merge of #69626 - ehuss:toolstate-nightly-cleanup, r=Mark-Simulacrum
Toolstate: don't duplicate nightly tool list.

Just some cleanup, seems good to avoid duplicating this list.
2020-03-03 17:50:11 +09:00
Yuki Okushi
9f3a192327
Rollup merge of #69620 - thekuom:doc/61137-add-long-error-code-e0719, r=davidtwco
doc(librustc_error_codes): add long error explanation for E0719

Reference issue #61137

- Updated error_codes.rs
- Added E0719.md in error_codes
- Updated necessary test .stderr files
2020-03-03 17:50:10 +09:00
Yuki Okushi
f19684c7cf
Rollup merge of #69619 - matthiaskrgr:misc, r=eddyb
more cleanups

* use starts_with() instead of chars().next() == Some(x)
* use subsec_micros() instead of subsec_nanos() / 1000
* use for (idx, item) in iter.enumerate() instead of manually counting loop iterations with variables
* use values() or keys() respectively when iterating only over keys or values of maps.
2020-03-03 17:50:08 +09:00
Yuki Okushi
4699b29a04
Rollup merge of #69609 - TimDiekmann:excess, r=Amanieu
Remove `usable_size` APIs

This removes the usable size APIs:
- remove `usable_size` (obv)
- change return type of allocating methods to include the allocated size
- remove `_excess` API

r? @Amanieu
closes rust-lang/wg-allocators#17
2020-03-03 17:50:06 +09:00
Yuki Okushi
dfacdda649
Rollup merge of #69213 - LeSeulArtichaut:improve-doc-iter, r=steveklabnik
Improve documentation on iterators length

Attempts to resolve #66491. @the8472 does this help?

r? @steveklabnik
2020-03-03 17:50:04 +09:00
bors
9381e8178b Auto merge of #69247 - CAD97:remove-chalk, r=nikomatsakis
Remove experimental chalk option

As suggested by @nikomatsakis [here](https://github.com/rust-lang/rust/pull/68807#issuecomment-583339932).

The current version of chalk used by the experimental `-Zchalk` flag is [v0.9.0, which is over a year old](https://crates.io/crates/chalk-engine). Since v0.9.0, chalk has seen [a lot of further development](https://github.com/rust-lang/chalk/compare/41dfe13...master), and the intent is to eventually upgrade rustc to use a more recent chalk.

However, it will take a decent chunk of effort to upgrade the current experimental chalk support, and it is currently [blocking at least some PRs](https://github.com/rust-lang/rust/pull/68807) due to chalk:0.9.0's use of unstable features. So for the interim until the next chalk release and experimental rustc integration, we remove the chalk-specific code from rustc.
2020-03-03 04:31:01 +00:00
CAD97
b3777c952f Remove chalk integration 2020-03-02 18:11:53 -05:00
Tim Diekmann
d8e3557dba Remove usable_size APIs 2020-03-03 00:08:24 +01:00
bors
97b3d81615 Auto merge of #69627 - ehuss:update-cargo-clippy, r=Dylan-DPC
Update cargo, clippy

Closes #69601

## cargo

16 commits in e57bd02999c9f40d52116e0beca7d1dccb0643de..bda50510d1daf6e9c53ad6ccf603da6e0fa8103f
2020-02-21 20:20:10 +0000 to 2020-03-02 18:05:34 +0000
- Fix rare failure in collision_export test. (rust-lang/cargo#7956)
- Ignore broken Cargo.toml in git sources (rust-lang/cargo#7947)
- Add more fingerprint mtime debug logging. (rust-lang/cargo#7952)
- Fix plugin tests for latest nightly. (rust-lang/cargo#7955)
- Simplified usage code of SipHasher (rust-lang/cargo#7945)
- Add a special case for git config discovery inside tests (rust-lang/cargo#7944)
- Fixes issue rust-lang/cargo#7543 (rust-lang/cargo#7946)
- Filter out cfgs which should not be used during build (rust-lang/cargo#7943)
- Provide extra context on a query failure. (rust-lang/cargo#7934)
- Try to clarify `cargo metadata`'s relationship with the workspace. (rust-lang/cargo#7927)
- Update libgit2 dependency (rust-lang/cargo#7939)
- Fix link in comment (rust-lang/cargo#7936)
- Enable `cargo doc --open` tests on macos. (rust-lang/cargo#7932)
- build-std: remove sysroot probe (rust-lang/cargo#7931)
- Try to clarify how feature flags work on the "current" package. (rust-lang/cargo#7928)
- Add extra details in the new feature resolver doc comment. (rust-lang/cargo#7918)

## clippy

6 commits in fc5d0cc583cb1cd35d58fdb7f3e0cfa12dccd6c0..8b7f7e667268921c278af94ae30a61e87a22b22b
2020-02-24 05:58:17 +0000 to 2020-03-02 20:00:31 +0000
- Rustup to rust-lang/rust#69469 (rust-lang-nursery/rust-clippy#5254)
- Some rustups (rust-lang-nursery/rust-clippy#5247)
- Update git2 to 0.12 (rust-lang-nursery/rust-clippy#5232)
- Rustup to rust-lang/rust#61812 (rust-lang-nursery/rust-clippy#5231)
- Add lint to improve floating-point expressions (rust-lang-nursery/rust-clippy#4897)
- Do not run deploy action on other repos (rust-lang-nursery/rust-clippy#5222)
2020-03-02 22:58:48 +00:00
LeSeulArtichaut
0c82a5c1d3 Apply suggestions from code review 2020-03-02 21:42:55 +01:00
Eric Huss
15264e95f2 Update cargo, clippy 2020-03-02 12:25:29 -08:00
Eric Huss
fdc14cb0b0 Toolstate: don't duplicate nightly tool list. 2020-03-02 08:42:35 -08:00
bors
18c275b423 Auto merge of #69635 - Dylan-DPC:rollup-2oh8uu5, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #68682 (Add documentation to compiler intrinsics)
 - #69544 (Unrevert "Remove `checked_add` in `Layout::repeat`")
 - #69617 (constify mem::forget)
 - #69622 (Rename `syntax` in librustc_ast/README.md)
 - #69623 (stash API: remove panic to fix ICE.)
 - #69624 (Toolstate: Don't block beta week on already broken tools.)

Failed merges:

 - #69626 (Toolstate: don't duplicate nightly tool list.)

r? @ghost
2020-03-02 12:48:26 +00:00
Dylan DPC
f8fb3efe6f
Rollup merge of #69624 - ehuss:toolstate-beta-regress, r=Mark-Simulacrum
Toolstate: Don't block beta week on already broken tools.

This changes it so that tools are allowed to be broken entering the beta week if they are already broken.  This restores the original behavior before the changes in #69332.

Closes #68458
2020-03-02 13:42:43 +01:00
Dylan DPC
0255561dea
Rollup merge of #69623 - Centril:fix-69396-tmp, r=petrochenkov
stash API: remove panic to fix ICE.

Implements the temporary solution suggested in https://github.com/rust-lang/rust/pull/69537#issuecomment-593143975.
Fixes https://github.com/rust-lang/rust/issues/69396.

r? @petrochenkov
2020-03-02 13:42:41 +01:00
Dylan DPC
74a8d8f44e
Rollup merge of #69622 - LeSeulArtichaut:patch-2, r=Centril
Rename `syntax` in librustc_ast/README.md

Related to e94d3b7.
r? @petrochenkov
2020-03-02 13:42:40 +01:00
Dylan DPC
e725c04e62
Rollup merge of #69617 - DutchGhost:master, r=LukasKalbertodt
constify mem::forget

implements https://github.com/rust-lang/rust/issues/69616
2020-03-02 13:42:38 +01:00
Dylan DPC
f548a387a4
Rollup merge of #69544 - lqd:unrevert-67174, r=Mark-Simulacrum
Unrevert "Remove `checked_add` in `Layout::repeat`"

This reapplies @kraai's original `libcore::alloc::Layout::repeat` change from #67174 which was temporarily reverted in #69241. Now that the proper LLVM fix has been cherry-picked, we can unrevert the revert.

This change was originally reviewed by @hanna-kruppe on the initial PR.

cc @RalfJung
2020-03-02 13:42:37 +01:00
Dylan DPC
ffb6d75314
Rollup merge of #68682 - LeSeulArtichaut:stable-intrinsics, r=steveklabnik
Add documentation to compiler intrinsics

This adds documentation to the compiler intrinsics having stable standard implementations.

Relates to #34338 (cc @bstrie)

r? @steveklabnik (for reassignment?)
2020-03-02 13:42:35 +01:00
Matthias Krüger
21affdd00d use values() or keys() respectively when iterating only over keys or values of maps. 2020-03-02 13:01:05 +01:00
DutchGhost
a30b0a61b8 actually mark the function const 2020-03-02 11:00:20 +01:00
bors
c839a7b4c2 Auto merge of #69257 - RalfJung:layout-visitor, r=eddyb
Adjust Miri value visitor, and doc-comment layout components

I realized that I still didn't have quite the right intuition for how our `LayoutDetails` work, so I had to adjust the Miri value visitor to the things I understood better now. I also added some doc-comments to `LayoutDetails` as a hopefully canonical place to note such things.

The main visitor change is that we *first* look at all the fields (according to `FieldPlacement`), and *then* check the variants and handle `Multiple` appropriately. I did not quite realize how orthogonal "fields" and "variants" are.
I also moved the check for the scalar ABI to *after* checking all the fields; this leads to better (more type-driven) error messages.

And it looks like we can finally remove that magic hack for `ty::Generator`. :D

r? @oli-obk for the Miri/visitor changes and @eddyb for the layout docs
The Miri PR is at: https://github.com/rust-lang/miri/pull/1178
2020-03-02 09:37:35 +00:00
bors
6af4fd385e Auto merge of #69469 - matthewjasper:type-flags, r=cramertj
Clean up TypeFlags

* Add a new method `has_infer_types_or_consts` that's used instead of `has_infer_types` most of the time, since there's generally no reason to only consider types.
*  Remove `has_closure_types`/`HAS_TY_CLOSURE`, because closures are no longer implicitly linked to the `InferCtxt`.
* Reorder flags to group similar ones together
* Make some flags more granular
* Compute `HAS_FREE_LOCAL_NAMES` from the other flags
* Add some more doc comments
2020-03-02 06:30:52 +00:00
Nicholas Nethercote
99a595e406 Fix a leak in DiagnosticBuilder::into_diagnostic.
Fixes #69600.
2020-03-02 14:42:46 +11:00
bors
e86c9e6ef8 Auto merge of #69442 - jakevossen5:master, r=Mark-Simulacrum
`--explain` disambiguates no long description and invalid error codes

Closes #44710

First code contribution here, so feedback is very much appreciated!

cc @zackmdavis
cc @Mark-Simulacrum
2020-03-02 03:16:22 +00:00
bors
9dc8dad14f Auto merge of #69432 - petrochenkov:alldeps, r=eddyb
rustc_metadata: Load metadata for indirect macro-only dependencies

Imagine this dependency chain between crates
```
Executable crate -> Library crate -> Macro crate
```
where "Library crate" uses the macros from "Macro crate" for some code generation, but doesn't reexport them any further.

Currently, when compiling "Executable crate" we don't even load metadata for it, because why would we want to load any metadata from "Macro crate" if it already did all its code generation job when compiling "Library crate".
Right?

Wrong!
Hygiene data and spans (https://github.com/rust-lang/rust/issues/68686, https://github.com/rust-lang/rust/pull/68941) from "Macro crate" still may need to be decoded from "Executable crate".
So we'll have to load them properly.

Questions:
- How this will affect compile times for larger crate trees in practice? How to measure it?
Hygiene/span encoding/decoding will necessarily slow down compilation because right now we just don't do some work that we should do, but this introduces a whole new way to slow down things. E.g. loading metadata for `syn` (and its dependencies) when compiling your executable if one of its library dependencies uses it.
- We are currently detecting whether a crate reexports macros from "Macro crate" or not, could we similarly detect whether a crate "reexports spans" and keep it unloaded if it doesn't?
Or at least "reexports important spans" affecting hygiene, we can probably lose spans that only affect diagnostics.
2020-03-02 00:07:06 +00:00
Eric Huss
22d840e501 Toolstate: Don't block beta week on already broken tools. 2020-03-01 15:46:38 -08:00
Mazdak Farrokhzad
df20036848 stash API: remove panic to fix ICE. 2020-03-02 00:07:23 +01:00
LeSeulArtichaut
6bfa48a0ae
Rename syntax in librustc_ast/README.md 2020-03-01 23:56:03 +01:00
Matthew Jasper
1617ec4ad2 Clean up TypeFlags
* Reorder flags to group similar ones together
* Make some flags more granular
* Compute `HAS_FREE_LOCAL_NAMES` from the other flags
* Remove `HAS_TY_CLOSURE`
* Add some more doc comments
2020-03-01 21:42:34 +00:00
Matthew Jasper
ebc86b441d Fix use of has_infer_types
* Add a new method `has_infer_types_or_consts` that's used instead most
  of the time, since there's generally no reason to only consider types.
*  Remove use of `has_closure_types`, because closures are no longer
  implicitly linked to the `InferCtxt`.
2020-03-01 21:42:34 +00:00
Matthew Kuo
275dac7bfb doc(librustc_error_codes): add long error explanation for E0719
Progresses #61137
2020-03-01 15:17:08 -06:00
bors
1cf090e8d1 Auto merge of #69408 - RalfJung:canonical-alloc-id, r=oli-obk
Miri: let machine canonicalize AllocIDs

This implements the rustc side of the plan I laid out [here](https://github.com/rust-lang/miri/pull/1147#issuecomment-581868901).

Miri PR: https://github.com/rust-lang/miri/pull/1190
2020-03-01 20:53:04 +00:00
Matthias Krüger
22339c3406 use for (idx, item) in iter.enumerate() instead of manually counting loop iterations by variables 2020-03-01 21:17:48 +01:00
Matthias Krüger
03aecda83a use subdsec_micros() instead of subsec_nanos() / 1000 2020-03-01 21:15:13 +01:00
Matthias Krüger
eda8d82b95 use starts_with() instead of chars().next() == Some(x) 2020-03-01 21:14:53 +01:00
DutchGhost
ae70ab071a constify mem::forget 2020-03-01 20:42:35 +01:00
bors
beac68a887 Auto merge of #69612 - Dylan-DPC:rollup-f180gcc, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #69504 (Use assert_ne in hash tests)
 - #69554 (Cleanup e0374)
 - #69568 (Clarify explanation of Vec<T> 'fn resize')
 - #69569 (simplify boolean expressions)
 - #69577 (Clean up E0375 explanation)
 - #69598 (rustdoc: HTML escape crate version)
 - #69607 (Clean up E0376 explanation)

Failed merges:

r? @ghost
2020-03-01 17:39:05 +00:00
Dylan DPC
d3a5a5d20b
Rollup merge of #69607 - GuillaumeGomez:cleanup-e0376, r=Dylan-DPC
Clean up E0376 explanation

r? @Dylan-DPC
2020-03-01 17:23:36 +01:00
Dylan DPC
22a03913f4
Rollup merge of #69598 - ollie27:rustdoc_crate-version_escape, r=GuillaumeGomez
rustdoc: HTML escape crate version

As `--crate-version` accepts arbitrary strings they need to be escaped.

r? @GuillaumeGomez
2020-03-01 17:23:34 +01:00
Dylan DPC
8ffbf9033b
Rollup merge of #69577 - GuillaumeGomez:cleanup-e0375, r=Dylan-DPC
Clean up E0375 explanation

r? @Dylan-DPC
2020-03-01 17:23:32 +01:00
Dylan DPC
87284d7e79
Rollup merge of #69569 - matthiaskrgr:nonminimal_bool, r=mark-Simulacrum
simplify boolean expressions
2020-03-01 17:23:30 +01:00
Dylan DPC
55d0a8b201
Rollup merge of #69568 - JOE1994:patch-2, r=Dylan-DPC
Clarify explanation of Vec<T> 'fn resize'

1. Clarified on what should implement `Clone` trait.
2. Minor grammar fix:
to be able clone => to be able **to** clone
2020-03-01 17:23:29 +01:00
Dylan DPC
6fc73bc10a
Rollup merge of #69554 - GuillaumeGomez:cleanup-e0374, r=Dylan-DPC
Cleanup e0374

r? @Dylan-DPC
2020-03-01 17:23:27 +01:00
Dylan DPC
e9e1ab1058
Rollup merge of #69504 - MichaelMcDonnell:hash_assert_ne, r=LukasKalbertodt
Use assert_ne in hash tests

The hash tests were written before the assert_ne macro was added to the standard library. The assert_ne macro provides better output in case of a failure.
2020-03-01 17:23:26 +01:00
Michael Mc Donnell
87327eb72a Remove assert that had been replaced by assert_ne 2020-03-01 08:04:18 -08:00
bors
360e42de82 Auto merge of #69380 - Zoxc:parent-module, r=michaelwoerister
Use a query to get parent modules

Split out from https://github.com/rust-lang/rust/pull/69015 / https://github.com/rust-lang/rust/pull/68944.

r? @michaelwoerister
2020-03-01 14:21:03 +00:00
Guillaume Gomez
dd142b1dc4 Clean up E0376 explanation 2020-03-01 12:03:38 +01:00
bors
6b2983af1a Auto merge of #69606 - JohnTitor:rollup-i3nrrcf, r=JohnTitor
Rollup of 7 pull requests

Successful merges:

 - #69397 (bootstrap: Remove commit hash from LLVM version suffix to avoid rebuilds)
 - #69549 (Improve MinGW detection when cross compiling )
 - #69562 (Don't `bug` when taking discriminant of generator during dataflow)
 - #69579 (parser: Remove `Parser::prev_span`)
 - #69580 (use .copied() instead of .map(|x| *x) on iterators)
 - #69583 (Do not ICE on invalid type node after parse recovery)
 - #69605 (Use `opt_def_id()` over `def_id()`)

Failed merges:

r? @ghost
2020-03-01 11:03:16 +00:00