]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoClarify test timeout evironment variables
Mikail Bagishov [Fri, 10 Jan 2020 16:26:40 +0000 (19:26 +0300)]
Clarify test timeout evironment variables

4 years agoAuto merge of #67397 - michaelwoerister:query-keys-in-self-profiling, r=wesleywiser
bors [Fri, 10 Jan 2020 12:18:46 +0000 (12:18 +0000)]
Auto merge of #67397 - michaelwoerister:query-keys-in-self-profiling, r=wesleywiser

self-profiling: Support recording query keys

This PR makes self-profiling able to record query keys. The implementation is not as efficient as it could be yet (all query keys except for `DefId`s cause string data to be duplicated) and the rendered strings could be nicer too. But the implementation is functional and introduces the basic framework for emitting per-query-invocation event data.

I tried to add proper documentation on how everything works. Let me know if more documentation is needed.

r? @wesleywiser

@Mark-Simulacrum, heads up: This updates `measureme` to 0.7.0 which means that `summarize` on perf.rlo needs to be update accordingly once this is merged.

4 years agoFix some rebasing fallout.
Michael Woerister [Fri, 10 Jan 2020 09:32:16 +0000 (10:32 +0100)]
Fix some rebasing fallout.

4 years agoUpdate measureme to 0.7.1 in order to fix compilation error on big-endian platforms.
Michael Woerister [Fri, 3 Jan 2020 11:01:53 +0000 (12:01 +0100)]
Update measureme to 0.7.1 in order to fix compilation error on big-endian platforms.

4 years agoRun 'x.py fmt'.
Michael Woerister [Fri, 3 Jan 2020 10:49:14 +0000 (11:49 +0100)]
Run 'x.py fmt'.

4 years agoself-profile: Fix issue with handling query blocking.
Michael Woerister [Wed, 18 Dec 2019 15:39:06 +0000 (16:39 +0100)]
self-profile: Fix issue with handling query blocking.

4 years agoInitial support for recording query keys in self-profiling data.
Michael Woerister [Tue, 17 Dec 2019 13:44:07 +0000 (14:44 +0100)]
Initial support for recording query keys in self-profiling data.

4 years agoUse 'relaxed' memory ordering for simple atomic counters in dep-graph.
Michael Woerister [Fri, 13 Dec 2019 13:46:10 +0000 (14:46 +0100)]
Use 'relaxed' memory ordering for simple atomic counters in dep-graph.

4 years agoself-profile: Switch to new approach for event_id generation that enables query-invoc...
Michael Woerister [Fri, 13 Dec 2019 13:44:08 +0000 (14:44 +0100)]
self-profile: Switch to new approach for event_id generation that enables query-invocation-specific event_ids.

4 years agoAuto merge of #68078 - Centril:rollup-qvq052k, r=Centril
bors [Fri, 10 Jan 2020 02:09:41 +0000 (02:09 +0000)]
Auto merge of #68078 - Centril:rollup-qvq052k, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #66463 (Point at opaque and closure type definitions in type errors)
 - #67501 (Reduce special treatment for zsts)
 - #67820 (Parse the syntax described in RFC 2632)
 - #67922 (rustc_ast_lowering: misc cleanup & rustc dep reductions)
 - #68071 (Extend support of `_` in type parameters)
 - #68073 (expect `fn` after `const unsafe` / `const extern`)

Failed merges:

r? @ghost

4 years agoRollup merge of #68073 - Centril:fix-68062, r=estebank
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:36 +0000 (02:47 +0100)]
Rollup merge of #68073 - Centril:fix-68062, r=estebank

expect `fn` after `const unsafe` / `const extern`

Fixes #68062

r? @estebank @petrochenkov
cc @Aaron1011

4 years agoRollup merge of #68071 - estebank:ice-67995, r=Centril
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:34 +0000 (02:47 +0100)]
Rollup merge of #68071 - estebank:ice-67995, r=Centril

Extend support of `_` in type parameters

 - Account for `impl Trait<_>`.
 - Provide a reasonable `Span` for empty `Generics` in `impl`s.
 - Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
 - Fix #67995. Follow up to #67597.

4 years agoRollup merge of #67922 - Centril:lowering-cleanup, r=petrochenkov
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:33 +0000 (02:47 +0100)]
Rollup merge of #67922 - Centril:lowering-cleanup, r=petrochenkov

rustc_ast_lowering: misc cleanup & rustc dep reductions

- The first two commits do some code simplification.
- The next three do some file splitting (getting `lib.rs` below the 3kloc tidy lint).
- The remaining commits reduce the number of `rustc::` imports. This works towards making lowering independent of the `rustc` crate.

r? @oli-obk cc @Zoxc

4 years agoRollup merge of #67820 - ecstatic-morse:const-trait, r=oli-obk
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:32 +0000 (02:47 +0100)]
Rollup merge of #67820 - ecstatic-morse:const-trait, r=oli-obk

Parse the syntax described in RFC 2632

This adds support for both `impl const Trait for Ty` and `?const Trait` bound syntax from rust-lang/rfcs#2632 to the parser. For now, both modifiers end up in a newly-added `constness` field on `ast::TraitRef`, although this may change once the implementation is fleshed out.

I was planning on using `delay_span_bug` when this syntax is encountered during lowering, but I can't write `should-ice` UI tests. I emit a normal error instead, which causes duplicates when the feature gate is not enabled (see the `.stderr` files for the feature gate tests). Not sure what the desired approach is; Maybe just do nothing when the syntax is encountered with the feature gate is enabled?

@oli-obk I went with `const_trait_impl` and `const_trait_bound_opt_out` for the names of these features. Are these to your liking?

cc #67792 #67794

r? @Centril

4 years agoRollup merge of #67501 - oli-obk:test-slice-patterns, r=RalfJung
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:30 +0000 (02:47 +0100)]
Rollup merge of #67501 - oli-obk:test-slice-patterns, r=RalfJung

Reduce special treatment for zsts

addresses https://github.com/rust-lang/rust/pull/67467#discussion_r360650846

cc @RalfJung

4 years agoRollup merge of #66463 - estebank:point-at-closure-and-opaque-types, r=Centril
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:29 +0000 (02:47 +0100)]
Rollup merge of #66463 - estebank:point-at-closure-and-opaque-types, r=Centril

Point at opaque and closure type definitions in type errors

Fixes #57266, fixes #67117.

4 years agoAdd test for `?const` in nested impl/dyn trait
Dylan MacKenzie [Mon, 6 Jan 2020 00:34:26 +0000 (16:34 -0800)]
Add test for `?const` in nested impl/dyn trait

4 years agoMake `bound_context` more like neighboring functions
Dylan MacKenzie [Mon, 6 Jan 2020 00:33:26 +0000 (16:33 -0800)]
Make `bound_context` more like neighboring functions

4 years agoAdd test for `?const` and `?` on the same bound
Dylan MacKenzie [Sun, 5 Jan 2020 05:47:11 +0000 (21:47 -0800)]
Add test for `?const` and `?` on the same bound

4 years agoCall all visit methods on trait definitions
Dylan MacKenzie [Sun, 5 Jan 2020 02:34:10 +0000 (18:34 -0800)]
Call all visit methods on trait definitions

4 years agoAdd tests for RFC 2632
Dylan MacKenzie [Fri, 3 Jan 2020 00:31:30 +0000 (16:31 -0800)]
Add tests for RFC 2632

4 years agoCheck for `?const` in invalid contexts during AST validation
Dylan MacKenzie [Sun, 5 Jan 2020 00:29:45 +0000 (16:29 -0800)]
Check for `?const` in invalid contexts during AST validation

4 years agoReject `const` in inherent impls
Dylan MacKenzie [Sat, 4 Jan 2020 00:32:01 +0000 (16:32 -0800)]
Reject `const` in inherent impls

4 years agoError when new syntax is lowered
Dylan MacKenzie [Fri, 3 Jan 2020 00:35:07 +0000 (16:35 -0800)]
Error when new syntax is lowered

This means the new syntax will always fail to compile, even when the
feature gate is enabled. These checks will be removed in a later PR
once the implementation is done.

4 years agoParse `?const Trait` bound syntax
Dylan MacKenzie [Thu, 2 Jan 2020 23:50:18 +0000 (15:50 -0800)]
Parse `?const Trait` bound syntax

The grammar also handles `?const ?Trait` even though this is
semantically redundant.

4 years agoParse `impl const Trait for Ty` syntax
Dylan MacKenzie [Thu, 2 Jan 2020 23:49:45 +0000 (15:49 -0800)]
Parse `impl const Trait for Ty` syntax

4 years agoAdd a `constness` field to `ast::TraitRef`
Dylan MacKenzie [Thu, 2 Jan 2020 23:47:27 +0000 (15:47 -0800)]
Add a `constness` field to `ast::TraitRef`

This is used for both the `?const` syntax in bounds as well as the `impl
const Trait` syntax. I also considered handling these separately by
adding a variant of `TraitBoundModifier` and a field to
`ItemKind::Impl`, but this approach was less intrusive.

4 years agoAdd `const_trait_bound_opt_out` feature gate
Dylan MacKenzie [Thu, 2 Jan 2020 23:46:30 +0000 (15:46 -0800)]
Add `const_trait_bound_opt_out` feature gate

4 years agoAdd `const_trait_impl` feature gate
Dylan MacKenzie [Thu, 2 Jan 2020 23:45:48 +0000 (15:45 -0800)]
Add `const_trait_impl` feature gate

4 years agoreview comments: more tests
Esteban Küber [Thu, 9 Jan 2020 22:53:17 +0000 (14:53 -0800)]
review comments: more tests

4 years agoExtend support of `_` in type parameters
Esteban Küber [Thu, 9 Jan 2020 21:46:37 +0000 (13:46 -0800)]
Extend support of `_` in type parameters

 - Account for `impl Trait<_>`.
 - Provide a reasonable `Span` for empty `Generics` in `impl`s.
 - Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
 - Fix #67995.

4 years agoexpect `fn` after `const unsafe` / `const extern`
Mazdak Farrokhzad [Thu, 9 Jan 2020 22:00:28 +0000 (23:00 +0100)]
expect `fn` after `const unsafe` / `const extern`

4 years agoAuto merge of #68067 - JohnTitor:rollup-vsj5won, r=JohnTitor
bors [Thu, 9 Jan 2020 19:21:58 +0000 (19:21 +0000)]
Auto merge of #68067 - JohnTitor:rollup-vsj5won, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #66254 (Make Layout::new const)
 - #67122 (Do not deduplicate diagnostics in UI tests)
 - #67358 (Add HashSet::get_or_insert_owned)
 - #67725 (Simplify into_key_slice_mut)
 - #67935 (Relax the Sized bounds on Pin::map_unchecked(_mut))
 - #67967 (Delay bug to prevent ICE in MIR borrowck)
 - #67975 (Export public scalar statics in wasm)
 - #68006 (Recognise riscv64 in compiletest)
 - #68040 (Cleanup)
 - #68054 (doc: add Null-unchecked version section to mut pointer as_mut method)

Failed merges:

 - #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)

r? @ghost

4 years agoRollup merge of #68054 - tspiteri:null-unchecked-as_mut, r=cramertj
Yuki Okushi [Thu, 9 Jan 2020 19:18:43 +0000 (04:18 +0900)]
Rollup merge of #68054 - tspiteri:null-unchecked-as_mut, r=cramertj

doc: add Null-unchecked version section to mut pointer as_mut method

The [`as_ref`](https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref-1) method already has a *Null-unchecked version* section, its example is a modification of the example in the main `as_ref` section. Similarly the example in this PR is a modification of the example in main [`as_mut`](https://doc.rust-lang.org/std/primitive.pointer.html#method.as_mut) section.

Fixes #68032.

4 years agoRollup merge of #68040 - sinkuu:unused, r=petrochenkov
Yuki Okushi [Thu, 9 Jan 2020 19:18:42 +0000 (04:18 +0900)]
Rollup merge of #68040 - sinkuu:unused, r=petrochenkov

Cleanup

4 years agoRollup merge of #68006 - infinity0:master, r=nikomatsakis
Yuki Okushi [Thu, 9 Jan 2020 19:18:40 +0000 (04:18 +0900)]
Rollup merge of #68006 - infinity0:master, r=nikomatsakis

Recognise riscv64 in compiletest

Otherwise tests can't run, fails with "Cannot determine Architecture from triple"

4 years agoRollup merge of #67975 - EmbarkStudios:export-statics-wasm, r=alexcrichton
Yuki Okushi [Thu, 9 Jan 2020 19:18:39 +0000 (04:18 +0900)]
Rollup merge of #67975 - EmbarkStudios:export-statics-wasm, r=alexcrichton

Export public scalar statics in wasm

Fixes #67453

I am not sure which export level statics should get when exporting them in wasm. This small change fixes the issue that I had, but this might not be the correct way to implement this.

4 years agoRollup merge of #67967 - JohnTitor:fix-ice-0107, r=matthewjasper
Yuki Okushi [Thu, 9 Jan 2020 19:18:37 +0000 (04:18 +0900)]
Rollup merge of #67967 - JohnTitor:fix-ice-0107, r=matthewjasper

Delay bug to prevent ICE in MIR borrowck

Fixes #67947

r? @matthewjasper

4 years agoRollup merge of #67935 - Thomasdezeeuw:issue_67669, r=withoutboats
Yuki Okushi [Thu, 9 Jan 2020 19:18:36 +0000 (04:18 +0900)]
Rollup merge of #67935 - Thomasdezeeuw:issue_67669, r=withoutboats

Relax the Sized bounds on Pin::map_unchecked(_mut)

Fixes #67669.

4 years agoRollup merge of #67725 - ssomers:into_key_slice_mut, r=RalfJung
Yuki Okushi [Thu, 9 Jan 2020 19:18:34 +0000 (04:18 +0900)]
Rollup merge of #67725 - ssomers:into_key_slice_mut, r=RalfJung

Simplify into_key_slice_mut

Remove a rare and tiny but superfluous run-time check from into_key_slice_mut.

In #67459, I wrote that "`get_mut` [...] does visit `into_key_slice_mut`" and that was wrong. No function that operates on a map that (still) has a shared root ever dives into `into_key_slice_mut`.  So it's more clear to remove the (previously existing, and always incomplete) code it has for dealing with shared roots, as well as a petty performance improvement for those using exotically aligned key types.

~~Also, some testing of the `range` function initially added to #67686 but hardly related.~~

r? @RalfJung

4 years agoRollup merge of #67358 - cuviper:get_or_insert_owned, r=LukasKalbertodt
Yuki Okushi [Thu, 9 Jan 2020 19:18:32 +0000 (04:18 +0900)]
Rollup merge of #67358 - cuviper:get_or_insert_owned, r=LukasKalbertodt

Add HashSet::get_or_insert_owned

This is an extension for tracking issue #60896. The more-general `get_or_insert_with` has potential for misuse, so we might remove it, but I think `get_or_insert_owned` covers most use cases.

4 years agoRollup merge of #67122 - petrochenkov:nodedup, r=estebank
Yuki Okushi [Thu, 9 Jan 2020 19:18:30 +0000 (04:18 +0900)]
Rollup merge of #67122 - petrochenkov:nodedup, r=estebank

Do not deduplicate diagnostics in UI tests

Error reporting infrastructure deduplicates identical diagnostics with identical spans.

While it's preferable to do this in "release"/"user-facing" mode, it sometimes brings [confusion](https://github.com/rust-lang/rust/pull/50682#issuecomment-390949878) and hides details that may be important during development.

Do we run some passes multiple times when we could do it once?
How many times we run them exactly? Can this number be large? Can the multiplied error construction be expensive? Can speculative checks be made cheaper if they don't report errors?

*Relying* on this mechanism to deduplicate some specific error never looks like a proper solution to me personally.

In this PR I attempt to disable this deduplication by applying `-Z deduplicate-diagnostics=no` to UI tests.

4 years agoRollup merge of #66254 - CAD97:patch-1, r=KodrAus
Yuki Okushi [Thu, 9 Jan 2020 19:18:29 +0000 (04:18 +0900)]
Rollup merge of #66254 - CAD97:patch-1, r=KodrAus

Make Layout::new const

This seems like a reasonable change to make. If we don't provide `Layout::new::<T>` as `const`, then users can just instead do the more error prone `Layout::from_size_align_unchecked(mem::size_of::<T>(), mem::align_of::<T>())` for the same effect and an extra `unsafe { }` incantation.

4 years agoAddress review comments + Update NLL tests
Vadim Petrochenkov [Wed, 8 Jan 2020 20:16:57 +0000 (23:16 +0300)]
Address review comments + Update NLL tests

4 years agoMark Layout::new as const stable
CAD97 [Tue, 17 Dec 2019 19:55:46 +0000 (14:55 -0500)]
Mark Layout::new as const stable

4 years agoMake Layout::new const
Christopher Durham [Sat, 9 Nov 2019 18:43:11 +0000 (13:43 -0500)]
Make Layout::new const

4 years agoUpdate tests
Vadim Petrochenkov [Wed, 8 Jan 2020 17:02:10 +0000 (20:02 +0300)]
Update tests

4 years agocompiletest: Do not deduplicate diagnostics in UI tests
Vadim Petrochenkov [Wed, 8 Jan 2020 12:07:26 +0000 (15:07 +0300)]
compiletest: Do not deduplicate diagnostics in UI tests

4 years agoAuto merge of #68047 - pietroalbini:fix-toolstate-again, r=Mark-Simulacrum
bors [Thu, 9 Jan 2020 16:10:01 +0000 (16:10 +0000)]
Auto merge of #68047 - pietroalbini:fix-toolstate-again, r=Mark-Simulacrum

ci: another take at fixing toolstate

Seems like the variable showed by `$(ciCheckoutPath)` on Azure Pipelines was wrong, making the toolstate script fail. This commit changes that function to return the variable previously used by the toolstate script. Other uses of the function were audited, and there should be no conflict.

Failure log: https://dev.azure.com/rust-lang/rust/_build/results?buildId=17933
r? @Mark-Simulacrum

4 years agodoc: add Null-unchecked version section to mut pointer as_mut method
Trevor Spiteri [Thu, 9 Jan 2020 13:51:58 +0000 (14:51 +0100)]
doc: add Null-unchecked version section to mut pointer as_mut method

The as_ref method already has a Null-unchecked version section, its
example is a modification of the example in the main as_ref section.
Similarly the example in this commit is a modification of the example
in main as_mut section.

4 years agoAuto merge of #67988 - Zoxc:prof-fix, r=michaelwoerister
bors [Thu, 9 Jan 2020 11:36:44 +0000 (11:36 +0000)]
Auto merge of #67988 - Zoxc:prof-fix, r=michaelwoerister

Change -Z time event naming scheme and make them generic activities

I made the `-Z time-passes` only events (which encodes argument in the event id) use a `extra_verbose_generic_activity` function which does not emit self-profiling events.

r? @michaelwoerister
cc @wesleywiser

4 years agoSwitch assertion order to be more helpful to ppl that encounter them
Oliver Scherer [Thu, 9 Jan 2020 11:03:37 +0000 (12:03 +0100)]
Switch assertion order to be more helpful to ppl that encounter them

4 years agoRename `Unsized` to `Meta`
Oliver Scherer [Thu, 9 Jan 2020 11:02:44 +0000 (12:02 +0100)]
Rename `Unsized` to `Meta`

4 years agoApply suggestions from code review
Stein Somers [Thu, 9 Jan 2020 11:03:49 +0000 (12:03 +0100)]
Apply suggestions from code review

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoSimplify into_key_slice_mut and document bits and bobs
Stein Somers [Thu, 2 Jan 2020 11:42:31 +0000 (12:42 +0100)]
Simplify into_key_slice_mut and document bits and bobs

4 years agoUpdate src/librustc_mir/interpret/place.rs
Oliver Scherer [Thu, 9 Jan 2020 09:56:05 +0000 (10:56 +0100)]
Update src/librustc_mir/interpret/place.rs

Co-Authored-By: Ralf Jung <post@ralfj.de>
4 years agoci: another take at fixing toolstate
Pietro Albini [Thu, 9 Jan 2020 08:49:25 +0000 (09:49 +0100)]
ci: another take at fixing toolstate

Seems like the variable showed by $(ciCheckoutPath) on Azure Pipelines
was wrong, making the toolstate script fail. This commit changes that
function to return the variable previously used by the toolstate script.
Other uses of the function were audited, and there should be no
conflict.

4 years agoadd CStore::item_generics_num_lifetimes
Mazdak Farrokhzad [Thu, 9 Jan 2020 08:23:44 +0000 (09:23 +0100)]
add CStore::item_generics_num_lifetimes

4 years agorename a method in Resolver trait
Mazdak Farrokhzad [Wed, 8 Jan 2020 22:16:58 +0000 (23:16 +0100)]
rename a method in Resolver trait

4 years agolowering: remove dep on CrateStore
Mazdak Farrokhzad [Mon, 6 Jan 2020 06:34:52 +0000 (07:34 +0100)]
lowering: remove dep on CrateStore

4 years agolowering: rustc::session -> rustc_session
Mazdak Farrokhzad [Mon, 6 Jan 2020 06:05:04 +0000 (07:05 +0100)]
lowering: rustc::session -> rustc_session

4 years ago{rustc::util -> rustc_data_structures}::captures
Mazdak Farrokhzad [Mon, 6 Jan 2020 06:03:46 +0000 (07:03 +0100)]
{rustc::util -> rustc_data_structures}::captures

4 years agorefactor 'Output = $ty' & reduce rustc dep
Mazdak Farrokhzad [Mon, 6 Jan 2020 05:48:51 +0000 (06:48 +0100)]
refactor 'Output = $ty' & reduce rustc dep

4 years agoextract path lowering -> path.rs
Mazdak Farrokhzad [Mon, 6 Jan 2020 05:28:43 +0000 (06:28 +0100)]
extract path lowering -> path.rs

4 years agomove lower_binding_mode -> pat.rs
Mazdak Farrokhzad [Mon, 6 Jan 2020 05:54:48 +0000 (06:54 +0100)]
move lower_binding_mode -> pat.rs

4 years agoextract pattern lowering -> pat.rs
Mazdak Farrokhzad [Mon, 6 Jan 2020 04:51:59 +0000 (05:51 +0100)]
extract pattern lowering -> pat.rs

4 years agolowering: elide some lifetimes
Mazdak Farrokhzad [Mon, 6 Jan 2020 04:35:18 +0000 (05:35 +0100)]
lowering: elide some lifetimes

4 years agolowering: simplify HoFs
Mazdak Farrokhzad [Mon, 6 Jan 2020 04:32:17 +0000 (05:32 +0100)]
lowering: simplify HoFs

4 years agoMore comments
John Kåre Alsaker [Wed, 8 Jan 2020 20:32:00 +0000 (21:32 +0100)]
More comments

4 years agoChange -Z time event naming scheme and make them generic activities
John Kåre Alsaker [Tue, 7 Jan 2020 20:34:08 +0000 (21:34 +0100)]
Change -Z time event naming scheme and make them generic activities

4 years agoRemove unused dependencies
Shotaro Yamada [Thu, 9 Jan 2020 02:52:03 +0000 (11:52 +0900)]
Remove unused dependencies

4 years agoRemove unused `struct ClosureUpvar`
Shotaro Yamada [Thu, 9 Jan 2020 02:47:32 +0000 (11:47 +0900)]
Remove unused `struct ClosureUpvar`

4 years agoAuto merge of #68034 - Centril:rollup-3d9pq14, r=Centril
bors [Thu, 9 Jan 2020 02:05:15 +0000 (02:05 +0000)]
Auto merge of #68034 - Centril:rollup-3d9pq14, r=Centril

Rollup of 12 pull requests

Successful merges:

 - #67630 (Treat extern statics just like statics in the "const pointer to static" representation)
 - #67747 (Explain that associated types and consts can't be accessed directly on the trait's path)
 - #67884 (Fix incremental builds of core by allowing unused attribute.)
 - #67966 (Use matches macro in libcore and libstd)
 - #67979 (Move `intravisit` => `rustc_hir` + misc cleanup)
 - #67986 (Display more informative ICE)
 - #67990 (slice patterns: harden match-based borrowck tests)
 - #68005 (Improve E0184 explanation)
 - #68009 (Spell check librustc_error_codes)
 - #68023 (Fix issue #68008)
 - #68024 (Remove `-Z continue-parse-after-error`)
 - #68026 (Small improvements in lexical_region_resolve)

Failed merges:

r? @ghost

4 years agoAdd HashSet::get_or_insert_owned
Josh Stone [Mon, 16 Dec 2019 18:53:50 +0000 (10:53 -0800)]
Add HashSet::get_or_insert_owned

4 years agoRollup merge of #68026 - llogiq:ch-ch-ch-ch-changes, r=varkor
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:21 +0000 (00:22 +0100)]
Rollup merge of #68026 - llogiq:ch-ch-ch-ch-changes, r=varkor

Small improvements in lexical_region_resolve

This just replaces a trivial `if` condition with a `|=` in two places.

I could even have used a `fold` in the first case, but I think it would be less readable.

4 years agoRollup merge of #68024 - petrochenkov:recoverall, r=Centril
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:20 +0000 (00:22 +0100)]
Rollup merge of #68024 - petrochenkov:recoverall, r=Centril

Remove `-Z continue-parse-after-error`

We are just always recovering and continuing now.

r? @estebank @Centril

4 years agoRollup merge of #68023 - FSciammarella:master, r=Centril,varkor
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:18 +0000 (00:22 +0100)]
Rollup merge of #68023 - FSciammarella:master, r=Centril,varkor

Fix issue #68008

Correcting Typo on error message. From "substract" to "subtract".

Fixes #68008.

4 years agoRollup merge of #68009 - wcampbell0x2a:spellcheck-librustc_error_codes, r=Centril
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:17 +0000 (00:22 +0100)]
Rollup merge of #68009 - wcampbell0x2a:spellcheck-librustc_error_codes, r=Centril

Spell check librustc_error_codes

Found one wrongly spelled error message and decided to check all the
error messages for wrongly spelled statements.

4 years agoRollup merge of #68005 - GuillaumeGomez:explanation-e0184, r=Dylan-DPC
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:16 +0000 (00:22 +0100)]
Rollup merge of #68005 - GuillaumeGomez:explanation-e0184, r=Dylan-DPC

Improve E0184 explanation

r? @Dylan-DPC

4 years agoRollup merge of #67990 - Centril:slice-pats-move-tests-match, r=matthewjasper
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:14 +0000 (00:22 +0100)]
Rollup merge of #67990 - Centril:slice-pats-move-tests-match, r=matthewjasper

slice patterns: harden match-based borrowck tests

This hardens some move-checking tests wrt. slice patterns and `match` expressions.

r? @matthewjasper
cc @pnkfelix
cc https://github.com/rust-lang/rust/pull/67712
cc https://github.com/rust-lang/rust/issues/53114

4 years agoRollup merge of #67986 - JohnTitor:fix-ice-rust-call, r=varkor
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:13 +0000 (00:22 +0100)]
Rollup merge of #67986 - JohnTitor:fix-ice-rust-call, r=varkor

Display more informative ICE

Fixes #66696

4 years agoRollup merge of #67979 - Centril:hir-cleanup, r=Zoxc
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:11 +0000 (00:22 +0100)]
Rollup merge of #67979 - Centril:hir-cleanup, r=Zoxc

Move `intravisit` => `rustc_hir` + misc cleanup

Working towards https://github.com/rust-lang/rust/issues/65031.
This should eventually enable getting rid of rustc as a dependency in various passes (e.g. lints).

cc https://github.com/rust-lang/rust/pull/67806 (this also facilitates liberating lints from tcx)
cc https://github.com/rust-lang/rust/pull/67922 (some other dep reductions)

r? @Zoxc

4 years agoRollup merge of #67966 - popzxc:core-std-matches, r=Centril
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:10 +0000 (00:22 +0100)]
Rollup merge of #67966 - popzxc:core-std-matches, r=Centril

Use matches macro in libcore and libstd

This PR replaces matches like

```rust
match var {
    value => true,
    _ => false,
}
```

with use of `matches!` macro.

r? @Centril

4 years agoRollup merge of #67884 - anp:allow-unused-const-attr, r=oli-obk
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:08 +0000 (00:22 +0100)]
Rollup merge of #67884 - anp:allow-unused-const-attr, r=oli-obk

Fix incremental builds of core by allowing unused attribute.

I *think* that the same problem as in https://github.com/rust-lang/rust/issues/65023 was introduced by https://github.com/rust-lang/rust/pull/67657. This works around the current incrcomp issue with these attributes by allowing it here. This resolves the near-term issue for me, at least.

4 years agoRollup merge of #67747 - estebank:bare-assoc-const, r=Centril
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:07 +0000 (00:22 +0100)]
Rollup merge of #67747 - estebank:bare-assoc-const, r=Centril

Explain that associated types and consts can't be accessed directly on the trait's path

Partially address #44539.

4 years agoRollup merge of #67630 - oli-obk:extern_ptr_dangling, r=spastorino
Mazdak Farrokhzad [Wed, 8 Jan 2020 23:22:05 +0000 (00:22 +0100)]
Rollup merge of #67630 - oli-obk:extern_ptr_dangling, r=spastorino

Treat extern statics just like statics in the "const pointer to static" representation

fixes #67612

r? @spastorino

cc @RalfJung this does not affect runtime promotion at all. This is just about promotion within static item bodies.

4 years agoFix Typo on cannot "substract"
Felipe Sciammarella [Wed, 8 Jan 2020 21:49:15 +0000 (18:49 -0300)]
Fix Typo on cannot "substract"

Fix Typo on hir::BinOpKind::Sub

"substract" to "subtract"

Fix Typo on "Error cannot substract"

Fix Typo on cannot "substract"

4 years agoSmall improvements in lexical_region_resolve
Andre Bogus [Wed, 8 Jan 2020 20:12:21 +0000 (21:12 +0100)]
Small improvements in lexical_region_resolve

4 years agonormalize rustc::hir::intravisit imports
Mazdak Farrokhzad [Tue, 7 Jan 2020 17:12:06 +0000 (18:12 +0100)]
normalize rustc::hir::intravisit imports

4 years agointravisit: use walk_list! more
Mazdak Farrokhzad [Tue, 7 Jan 2020 16:38:38 +0000 (17:38 +0100)]
intravisit: use walk_list! more

4 years ago{rustc::hir -> rustc_hir}::intravisit
Mazdak Farrokhzad [Tue, 7 Jan 2020 16:30:29 +0000 (17:30 +0100)]
{rustc::hir -> rustc_hir}::intravisit

4 years agointravisit: abstract over HIR Map
Mazdak Farrokhzad [Tue, 7 Jan 2020 16:25:33 +0000 (17:25 +0100)]
intravisit: abstract over HIR Map

4 years agointravisit: .expect_item -> .item
Mazdak Farrokhzad [Tue, 7 Jan 2020 14:51:38 +0000 (15:51 +0100)]
intravisit: .expect_item -> .item

4 years agoNestedVisitorMap: reduce visibilities
Mazdak Farrokhzad [Tue, 7 Jan 2020 14:13:47 +0000 (15:13 +0100)]
NestedVisitorMap: reduce visibilities

4 years agohir::map: elide & simplify
Mazdak Farrokhzad [Tue, 7 Jan 2020 14:06:39 +0000 (15:06 +0100)]
hir::map: elide & simplify

4 years agocollector: clarify dependencies
Mazdak Farrokhzad [Tue, 7 Jan 2020 13:38:27 +0000 (14:38 +0100)]
collector: clarify dependencies

4 years agocollector: use impl Trait
Mazdak Farrokhzad [Tue, 7 Jan 2020 13:22:44 +0000 (14:22 +0100)]
collector: use impl Trait

4 years agocollector: extract upstream_crates
Mazdak Farrokhzad [Tue, 7 Jan 2020 13:19:35 +0000 (14:19 +0100)]
collector: extract upstream_crates

4 years agocanonicalize imports in map::block
Mazdak Farrokhzad [Tue, 7 Jan 2020 12:55:08 +0000 (13:55 +0100)]
canonicalize imports in map::block

4 years agoDelay bug to prevent ICE in MIR borrowck
Yuki Okushi [Tue, 7 Jan 2020 07:51:34 +0000 (16:51 +0900)]
Delay bug to prevent ICE in MIR borrowck