Commit Graph

3352 Commits

Author SHA1 Message Date
bors
c4375c9dfd Auto merge of #66645 - RalfJung:dereferenceable, r=pnkfelix
remove the 'dereferenceable' attribute from Box

Fixes https://github.com/rust-lang/rust/issues/66600

r? @eddyb @rkruppe
2019-11-29 11:35:03 +00:00
Eduard-Mihai Burtescu
71710608f0 rustc: hide HirId's fmt::Debug output from -Z span_free_formats. 2019-11-28 22:32:43 +02:00
Vadim Petrochenkov
e84c926d47 rustc: Move some queries to rustc_metadata 2019-11-28 20:59:57 +03:00
Vadim Petrochenkov
9be526e8eb rustc_metadata: Move has_global_allocator from session to cstore 2019-11-28 20:59:57 +03:00
Camille GILLOT
e321ba989c Misc renames. 2019-11-27 13:24:19 +01:00
Brian Wignall
16fabd8efd Fix spelling typos 2019-11-26 22:19:54 -05:00
Matthew Jasper
1f850f61ea Record temporary static references in generator witnesses 2019-11-26 23:18:41 +00:00
Camille GILLOT
7e72b36299 Move local Arena to Queries. 2019-11-26 23:16:48 +01:00
Ralf Jung
d0b983307b review feedback: comments and spacing 2019-11-25 22:45:00 +01:00
bors
ab21557501 Auto merge of #66682 - estebank:fn-type-err, r=davidtwco
Highlight parts of fn in type errors

When a type error arises between two fn items, fn pointers or tuples,
highlight only the differing parts of each.

Examples:

<img width="699" alt="" src="https://user-images.githubusercontent.com/1606434/69487597-ab561600-0e11-11ea-9b4e-d4fd9e91d5dc.png">
<img width="528" alt="" src="https://user-images.githubusercontent.com/1606434/69487207-9033d800-0e0a-11ea-93e3-8c4d002411a5.png">
<img width="468" alt="" src="https://user-images.githubusercontent.com/1606434/69487208-9033d800-0e0a-11ea-92e3-2b2cee120335.png">
<img width="775" alt="" src="https://user-images.githubusercontent.com/1606434/69487209-9033d800-0e0a-11ea-9e68-7f6ed5c8cb08.png">
2019-11-25 12:54:42 +00:00
Mazdak Farrokhzad
a3ff52ce92
Rollup merge of #66594 - Aaron1011:fix/debug-print-cycle, r=matthewjasper
Fix cycle when debug-printing opaque types

Fixes #61577

When printing an opaque type in non-verbose mode, we use the
`tcx.predicates_of` query to retrieve the opaque type's bounds for
pretty-printing. However, the pervasiveness of logging within librustc
means that we may already be executing `tcx.predicates_of` for the
opaque type we're trying to print, leading to a cycle error.

This commit adds a new 'no queries' thread-local flag to the pretty
printer. This flag is enabled during the computation of `predicates_of`
for opaque types, and causes us to print the opaque type in 'verbose'
mode (which does not require computing any additinal queries). This
should only affect debug logging for highly nested log messages, not any
user-visible output.
2019-11-24 03:17:01 +01:00
Esteban Küber
d92355c1db Highlight parts of fn in type errors
When a type error arises between two fn items, fn pointers or tuples,
highlight only the differing parts of each.
2019-11-23 16:50:28 -08:00
Ralf Jung
be079117f0 remove the 'dereferenceable' attribute from Box 2019-11-22 22:04:22 +01:00
bors
083b5a0a1b Auto merge of #66460 - cjgillot:hashstable_generic, r=Zoxc
Add a proc-macro to derive HashStable in librustc dependencies

A second proc-macro is added to derive HashStable for crates librustc depends on.
This proc-macro HashStable_Generic (to bikeshed) allows to decouple code and some librustc's boilerplate.

Not everything is migrated, because `Span` and `TokenKind` require to be placed inside librustc.
Types using them stay there too.

Split out of #66279
r? @Zoxc
2019-11-22 13:54:41 +00:00
bors
f11759d38c Auto merge of #66610 - alexreg:trait-upcasting-cosmetic, r=Centril
Aggregation of drive-by cosmetic changes for trait-upcasting PR

Cherry-picked from #60900.

As requested by @Centril (and @nikomatsakis, I believe).

r? @Centril
2019-11-21 21:01:14 +00:00
Alexander Regueiro
51cb60cd3f Aggregation of drive-by cosmetic changes. 2019-11-21 18:50:38 +00:00
bors
53712f8637 Auto merge of #66389 - estebank:type-err-labels, r=petrochenkov
Specific labels when referring to "expected" and "found" types
2019-11-21 17:53:19 +00:00
Mazdak Farrokhzad
d7bb37d663
Rollup merge of #66515 - Centril:cheaper-inline-asm, r=oli-obk
Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`

r? @oli-obk
2019-11-21 15:29:07 +01:00
Mazdak Farrokhzad
02b38ac0ff
Rollup merge of #66468 - RalfJung:simd-cleanup, r=oli-obk
Cleanup Miri SIMD intrinsics

r? @oli-obk @eddyb Cc @gnzlbg
2019-11-21 15:29:05 +01:00
Mazdak Farrokhzad
e4a634189e
Rollup merge of #65730 - csmoe:return-lifetime, r=nikomatsakis
Suggest to add lifetime constraint at explicit ouput of functions

Closes #62097
2019-11-21 15:29:02 +01:00
Mazdak Farrokhzad
6eb0627b49 Gate fallback via #![feature(never_type_fallback)]. 2019-11-21 14:55:33 +01:00
Mazdak Farrokhzad
15c30ddd69 Stabilize the never_type, written !. 2019-11-21 14:55:32 +01:00
Aaron Hill
bc7b17c477
Fix cycle when debug-printing opaque types
Fixes #61577

When printing an opaque type in non-verbose mode, we use the
`tcx.predicates_of` query to retrieve the opaque type's bounds for
pretty-printing. However, the pervasiveness of logging within librustc
means that we may already be executing `tcx.predicates_of` for the
opaque type we're trying to print, leading to a cycle error.

This commit adds a new 'no queries' thread-local flag to the pretty
printer. This flag is enabled during the computation of `predicates_of`
for opaque types, and causes us to print the opaque type in 'verbose'
mode (which does not require computing any additinal queries). This
should only affect debug logging for highly nested log messages, not any
user-visible output.
2019-11-20 20:19:23 -05:00
Mazdak Farrokhzad
44cebe5970 reduce size of hir::ExprKind 2019-11-21 01:23:29 +01:00
Camille GILLOT
4da5fe7fdb Fix derive syntax. 2019-11-19 20:48:08 +01:00
Camille GILLOT
7db84e8504 Fix project syntax. 2019-11-19 20:48:06 +01:00
Camille GILLOT
e1522fa183 Derive HashStable more. 2019-11-19 20:47:57 +01:00
Camille GILLOT
781866f3a9 More HashStable. 2019-11-19 20:47:31 +01:00
Camille GILLOT
e00ebd725f Derive HashStable in librustc. 2019-11-19 20:32:35 +01:00
bors
618b01f9fa Auto merge of #66454 - cjgillot:lift, r=Zoxc
Derive Lift using a proc-macro

Based on #66384

r? @Zoxc
2019-11-19 15:24:09 +00:00
Nicholas Nethercote
c84fae13e5 Move the definition of QueryResult into plumbing.rs.
Because it's the only file that uses it, and removes the need for
importing it.
2019-11-19 17:23:44 +11:00
Esteban Küber
b3517cdee7 review comments 2019-11-18 11:03:04 -08:00
Esteban Küber
6f8f70624b Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
Esteban Küber
94c6425464 Remove E0308 note when primary label has all info 2019-11-18 11:03:03 -08:00
Esteban Küber
b2e6aef073 review comments: tweak prefix strings 2019-11-18 11:02:44 -08:00
Esteban Küber
83ffda5216 Specific labels when referring to "expected" and "found" types 2019-11-18 11:02:22 -08:00
Camille GILLOT
35cba9eb0b Retire EnumLiftImpl. 2019-11-18 08:41:28 +01:00
Camille GILLOT
033d1df19b Retire BraceStructLiftImpl. 2019-11-18 08:41:28 +01:00
Camille GILLOT
333c11433b Derive HashStable in librustc_target. 2019-11-17 22:37:15 +01:00
bors
d8014582b8 Auto merge of #66384 - cjgillot:typefoldable, r=Zoxc
Derive TypeFoldable using a proc-macro

A new proc macro is added in librustc_macros.
It is used to derive TypeFoldable inside librustc and librustc_traits.

For now, the macro uses the `'tcx` lifetime implicitly, and does not allow for a more robust selection of the adequate lifetime.

The Clone-based TypeFoldable implementations are not migrated.

Closes #65674
2019-11-17 15:25:10 +00:00
Ralf Jung
09180d71fd make simd_size return a u64 2019-11-16 13:31:09 +01:00
Ralf Jung
44b68116c5 rename and move read_vector_ty 2019-11-16 13:15:45 +01:00
Bart Massey
ed56f86781 Cleaned up unused labels
Deleted unused labels from compiler and fixed or allowed
unused labels in tests. This patch removes some gratuitous
unused labels and turns off the warning for unused labels
that are a necessary part of tests.  This will permit
setting the `unused_labels` lint to `warn`.
2019-11-15 16:31:30 -08:00
Yuki Okushi
22c0f628df
Rollup merge of #66013 - nnethercote:avoid-hashing-twice-in-get_query, r=Zoxc
Avoid hashing the key twice in `get_query()`.

For a single-threaded parallel compiler, this reduces instruction counts
across several benchmarks, by up to 2.8%.

The commit also adds documentation about `Sharded`'s use of `FxHasher`.

r? @Zoxc
2019-11-15 18:36:20 +09:00
Camille GILLOT
cb46c3558a Use multiple derive clauses. 2019-11-14 22:34:08 +01:00
Guillaume Gomez
798e389e57 Update to use new librustc_error_codes library 2019-11-14 13:05:42 +01:00
bors
5e380b797b Auto merge of #66233 - cjgillot:constkind, r=oli-obk
Split ConstValue into two enums

Hello,

Issue #59210 appeared abandoned, so I gave it a go.
Some further cleanup and refactoring may be mandated.

I did not test beyond `x.py check`, since my home computer dies compiling librustc.

Fixes #59210
2019-11-14 04:54:51 +00:00
Camille GILLOT
7214b9ad48 Retire BraceStructTypeFoldableImpl and TupleStructTypeFoldableImpl. 2019-11-13 21:48:13 +01:00
Camille GILLOT
17692b5849 Use TypeFoldable derive macro. 2019-11-13 21:36:57 +01:00
Yuki Okushi
fab583bdfc
Rollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, r=michaelwoerister
Move self-profile infrastructure to data structures

The single dependency on queries (QueryName) can be fairly easily
abstracted via a trait and this further decouples Session from librustc
(the primary goal).

This is intended as a precursor to moving Session out of librustc, but since that involves lots of smaller steps that move around code I'm splitting it up into separate PRs.
2019-11-13 22:09:29 +09:00
Yuki Okushi
f735cd2f89
Rollup merge of #66334 - Mark-Simulacrum:sess-cstore, r=petrochenkov
Move Session fields to CrateStore

`allocator_kind` and `injected_panic_runtime` are both query-like, this moves them out of Session and into CrateStore, avoiding the `Once` they previously had by clearing separating initialization and de-initialization.
2019-11-13 22:09:28 +09:00
Camille GILLOT
4caa66f25d Centril review. 2019-11-12 20:50:47 +01:00
Camille GILLOT
f9ff78bdd5 Remove cruft. 2019-11-12 20:50:47 +01:00
Camille GILLOT
ee33e0279a Refactor pretty_print_const. 2019-11-12 20:14:53 +01:00
Camille GILLOT
e5fb784823 Create intermediate enum ty::ConstKind. 2019-11-12 20:14:52 +01:00
Mark Rousskov
2fd545485a Register queries with self profiler in rustc_interface 2019-11-12 13:13:14 -05:00
Mark Rousskov
f696b21c5f Move self-profile infrastructure to data structures
The single dependency on queries (QueryName) can be fairly easily
abstracted via a trait and this further decouples Session from librustc
(the primary goal).
2019-11-12 12:48:04 -05:00
csmoe
9124f7a096 update suggestion ui test 2019-11-13 00:38:37 +08:00
Yuki Okushi
dfd11229b3
Rollup merge of #66276 - Mark-Simulacrum:sess-code-stats, r=nikomatsakis
Move lock into CodeStats

Prevent (theoretical) accidental too-long borrows by ensuring only encapsulated locking.
2019-11-12 16:36:12 +09:00
Mark Rousskov
2c6d609484 Move allocator_kind to CrateStore
Similarly to the previous commit, there's no need for this to be in
Session and have a Once around it.
2019-11-11 14:59:07 -05:00
Mark Rousskov
e1cf38ac18 Move injected_panic_runtime to CrateStore
This was essentially a "query" previously (with no key, just always run
once when resolving the crate dependencies), and remains so, just now in
a way that isn't on Session. This removes the need for the `Once` as
well.
2019-11-11 14:50:26 -05:00
csmoe
dcc14c40ee suggest to add a constraint except asyn-fn without explicit output 2019-11-11 21:37:13 +08:00
Mark Rousskov
2c34f384d4 Move lock into CodeStats
Prevent accidental too-long borrows by ensuring only encapsulated
locking.
2019-11-10 11:48:47 -05:00
Camille GILLOT
5b30da10b6 Merge hir::GeneratorMovability into ast::Movability. 2019-11-10 12:31:41 +01:00
Camille GILLOT
ed640c6a27 Merge hir::Mutability into ast::Mutability. 2019-11-10 12:21:05 +01:00
Yuki Okushi
401d9e1c28
Rollup merge of #65831 - matthewjasper:array-ptr-cast, r=oli-obk
Don't cast directly from &[T; N] to *const T

Split out from #64588

r? @oli-obk
2019-11-10 09:27:12 +09:00
Mazdak Farrokhzad
666f9f9aa0
Rollup merge of #65994 - estebank:where-bound, r=nikomatsakis
Point at where clauses where the associated item was restricted

CC #57663.
r? @nikomatsakis
2019-11-09 07:18:29 +01:00
Dylan MacKenzie
3783ef6dbe Stop returning promotables from mir_const_qualif 2019-11-08 14:52:22 -08:00
Yuki Okushi
1969f415fa
Rollup merge of #66190 - eddyb:primflt, r=Centril
rustc_target: inline abi::FloatTy into abi::Primitive.

This effectively undoes a small part of @oli-obk's #50967, now that the rest of the compiler doesn't use the `FloatTy` definition from `rustc_target`, post-#65884.
2019-11-08 13:42:24 +09:00
Eduard-Mihai Burtescu
ccde510c95 rustc_target: inline abi::FloatTy into abi::Primitive. 2019-11-07 16:54:25 +02:00
Mazdak Farrokhzad
379b19c17f
Rollup merge of #63793 - oli-obk:🧹, r=dtolnay
Have tidy ensure that we document all `unsafe` blocks in libcore

cc @rust-lang/libs

I documented a few and added ignore flags on the other files. We can incrementally document the files, but won't regress any files this way.
2019-11-07 14:27:20 +01:00
Mazdak Farrokhzad
883fe10da2
Rollup merge of #65884 - Centril:non-hardcoded-abis, r=petrochenkov
syntax: ABI-oblivious grammar

This PR has the following effects:

1. `extern $lit` is now legal where `$lit:literal` and `$lit` is substituted for a string literal.

2. `extern "abi_that_does_not_exist"` is now *syntactically* legal whereas before, the set of ABI strings was hard-coded into the grammar of the language. With this PR, the set of ABIs are instead validated and translated during lowering. That seems more appropriate.

3. `ast::FloatTy` is now distinct from `rustc_target::abi::FloatTy`. The former is used substantially more and the translation between them is only necessary in a single place.

4. As a result of 2-3, libsyntax no longer depends on librustc_target, which should improve pipe-lining somewhat.

cc @rust-lang/lang -- the points 1-2 slightly change the definition of the language but in a way which seems consistent with our general principles (in particular wrt. the discussions of turning things into semantic errors). I expect this to be uncontroversial but it's worth letting y'all know. :)

r? @varkor
2019-11-07 08:51:55 +01:00
Mazdak Farrokhzad
55f76cdb2f syntax: use distinct FloatTy from rustc_target.
We also sever syntax's dependency on rustc_target as a result.
This should slightly improve pipe-lining.

Moreover, some cleanup is done in related code.
2019-11-07 05:25:31 +01:00
Esteban Küber
a12a32ab65 review comments 2019-11-06 10:04:23 -08:00
Oliver Scherer
34f7fcb862 Rebase fallout 2019-11-06 11:04:42 +01:00
Mazdak Farrokhzad
4f9651b854
Rollup merge of #66139 - euclio:pluralize, r=nagisa
use American spelling for `pluralize!`
2019-11-06 07:03:14 +01:00
Mazdak Farrokhzad
167b8fedd6
Rollup merge of #66086 - RalfJung:smallvec, r=nagisa
bump smallvec to 1.0

This includes https://github.com/servo/rust-smallvec/pull/162, fixing an unsoundness in smallvec.

See https://github.com/servo/rust-smallvec/pull/175 for the 1.0 release announcement.

Cc @mbrubeck @emilio
2019-11-06 07:03:08 +01:00
Mazdak Farrokhzad
a0b4b4dafa
Rollup merge of #65776 - nnethercote:rename-LocalInternedString-and-more, r=estebank
Rename `LocalInternedString` and more

This PR renames `LocalInternedString` as `SymbolStr`, removes an unnecessary `impl` from it, improves comments, and cleans up some `SymbolStr` uses.

r? @estebank
2019-11-06 07:03:01 +01:00
Mazdak Farrokhzad
5c4a595ff0
Rollup merge of #66027 - Mark-Simulacrum:panic-handler-query, r=alexcrichton
Move has_panic_handler to query

Moves us off of a global Once instead re-querying the lang item each time. The conditions on when we set it to true change a little (previously we'd make sure a few more lang items were `Some`) but I think they in practice don't matter, we won't compile later on if we don't have them.
2019-11-06 03:28:08 +01:00
Mazdak Farrokhzad
f746d99f68
Rollup merge of #66014 - dkadashev:47319-type-param-def-location, r=estebank
Show type parameter name and definition in type mismatch error messages

Fixes #47319

r? estebank
2019-11-06 03:28:06 +01:00
Andy Russell
ad550b8ef3
use American spelling for pluralize! 2019-11-05 15:10:24 -05:00
Pietro Albini
6ad9f56316
Rollup merge of #66025 - petrochenkov:lohi, r=eddyb
`Span` cannot represent `span.hi < span.lo`

So we can remove the corresponding checks from various code
2019-11-05 14:37:01 +01:00
Pietro Albini
b5bcb28b72
Rollup merge of #66012 - nnethercote:dequery-trivial_dropck_outlives, r=michaelwoerister
De-querify `trivial_dropck_outlives`.

It's sufficiently simple and fast that memoizing it is a slight
pessimization.

r? @michaelwoerister
2019-11-05 14:36:59 +01:00
Ralf Jung
90b8d34c9f bump smallvec to 1.0 2019-11-04 15:59:09 +01:00
Nicholas Nethercote
1aceaaa969 Avoid hashing the key twice in get_query().
For a single-threaded parallel compiler, this reduces instruction counts
across several benchmarks, by up to 2.8%.

The commit also adds documentation about `Sharded`'s use of `FxHasher`.
2019-11-04 10:15:55 +11:00
Eduard-Mihai Burtescu
89c8f3abca rustc: rename {Fn,Arg}TypeExt to {Fn,Arg}AbiExt. 2019-11-03 09:23:50 +02:00
Eduard-Mihai Burtescu
6567154ede rustc_target: rename {Fn,Arg}Type to {Fn,Arg}Abi. 2019-11-03 09:23:43 +02:00
Dmitry Kadashev
774e60b0c1 Prettify mismatched types error message in a special case
Type parameters are referenced in the error message after the previous
few commits (using span label). But when the main error message already
references the very same type parameter it becomes clumsy. Do not show
the additional label in this case as per code review comment by
@estebank.

Also this contains a small style fix.
2019-11-02 14:55:03 +07:00
Dmitry Kadashev
036f182804 Show type param definitions in type mismatch errors
Fixes #47319.

Shows the type parameter definition(s) on type mismatch errors so the
context is clearer. Pretty much changes the following:

```
LL |     bar1(t);
   |          ^
   |          |
   |          expected enum `std::option::Option`, found type parameter `T`
```

into:

```
LL | fn foo1<T>(t: T) {
   |         - this type parameter
LL |     bar1(t);
   |          ^
   |          |
   |          expected enum `std::option::Option`, found type parameter `T`
```
2019-11-02 12:48:24 +07:00
Dmitry Kadashev
6a30ce639f Add type parameter name to type mismatch error messages
Part of #47319.

This just adds type parameter name to type mismatch error message, so
e.g. the following:

```
expected enum `std::option::Option`, found type parameter
```

becomes

```
expected enum `std::option::Option`, found type parameter `T`
```
2019-11-02 12:48:23 +07:00
Mark Rousskov
692ae3d9fb Move has_panic_handler to query 2019-11-01 22:24:43 -04:00
Nicholas Nethercote
5bc7084f7e Convert x.as_str().to_string() to x.to_string() where possible. 2019-11-02 09:01:00 +11:00
Vadim Petrochenkov
ecaa96418b Span cannot represent span.hi < span.lo
So we can remove the corresponding checks from various code
2019-11-01 23:40:07 +03:00
Tyler Mandry
d6e35d1334
Rollup merge of #66018 - pnkfelix:issue-64872-revert-64324, r=alexcrichton
Revert PR 64324: dylibs export generics again (for now)

As discussed on PR #65781, this is a targeted attempt to undo the main semantic change from PR #64324, by putting `dylib` back in the set of crate types that export generic symbols.

The main reason to do this is that PR #64324 had unanticipated side-effects that caused bugs like #64872, and in the opinion of @alexcrichton and myself, the impact of #64872 is worse than #64319.

In other words, it is better for us, in the short term, to reopen #64319 as currently unfixed for now than to introduce new bugs like #64872.

Fix #64872

Reopen #64319
2019-11-01 11:20:29 -07:00
Felix S. Klock II
d21f9b7fd6 targeted revert of PR rust-lang/rust#64324 (just undo change to dylib generics export).
Includes the anticipated fallout to run-make-fulldeps test suite from
this change. (We need to reopen issue 64319 as part of landing this.)
2019-11-01 15:05:45 +01:00
Nicholas Nethercote
89719726ca De-querify trivial_dropck_outlives.
It's sufficiently simple and fast that memoizing it is a slight
pessimization.
2019-11-01 14:48:58 +11:00
Esteban Küber
9534b5863f Point at where clauses where the associated item was restricted 2019-10-31 10:22:21 -07:00
msizanoen
0a21018d14 Implement dual proc macro hashing
This changes the mechanism of `-Z dual-proc-macro` to record the host
proc macro hash in the transistive dependency information and use it
during dependency resolution instead of resolving only by name.
2019-10-31 13:12:35 +07:00
Mazdak Farrokhzad
46063ed23f
Rollup merge of #65809 - roblabla:eficall-abi, r=nagisa
Add new EFIAPI ABI

Fixes #54527

Adds a new ABI, "efiapi", which reflects the calling convention as specified by [the current spec UEFI spec](https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G6.999903). When compiling for x86_64, we should select the `win64` ABI, while on all other architectures (Itanium, x86, ARM and ARM64 and RISC-V), we should select the `C` ABI.

Currently, this is done by just turning it into the C ABI everywhere except on x86_64, where it's turned into the win64 ABI. Should we prevent this ABI from being used on unsupported architectures, and if so, how would this be done?
2019-10-29 04:08:23 +01:00
Mazdak Farrokhzad
545166435c
Rollup merge of #65891 - michaelwoerister:sp-crate-metadata, r=wesleywiser
self-profiling: Record something more useful for crate metadata generation event.

Before this commit, we had an event that would only track the compression step
for proc-macros and Rust dylibs. After the commit we measure the time for
acutally generating the crate metadata bytes.

r? @wesleywiser
2019-10-28 21:36:07 +01:00
Mazdak Farrokhzad
216e50d904
Rollup merge of #65643 - varkor:remove-free-regions-from-const-placeholder, r=eddyb
Correct handling of type flags with `ConstValue::Placeholder`

This fixes a mistake, but not https://github.com/rust-lang/rust/issues/65623.

r? @eddyb
2019-10-28 21:35:59 +01:00
Michael Woerister
46a39a2d42 self-profiling: Record something more useful for crate metadata generation event.
Before this commit, we had an event that would only track the compression step
for proc-macros and Rust dylibs. After the commit we measure the time for
acutally generating the crate metadata bytes.
2019-10-28 13:55:13 +01:00
bors
03a50ae9b8 Auto merge of #65188 - matthewjasper:stabilize-const-constructor, r=Centril
Stabilize `const_constructor`

# Stabilization proposal

I propose that we stabilize `#![feature(const_constructor)]`.

Tracking issue: https://github.com/rust-lang/rust/issues/61456
Version target: 1.40 (2019-11-05 => beta, 2019-12-19 => stable).

## What is stabilized

### User guide

Tuple struct and tuple variant constructors are now considered to be constant functions. As such a call expression where the callee has a tuple struct or variant constructor "function item" type can be called:

```rust
const fn make_options() {
    // These already work because they are special cased:
    Some(0);
    (Option::Some)(1);
    // These also work now:
    let f = Option::Some;
    f(2);
    {Option::Some}(3);
    <Option<_>>::Some(5);
}
```

### Motivation

Consistency with other `const fn`. Consistency between syntactic path forms.

This should also ensure that constructors implement `const Fn` traits and can be coerced to `const fn` function pointers, if they are introduced.

## Tests

* [ui/consts/const_constructor/const-construct-call.rs](0d75ab2293/src/test/ui/consts/const_constructor/const-construct-call.rs) - Tests various syntactic forms, use in both `const fn` and `const` items, and constructors in both the current and extern crates.
* [ui/consts/const_constructor/const_constructor_qpath.rs](1850dfcdab/src/test/ui/consts/const_constructor/const_constructor_qpath.rs) - Tests that type qualified paths to enum variants are also considered to be `const fn`.(#64247)

r? @oli-obk

Closes #61456
Closes  #64247
2019-10-28 07:38:49 +00:00
Mazdak Farrokhzad
83260d5c43
Rollup merge of #65792 - Centril:split-syntax-2, r=petrochenkov
rustc, rustc_passes: reduce deps on rustc_expand

Part of #65324.

r? @petrochenkov
2019-10-28 04:53:07 +01:00
Mazdak Farrokhzad
4728d66206
Rollup merge of #65664 - anp:panic-location, r=eddyb
`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N)

[Tracking issue](https://github.com/rust-lang/rust/issues/47809)
[RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)

@eddyb suggested doing this intrinsic implementation ahead of actually implementing the `#[track_caller]` attribute so that there's an easily tested intermediate step between adding the shim and wiring up the attribute.
2019-10-28 04:53:06 +01:00
Matthew Jasper
170718c93f Stabilize const_constructor 2019-10-27 21:25:35 +00:00
Adam Perry
86e55b1882 Always use consteval to codegen caller_location. 2019-10-27 12:51:55 -07:00
Mazdak Farrokhzad
fb12c70852 rustc, rustc_passes: don't depend on syntax_expand.
This is done by moving some data definitions to syntax::expand.
2019-10-27 17:05:57 +01:00
bors
0f677c65e8 Auto merge of #65541 - eddyb:spanned-inferred-outlives, r=nikomatsakis
rustc: add `Span`s to `inferred_outlives_of` predicates.

This would simplify #59789, and I suspect it has some potential in diagnostics (although we don't seem to use the predicate `Span`s much atm).
2019-10-27 12:58:10 +00:00
bors
b7176b44a2 Auto merge of #65519 - pnkfelix:issue-63438-trait-based-structural-match, r=matthewjasper
trait-based structural match implementation

Moves from using a `#[structural_match]` attribute to using a marker trait (or pair of such traits, really) instead.

Fix #63438.

(This however does not remove the hacks that I believe were put into place to support the previous approach of injecting the attribute based on the presence of both derives... I have left that for follow-on work.)
2019-10-27 09:35:12 +00:00
bors
cf148a717a Auto merge of #65288 - estebank:point-at-assoc-type, r=nikomatsakis
Point at associated type for some obligations

Partially address #57663.
2019-10-27 03:34:54 +00:00
varkor
6661db006a Correct handling of type flags with ConstValue::Placeholder 2019-10-25 23:38:26 +01:00
Matthew Jasper
972c3be6c3 Don't cast directly from &[T; N] to *const T
Instead coerce to `*const [T; N]` and then cast.
2019-10-25 22:25:50 +01:00
Yuki Okushi
574b0780ab
Rollup merge of #65800 - michaelwoerister:measureme-0.4.0, r=wesleywiser
self-profiling: Update measureme to 0.4.0 and remove non-RAII methods from profiler.

This PR removes all non-RAII based profiling methods from `SelfProfilerRef` 🎉
It also delegates the `TimingGuard` implementation to `measureme`, now that that is available there.

r? @wesleywiser
2019-10-26 02:45:59 +09:00
Mazdak Farrokhzad
dfcfca28ad Take out an insurance policy in case iter.size_hint()
lies, underreporting the number of elements.
2019-10-25 17:43:53 +02:00
roblabla
093ec70b1e Add new EFIAPI ABI
Adds a new ABI for the EFIAPI calls. This ABI should reflect the latest
version of the UEFI specification at the time of commit (UEFI spec 2.8,
URL below). The specification says that for x86_64, we should follow the
win64 ABI, while on all other supported platforms (ia32, itanium, arm,
arm64 and risc-v), we should follow the C ABI.

To simplify the implementation, we will simply follow the C ABI on all
platforms except x86_64, even those technically unsupported by the UEFI
specification.

https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf
2019-10-25 13:01:25 +00:00
Felix S. Klock II
86f7d6f21e Review feedback: elaborated comments. 2019-10-25 14:52:38 +02:00
Felix S. Klock II
98f5b11b6b Migrate from #[structural_match] attribute a lang-item trait.
(Or more precisely, a pair of such traits: one for `derive(PartialEq)` and one
for `derive(Eq)`.)

((The addition of the second marker trait, `StructuralEq`, is largely a hack to
work-around `fn (&T)` not implementing `PartialEq` and `Eq`; see also issue
rust-lang/rust#46989; otherwise I would just check if `Eq` is implemented.))

Note: this does not use trait fulfillment error-reporting machinery; it just
uses the trait system to determine if the ADT was tagged or not. (Nonetheless, I
have kept an `on_unimplemented` message on the new trait for structural_match
check, even though it is currently not used.)

Note also: this does *not* resolve the ICE from rust-lang/rust#65466, as noted
in a comment added in this commit. Further work is necessary to resolve that and
other problems with the structural match checking, especially to do so without
breaking stable code (adapted from test fn-ptr-is-structurally-matchable.rs):

```rust
fn r_sm_to(_: &SM) {}

fn main() {
    const CFN6: Wrap<fn(&SM)> = Wrap(r_sm_to);
    let input: Wrap<fn(&SM)> = Wrap(r_sm_to);
    match Wrap(input) {
        Wrap(CFN6) => {}
        Wrap(_) => {}
    };
}
```

where we would hit a problem with the strategy of unconditionally checking for
`PartialEq` because the type `for <'a> fn(&'a SM)` does not currently even
*implement* `PartialEq`.

----

added review feedback:
* use an or-pattern
* eschew `return` when tail position will do.
* don't need fresh_expansion; just add `structural_match` to appropriate `allow_internal_unstable` attributes.

also fixed example in doc comment so that it actually compiles.
2019-10-25 14:52:07 +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
Felix S. Klock II
4f7b922afe refactor: move structural_match analysis into its own module. 2019-10-25 11:27:36 +02:00
Michael Woerister
9c083068e3 self-profiling: Switch query-blocking measurements to RAII-style API. 2019-10-25 11:14:29 +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
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
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
Eduard-Mihai Burtescu
93cac9c3da rustc: add Spans to inferred_outlives_of predicates. 2019-10-24 20:06:37 +03:00
Mazdak Farrokhzad
a649b1666c
Rollup merge of #65657 - nnethercote:rm-InternedString-properly, r=eddyb
Remove `InternedString`

This PR removes `InternedString` by converting all occurrences to `Symbol`. There are a handful of places that need to use the symbol chars instead of the symbol index, e.g. for stable sorting; local conversions `LocalInternedString` is used in those places.

r? @eddyb
2019-10-23 22:19:19 +02:00
Mazdak Farrokhzad
7c043e284a
Rollup merge of #65193 - Mark-Simulacrum:lockless-lintstore, r=nikomatsakis
Lockless LintStore

This removes mutability from the lint store after registration. Each commit stands alone, for the most part, though they don't make sense out of sequence.

The intent here is to move LintStore to a more parallel-friendly architecture, although also just a cleaner one from an implementation perspective. Specifically, this has the following changes:
 * We no longer implicitly register lints when registering lint passes
    * For the most part this means that registration calls now likely want to call something like:
       `lint_store.register_lints(&Pass::get_lints())` as well as `register_*_pass`.
    * In theory this is a simplification as it's much easier for folks to just register lints and then have passes that implement whichever lint however they want, rather than necessarily tying passes to lints.
 * Lint passes still have a list of associated lints, but a followup PR could plausibly change that
   * This list must be known for a given pass type, not instance, i.e., `fn get_lints()` is the signature instead of `fn get_lints(&self)` as before.
 * We do not store pass objects, instead storing constructor functions. This means we always get new passes when running lints (this happens approximately once though for a given compiler session, so no behavior change is expected).
 * Registration API is _much_ simpler: generally all functions are just taking `Fn() -> PassObject` rather than several different `bool`s.
2019-10-23 22:19:10 +02:00
Esteban Küber
3a4cacd458 Add comments 2019-10-23 08:54:24 -07:00
bors
4a8c5b20c7 Auto merge of #57545 - bovinebuddha:object_safe_for_dispatch, r=nikomatsakis
Object safe for dispatch

cc #43561
2019-10-23 13:34:27 +00:00
Esteban Küber
669a4035ef review comments: move code, fix indentation and change span 2019-10-22 12:43:04 -07:00
Esteban Küber
5b58095f68 Handle projection obligation errors 2019-10-22 12:42:15 -07:00
Esteban Küber
58c6591cde Point at associated type for some obligations 2019-10-22 12:42:15 -07:00
Mathias Blikstad
ef5acdeceb RFC 2027: "first draft" of implementation
These are a squashed series of commits.
2019-10-22 15:24:33 -04:00
Santiago Pastorino
5f5903df31
Add ignore-tidy-filelength on ty/context
This is so we avoid a massive break of other people's code. Gonna run
rustfmt and split the file on a different PR.
2019-10-22 10:33:37 -03:00
Santiago Pastorino
180fc413fb
Move Place::elem methods and friends to TyCtxt 2019-10-22 10:33:36 -03:00
Santiago Pastorino
d32c2865d6
Intern place projection 2019-10-22 10:33:36 -03:00
Santiago Pastorino
a19aed2226
Add intern table for List<PlaceElem<'tcx>> 2019-10-22 10:33:36 -03:00
varkor
7f13a4a80a Remove FIXME 2019-10-22 12:26:32 +01:00
varkor
133cd2cfaf Search for generic parameters when finding non-structural_match types 2019-10-22 12:26:32 +01:00
varkor
600607f45a Move search_for_adt_without_structural_match to ty/mod 2019-10-22 12:26:32 +01:00
Mazdak Farrokhzad
c461d02e08
Rollup merge of #65660 - varkor:canonical-const-to-bound-const, r=eddyb
Rename `ConstValue::Infer(InferConst::Canonical(..))` to `ConstValue::Bound(..)`

It already has the right form, so this is just a renaming. Fixes https://github.com/rust-lang/rust/issues/65655.

r? @eddyb
2019-10-21 22:00:53 +02:00
Mazdak Farrokhzad
9072e108b5
Rollup merge of #65647 - nnethercote:rm-unnecessary-traits, r=Centril
Remove unnecessary trait bounds and derivations

This PR removes unnecessary trait bounds and derivations from many types.

r? @nikomatsakis
2019-10-21 22:00:50 +02:00
Mazdak Farrokhzad
aba84894d1
Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJung
Change untagged_unions to not allow union fields with drop

This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass.

Change untagged_unions to not allow union fields with drop

Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar).

The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature.

Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-21 22:00:45 +02:00
varkor
e9c2685167 Rename ConstValue::Infer(InferConst::Canonical(..)) to ConstValue::Bound(..) 2019-10-21 20:50:41 +01:00
Nicholas Nethercote
ac6daed384 Remove many unnecessary trait derivations. 2019-10-21 20:59:18 +11:00
Nicholas Nethercote
2da7a9c0d9 Use Symbol for codegen unit names.
This is a straightforward replacement except for two places where we
have to convert to `LocalInternedString` to get a stable sort.
2019-10-21 18:30:40 +11:00
Nicholas Nethercote
dddacf1eb3 Change SymbolName::name from InternedString to Symbol.
This requires changing the `PartialOrd`/`Ord` implementations to look at
the chars rather than the symbol index.
2019-10-21 18:30:32 +11:00
Nicholas Nethercote
b8214e9b44 Convert fields within DefPathData from InternedString to Symbol.
It's a full conversion, except in `DefKey::compute_stable_hash()` where
a `Symbol` now is converted to an `InternedString` before being hashed.
This was necessary to avoid test failures.
2019-10-21 17:17:36 +11:00
Nicholas Nethercote
c3b3a86124 Remove unnecessary Hash bounds from various types. 2019-10-21 13:48:20 +11:00
Nicholas Nethercote
77c50dc508 Remove unnecessary trait bounds from keys::Keys. 2019-10-21 13:45:21 +11:00
Nicholas Nethercote
02edd14cde Convert some InternedStrings to Symbols.
This avoids the needs for various conversions, and makes the code
slightly faster, because `Symbol` comparisons and hashing is faster.
2019-10-21 11:31:02 +11:00
ben
925e3042f6 Fix resolve_type_vars_with_obligations not resolving const inference
variables.
2019-10-20 09:16:52 +13:00
Tyler Mandry
bc85061203
Rollup merge of #65535 - eddyb:sliced-predicates, r=nikomatsakis
rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole struct.

While rebasing #59789 I noticed we can do this now. However, it doesn't help much without changing `inferred_outlives_of` to the same type, which I might try next.
2019-10-18 13:48:34 -07:00
Eduard-Mihai Burtescu
cd9e4441eb rustc: arena-allocate the slice in ty::GenericsPredicate, not the whole struct. 2019-10-18 03:14:57 +03:00
Mark Rousskov
dab3bd6cda Create lint store during plugin registration
Remove lint store from Session
2019-10-17 19:41:21 -04:00
bors
fa0f7d0080 Auto merge of #65495 - Centril:rollup-tguwjt5, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #65237 (Move debug_map assertions after check for err)
 - #65316 (make File::try_clone produce non-inheritable handles on Windows)
 - #65319 (InterpCx: make memory field public)
 - #65461 (Don't recommend ONCE_INIT in std::sync::Once)
 - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic)
 - #65475 (add example for type_name)
 - #65478 (fmt::Write is about string slices, not byte slices)
 - #65486 (doc: fix typo in OsStrExt and OsStringExt)

Failed merges:

r? @ghost
2019-10-17 18:53:10 +00:00
bors
b04338087e Auto merge of #64595 - Mark-Simulacrum:trivial-query, r=pnkfelix
Optimize dropck

This does two things: caches the `trivial_dropck` check by making it a query, and shifts around the implementation of the primary dropck itself to avoid allocating many small vectors.
2019-10-17 14:42:24 +00:00
Mazdak Farrokhzad
d420d719c4 move syntax::ext to new crate syntax_expand 2019-10-16 10:59:53 +02:00
Tyler Mandry
3182f73e8d
Rollup merge of #65444 - spastorino:as-ref-for-list, r=Mark-Simulacrum
Implement AsRef<[T]> for List<T>

r? @Mark-Simulacrum
2019-10-15 16:08:00 -07:00
Tyler Mandry
bbcf66a4a1
Rollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=eddyb
Return `false` from `needs_drop` for all zero-sized arrays.

Resolves #65348.

This changes the result of the `needs_drop` query from `true` to `false` for types such as `[Box<i32>; 0]`. I believe this change to be sound because a zero-sized array can never actually hold a value. This is an elegant way of resolving #65348 and #64945, but obviously it has much broader implications.
2019-10-15 16:07:53 -07:00
Tyler Mandry
a6ae7ae63f
Rollup merge of #65293 - tmandry:turbo-expander, r=matthewjasper
Optimize `try_expand_impl_trait_type`

A lot of time was being spent expanding some large `impl Future` types in fuchsia. This PR takes the number of types being visited in one expansion from >3 billion to about a thousand, and eliminates the compile time regression in https://github.com/rust-lang/rust/issues/65147 (in fact, compile times are better than they were before).

Thanks to @Mark-Simulacrum for helping identify the issue and to @matthewjasper for suggesting this change.

Fixes #65147.
r? @matthewjasper,@nikomatsakis
2019-10-15 16:07:47 -07:00
Tyler Mandry
af3d9e57e7
Rollup merge of #64623 - matthewjasper:underscore-imports, r=petrochenkov
Remove last uses of gensyms

Underscore bindings now use unique `SyntaxContext`s to avoid collisions. This was the last use of gensyms in the compiler, so this PR also removes them.

closes #49300
cc #60869

r? @petrochenkov
2019-10-15 16:07:41 -07:00
Matthew Jasper
4198df1f4b Remove some mentions of gensyms 2019-10-15 21:12:05 +01:00
Santiago Pastorino
fa3a4aeae5
Implement AsRef<[T]> for List<T> 2019-10-15 14:43:24 -03:00
Tyler Mandry
d2f87e384f
Rollup merge of #65170 - petrochenkov:cload, r=eddyb
rustc_metadata: Privatize private code and remove dead code

Also some minor cleanup and documentation improvements.

r? @eddyb
2019-10-14 17:52:32 -07:00
Tyler Mandry
802554f427 Only expand types that contain projections 2019-10-14 15:48:36 -07:00
Tyler Mandry
fe09bb518d Add expanded type cache to OpaqueTypeExpander 2019-10-14 15:48:36 -07:00
bors
e413dc36a8 Auto merge of #64987 - oli-obk:code_reuse_prevents_bugs, r=eddyb
Compute the layout of uninhabited structs

fixes #64506

r? @eddyb
2019-10-14 15:52:51 +00:00
Vadim Petrochenkov
f5baad2b5e rustc_metadata: Remove resolutions for extern crate items from CStore
Use a more traditional scheme with providing them as a resolver output
2019-10-14 18:05:45 +03:00
Dylan MacKenzie
061b906683 Return false from needs_drop for all zero-sized arrays 2019-10-13 14:39:57 -07:00
bors
29b6e0f0a1 Auto merge of #65182 - anp:reify-shim, r=eddyb
Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N)

Supercedes: https://github.com/rust-lang/rust/pull/65082
Depends on: https://github.com/rust-lang/rust/pull/65037
Tracking issue: https://github.com/rust-lang/rust/issues/47809
[RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)

steps taken:

* [x] add a `ReifyShim` that is similar to `VirtualShim` in behavior (see #54183)
* [x] add `ty::Instance::resolve_for_fn_ptr` (leave `ty::Instance::resolve_vtable` alone), migrate appropriate callers
* [x] `resolve_for_fn_ptr` returns the shim if calling a `#[track_caller]` function
2019-10-13 07:32:38 +00:00
Mark Rousskov
62fba55670 Make trivial dropck outlives a query
This allows caching some recursive types and getting to an error much
more quickly.
2019-10-12 08:30:58 -04:00
Tyler Mandry
e4eb54dae8
Rollup merge of #65263 - mbStavola:dedup-raw-item-fns, r=Centril
Deduplicate is_{freeze,copy,sized}_raw

Fixes #65259

Deduplicates `is_{freeze,copy,sized}_raw` by delegating to a new method which takes in a `LangItem`.
2019-10-11 15:09:51 -07:00
Tyler Mandry
ea0d155f2d
Rollup merge of #64986 - skinny121:fn-ptr-const-generics, r=varkor
Function pointers as const generic arguments

Makes function pointers as const generic arguments usable.

Fixes #62395

r? @varkor
2019-10-11 15:09:42 -07:00
Adam Perry
d92cef7473 resolve_for_fn_ptr checks that the instance is an Item before returning shim. 2019-10-11 07:44:01 -07:00
Ulrik Sverdrup
2f0c821be9 Change untagged_unions to not allow union fields with drop
Union fields may now never have a type with attached destructor.
This for example allows unions to use arbitrary field types only by
wrapping
them in ManuallyDrop.

The stable rule remains, that union fields must be Copy. We use the new
rule for the `untagged_union` feature.

See RFC 2514.

Note for ui tests:
We can't test move out through Box's deref-move since we can't
have a Box in a union anymore.
2019-10-11 10:43:54 +02:00
Adam Perry
407d1d5fd4 Instance::resolve_for_fn_ptr unconditionally resolves first.
Per review feedback.
2019-10-10 07:31:22 -07:00
Adam Perry
1cdd5d099d Improve docs for InstanceDef::ReifyShim. 2019-10-10 07:25:54 -07:00
Matt Stavola
ee081145ac
Qualify LangItem 2019-10-09 23:10:35 -07:00
Matt Stavola
af3f8dec59
Delegate is_{freeze,copy,sized}_raw to is_item_raw 2019-10-09 22:56:13 -07:00
Adam Perry
8a097f2619 Clarify comment, dedupe match arms in shim.rs.
Also add a missing terminal newline to a test.
2019-10-09 21:02:54 -07:00
Adam Perry
b8414c13ab Return ReifyShim from Instance::resolve_for_fn_ptr when track_caller present.
This ICEs in MIR currently, which I think is to be expected since none of the MIR plumbing is set up. I added a test which confirms that the shim is being used for reifying a track_caller function.
2019-10-09 20:19:09 -07:00
Adam Perry
0132738437 Reifying callers of Instance::resolve use resolve_for_fn_ptr. 2019-10-09 20:19:09 -07:00
Adam Perry
f5f67e78bb Add Instance::resolve_for_fn_ptr 2019-10-09 20:19:09 -07:00
Adam Perry
012116f860 Add InstanceDef::ReifyShim for track_caller functions. 2019-10-09 20:19:09 -07:00
ben
89cc0467a2 Pretty print raw pointers in consts as '{pointer}'. 2019-10-10 08:11:31 +13:00
Oliver Scherer
76fe6a41ba Refactor a nested if to a match 2019-10-09 19:12:49 +02:00
Mazdak Farrokhzad
3f2ae44ba4
Rollup merge of #65081 - Mark-Simulacrum:remove-profile-queries, r=michaelwoerister
Remove -Zprofile-queries

r? @michaelwoerister

Per [zulip thread](https://zulip-archive.rust-lang.org/131828tcompiler/57361RemoveZprofilequeries.html).
2019-10-08 23:31:20 +02:00
ben
9677cbe82e Refactor pretty print const to use a big match statement 2019-10-09 05:10:00 +13:00
ben
a59eb6d554 Pretty print function pointer const values. 2019-10-09 05:10:00 +13:00
ben
2afd277bc3 Fix calling function pointer const parameters. Also fixes inference of
function pointer const parameters.
2019-10-09 05:10:00 +13:00
Mazdak Farrokhzad
0d17de89ba
Rollup merge of #65176 - nnethercote:rm-query-macros, r=michaelwoerister
Remove query-related macros

The query system has a few macros that only have one or two call sites, and I find they hurt readability. This PR removes them.

r? @michaelwoerister
2019-10-08 15:45:32 +02:00
Mazdak Farrokhzad
f2dc3467f4
Rollup merge of #65162 - Mark-Simulacrum:no-cache-loading-map, r=michaelwoerister
Remove loaded_from_cache map from DepGraph

It's now unused, even with -Zquery-dep-graph

From https://github.com/rust-lang/rust/pull/63756/files#r316039379 -- it'll simplify that PR to get this landed separately so we can just remove some of the code that it touches.

r? @Zoxc or @michaelwoerister
2019-10-08 15:45:31 +02:00
bors
ec557aa818 Auto merge of #64949 - nnethercote:avoid-SmallVec-collect, r=zackmdavis
Avoid `SmallVec::collect`

We can get sizeable speed-ups by avoiding `SmallVec::collect` when the number of elements is small.
2019-10-08 08:08:21 +00:00
Mazdak Farrokhzad
f23c9f4565
Rollup merge of #65181 - nikomatsakis:lazy-norm-anon-const-push-1, r=varkor
fix bug in folding for constants

These was a bug in the folding for constants that caused it to overlook bound regions. This branch includes some other little things that I did while trying to track the bug down.

r? @oli-obk
2019-10-08 05:02:43 +02:00
Niko Matsakis
1dba4b0117 fix ICE from debug output by using kind_ty in dumping closure
Also, make `-Zverbose` dump all info about constants.
2019-10-07 10:59:46 -04:00
Niko Matsakis
bec0902535 avoid ICE when extracting closure-kind-ty from a canonicalized value
In such a case, the `Infer` is converted to a `Bound`
2019-10-07 10:59:13 -04:00
Niko Matsakis
0b58d9d124 correct bug in the "has escaping regions" visitor
Existing code could overlook types/substitutions that are
embedded in (e.g.) an unevaluated constant.
2019-10-07 10:58:37 -04:00
Niko Matsakis
25d04f83e3 make type-flags exhaustive
Didn't find any bugs here, but you really don't want these to fall out
of sync.
2019-10-07 10:57:44 -04:00