Commit Graph

88134 Commits

Author SHA1 Message Date
bors
419044956a Auto merge of #57181 - petrochenkov:impice3, r=estebank
resolve: Fix another ICE in import validation

Imports are allowed to have ambiguous resolutions as long as all of them have same `Def`.
As it turned out, it's possible for different `Module`s to have same `Def` when `extern crate` items are involved.

Fixes https://github.com/rust-lang/rust/issues/56596
2018-12-29 12:55:48 +00:00
Matthew Jasper
49e52e71de Remove unused types from rustc::mir::interpret
The types are no longer used with the change to stacked borrows for
validation.
2018-12-29 11:55:00 +00:00
kennytm
68f370ce05
Rollup merge of #57177 - varkor:fix-duration_as_u128-warning, r=estebank
Fix warning when compiling rustc
2018-12-29 18:50:32 +08:00
kennytm
aed3eaafee
Rollup merge of #57174 - linclark:patch-1, r=varkor
Update link to rustc guide
2018-12-29 18:50:30 +08:00
kennytm
9a67b18888
Rollup merge of #57168 - kennytm:fix-unaligned-docs, r=rkruppe
Removed aligned ZST requirement from docs of read_/write_unaligned.

This is just a copy-paste error.
2018-12-29 18:50:29 +08:00
kennytm
af56d2bf1a
Rollup merge of #57163 - JohnHeitmann:chevron-fix, r=estebank
Give the crate select chevron room to breathe.

Before:
![screen shot 2018-12-27 at 10 26 10 pm](https://user-images.githubusercontent.com/4282480/50505100-9ff24300-0a26-11e9-9b74-37bdee6faf83.png)

After:
![screen shot 2018-12-27 at 10 25 57 pm](https://user-images.githubusercontent.com/4282480/50505110-a54f8d80-0a26-11e9-9fa2-7fed21773207.png)
2018-12-29 18:50:28 +08:00
kennytm
291d51c92d
Rollup merge of #57159 - ids1024:closed-issue, r=Centril
Update references to closed issue

Issue #28979 was closed with a link to #55467.
2018-12-29 18:50:27 +08:00
kennytm
97e591ae0c
Rollup merge of #57153 - estebank:doc, r=cramertj
Small: Fix span in char documentation
2018-12-29 18:50:26 +08:00
kennytm
72b27a7254
Rollup merge of #57149 - rust-lang:sgrif-patch-1, r=rkruppe
Fix typo in pin documentation

Affect is a verb, effect is a noun
2018-12-29 18:50:24 +08:00
bors
d5175f4405 Auto merge of #57160 - petrochenkov:impice2, r=estebank
resolve: Fix an ICE in import validation

Fixes ICE reported in the comment https://github.com/rust-lang/rust/issues/56596#issuecomment-449866807
2018-12-29 10:17:10 +00:00
Matthias Krüger
8d727b267d update tests line numbers 2018-12-29 08:52:25 +01:00
bors
35a64f8bbf Auto merge of #57140 - estebank:str-err, r=varkor
Tweaks to format string diagnostics

Add label spans and fix incorrect spans.

Fix #55155, fix #55350.
2018-12-29 07:28:15 +00:00
Alexander Regueiro
a4fa7ef2b9 Fixed stderr files for ui tests. 2018-12-29 05:45:45 +00:00
csmoe
48de0ff333 add non-copy note to stderr 2018-12-29 10:36:23 +08:00
Eric Huss
5739364784 Update cargo, rls, miri 2018-12-28 17:23:01 -08:00
bors
43d26b1f35 Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavus
Add no-crate filter option on rustdoc

@onur asked me about it so here it is!

r? @QuietMisdreavus
2018-12-29 01:22:04 +00:00
Vadim Petrochenkov
ddb550a0e3 resolve: Never override real bindings with Def::Errs from error recovery 2018-12-29 03:04:25 +03:00
Matthew Jasper
2149d73358 Remove unnecessary borrow generation 2018-12-28 23:39:14 +00:00
bors
d9e3edb74b Auto merge of #57138 - matthiaskrgr:clippy, r=oli-obk
submodules: update clippy from fc24fce7 to 721f688e

Fixes clippy toolstate.

Changes:
````
rustup https://github.com/rust-lang/rust/pull/57069
Rustfmt.
fix breakage from rust-lang/rust#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

r? @oli-obk
2018-12-28 22:41:04 +00:00
Vadim Petrochenkov
2af1d6f4dd resolve: Fix another ICE in import validation 2018-12-29 00:15:19 +03:00
Matthias Krüger
68860989eb remove remaining copyright headers 2018-12-28 21:50:33 +01:00
bors
60e825389d Auto merge of #57118 - Zoxc:query-stats, r=wesleywiser
Add a command line flag to print some query stats

r? @michaelwoerister
2018-12-28 20:02:23 +00:00
varkor
04c1a92fa0 Fix warning when compiling rustc 2018-12-28 19:28:57 +00:00
varkor
d178fce5fc Add specific diagnostic for transmuting between equal associated types 2018-12-28 19:23:22 +00:00
varkor
6cb1d953fd Clarify wording of E0512 2018-12-28 19:23:22 +00:00
Esteban Küber
8da6727e96 Suggest .as_ref() when appropriate for Option and Result 2018-12-28 11:16:23 -08:00
Lin Clark
d30465fbfc
Update link to rustc guide 2018-12-28 13:34:00 -05:00
Matthias Krüger
1654ef8fa3 submodules: update clippy from fc24fce7 to f7bdf500
Fixes clippy toolstate

Changes:
````
Match on ast/hir::ExprKind::Err
Update *.stderr files
Use -Zui-testing flag
Mention S-inactive-closed PRs in the CONTRIBUTING.md
tests: fix formatting and update test output
base tests: make sure to fail CI if tests need formatting
base tests: switch to nightly toolchain before checking formatting of tests with rustfmt
rustup https://github.com/rust-lang/rust/pull/57069
Rustfmt.
fix breakage from rust-lang/rust#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````
2018-12-28 19:18:15 +01:00
bors
3cda631ea4 Auto merge of #57167 - Dylan-DPC:feature/non-zero-getters, r=SimonSapin
Make the getter for NonZero types into a const fn

Closes https://github.com/rust-lang/rust/issues/53331

Rework of #56739

cc @Lokathor

r? @oli-obk
2018-12-28 15:10:17 +00:00
kennytm
9223512fbe
Removed aligned ZST requirement from docs of read_/write_unaligned.
This is just a copy-paste error.
2018-12-28 22:00:33 +08:00
Oliver Scherer
39f95fa7c7
Update src/test/ui/consts/const-nonzero.rs
Co-Authored-By: Dylan-DPC <dylan.dpc@gmail.com>
2018-12-28 17:45:49 +05:30
dylan_DPC
d11a58b676 Make the getter for NonZero types into a const fn 2018-12-28 16:58:55 +05:30
bors
48742c68d9 Auto merge of #57137 - cramertj:unpin-prelude, r=SimonSapin
Add Unpin to std prelude, not just core

r? @alexcrichton
2018-12-28 10:54:16 +00:00
bors
ee49bf8964 Auto merge of #55519 - fhartwig:hashmap-index-example, r=Centril
Add example of using the indexing operator to HashMap docs

Fixes #52575
2018-12-28 06:52:15 +00:00
John Heitmann
94dd67bc6e Give the crate select chevron room to breathe. 2018-12-27 22:26:54 -08:00
bors
e8ca35e63d Auto merge of #57155 - petrochenkov:dcrate3, r=dtolnay
Resolve `$crate`s for pretty-printing at more appropriate time

Doing it in `BuildReducedGraphVisitor` wasn't a good idea, identifiers wasn't actually visited half of the time.
As a result some `$crate`s weren't resolved and were therefore pretty-printed as `$crate` literally, which turns into two tokens during re-parsing of the pretty-printed text.

Now we are visiting and resolving `$crate` identifiers in an item right before sending that item to a proc macro attribute or derive.

Fixes https://github.com/rust-lang/rust/issues/57089
2018-12-28 02:54:14 +00:00
Vadim Petrochenkov
ce73bc7d47 resolve: Fix an ICE in import validation 2018-12-28 05:43:31 +03:00
Ian Douglas Scott
0c58eec86c
Update references to closed issue
Issue #28979 was closed with a link to #55467.
2018-12-27 16:49:12 -08:00
bors
f8caa321c7 Auto merge of #56999 - petrochenkov:macrecov2, r=estebank
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end

This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.
2018-12-27 22:27:27 +00:00
Vadim Petrochenkov
e40d7d9643 Resolve $crates for pretty-printing at more appropriate time 2018-12-28 00:44:47 +03:00
Vadim Petrochenkov
24af9f88a5 Add test demonstrating disintegration of $crate into $ and crate 2018-12-28 00:34:24 +03:00
bors
fb86d604bf Auto merge of #56384 - scalexm:chalk, r=nikomatsakis
Implement the new-style trait solver

Final PR of what I believe to be a minimally working implementation of the new-style trait solver.

The new trait solver can be used by providing the `-Z chalk` command line flag. It is currently used everywhere in `rustc_typeck`, and for everything relying on `rustc::infer::canonical::query_response::enter_canonical_trait_query`.

The trait solver is invoked in rustc by using the `evaluate_goal` canonical query. This is not optimal because each call to `evaluate_goal` creates a new `chalk_engine::Forest`, hence rustc cannot use answers to intermediate goals produced by the root goal. We'll need to change that but I guess that's ok for now.

Some next steps, I think, are:
* handle region constraints: region constraints are computed but are completely ignored for now, I think we may need additional support from `chalk_engine` (as a side effect, types or trait references with outlive requirements cannot be proved well-formed)
* deactivate eager normalization in the presence of `-Z chalk` in order to leverage the lazy normalization strategy of the new-style trait solver
* add the remaining built-in impls (only `Sized` is supported currently)
* transition the compiler to using generic goals instead of predicates that still refer to named type parameters etc

I added a few very simple tests to check that the new solver has the right behavior, they won't be needed anymore once it is mature enough. Additionally it shows off that we get [implied bounds](https://github.com/rust-lang/rust/issues/44491) for free.

r? @nikomatsakis
2018-12-27 19:47:56 +00:00
Esteban Küber
93d8343b83 Fix span in char documentation 2018-12-27 11:36:05 -08:00
scalexm
993d213fda Set a def_id in ParamEnv only with -Z chalk 2018-12-27 19:21:17 +01:00
scalexm
81d6f9cc81 Add tests 2018-12-27 19:21:16 +01:00
scalexm
3790f08a42 Fix tcx.environment for inherent impls 2018-12-27 19:21:16 +01:00
scalexm
8e2bdaacac Add wf_clause_for_fn_def 2018-12-27 19:21:16 +01:00
scalexm
26e0ea8148 Use TraitEngine in enter_canonical_trait_query 2018-12-27 19:21:16 +01:00
scalexm
da9467d147 Handle sub-typing in chalk-engine 2018-12-27 19:21:16 +01:00
scalexm
ba6314a0d6 Integrate chalk engine 2018-12-27 19:21:16 +01:00