]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRemove mentions of unstable sort_by_cached key from stable documentation
varkor [Mon, 26 Mar 2018 21:24:03 +0000 (22:24 +0100)]
Remove mentions of unstable sort_by_cached key from stable documentation

6 years agoAdd stability test for sort_by_cached_key
varkor [Mon, 19 Mar 2018 00:11:47 +0000 (00:11 +0000)]
Add stability test for sort_by_cached_key

6 years agoAdd lexicographic sorting benchmark
varkor [Sun, 18 Mar 2018 12:37:06 +0000 (12:37 +0000)]
Add lexicographic sorting benchmark

6 years agoCheck that the size optimisation is not redundant
varkor [Sun, 18 Mar 2018 11:11:17 +0000 (11:11 +0000)]
Check that the size optimisation is not redundant

6 years agoClarify time complexity
varkor [Sat, 17 Mar 2018 20:43:46 +0000 (20:43 +0000)]
Clarify time complexity

6 years agoImprove and fix documentation for sort_by_cached_key
varkor [Sat, 17 Mar 2018 20:18:08 +0000 (20:18 +0000)]
Improve and fix documentation for sort_by_cached_key

6 years agoFix use of unstable feature in test
varkor [Fri, 16 Mar 2018 16:35:27 +0000 (16:35 +0000)]
Fix use of unstable feature in test

6 years agoAdd sort_by_cached_key method
varkor [Fri, 16 Mar 2018 14:37:17 +0000 (14:37 +0000)]
Add sort_by_cached_key method

6 years agoIndex enumeration by minimally sized type
varkor [Fri, 2 Mar 2018 16:28:55 +0000 (16:28 +0000)]
Index enumeration by minimally sized type

6 years agoCull the quadratic
varkor [Fri, 2 Mar 2018 15:51:20 +0000 (15:51 +0000)]
Cull the quadratic

6 years agoUpdate documentation
varkor [Thu, 1 Mar 2018 16:07:58 +0000 (16:07 +0000)]
Update documentation

6 years agoAdd a test for sort_by_key
varkor [Thu, 1 Mar 2018 13:39:52 +0000 (13:39 +0000)]
Add a test for sort_by_key

6 years agoClarify behaviour of sort_unstable_by_key with respect to sort_by_key
varkor [Thu, 1 Mar 2018 12:22:11 +0000 (12:22 +0000)]
Clarify behaviour of sort_unstable_by_key with respect to sort_by_key

6 years agoUpdate documentation for sort_by_key
varkor [Thu, 1 Mar 2018 12:15:05 +0000 (12:15 +0000)]
Update documentation for sort_by_key

6 years agoCompute each key only one during slice::sort_by_key
varkor [Thu, 1 Mar 2018 10:46:06 +0000 (10:46 +0000)]
Compute each key only one during slice::sort_by_key

6 years agoAuto merge of #48138 - estebank:issue-45092, r=nikomatsakis
bors [Thu, 15 Mar 2018 13:16:09 +0000 (13:16 +0000)]
Auto merge of #48138 - estebank:issue-45092, r=nikomatsakis

Reword E0044 and message for `!Send` types

 - Reword E0044 help.
 - Change error message for types that don't implement `Send`

CC #45092, #46678, #24909, #33307.

6 years agoAuto merge of #48648 - snf:fallible_allocation, r=Kimundi
bors [Thu, 15 Mar 2018 08:18:58 +0000 (08:18 +0000)]
Auto merge of #48648 - snf:fallible_allocation, r=Kimundi

Fallible allocation

Implementing RFC#2116 [Fallible Allocation](https://github.com/rust-lang/rust/issues/48043) .
Work in progress. Initially adding @Gankro's try_reserve for Vec.

6 years agoAdd span label to E0044
Esteban Küber [Thu, 15 Mar 2018 01:10:25 +0000 (18:10 -0700)]
Add span label to E0044

6 years agoReview comment: remove mention of `move` closure
Esteban Küber [Sun, 25 Feb 2018 21:18:29 +0000 (13:18 -0800)]
Review comment: remove mention of `move` closure

6 years agoMake hint clearer, with the potential of being wrong
Esteban Küber [Mon, 19 Feb 2018 08:15:12 +0000 (00:15 -0800)]
Make hint clearer, with the potential of being wrong

6 years agoSuggest using `move` when trying to share `...::channel::{Receiver, Sender}`
Esteban Küber [Sun, 11 Feb 2018 21:39:32 +0000 (13:39 -0800)]
Suggest using `move` when trying to share `...::channel::{Receiver, Sender}`

Extend `rustc_on_unimplemented` to match on ADT without evaluating type
arguments.

6 years agoReword E0044 and message for `!Send` types
Esteban Küber [Sun, 11 Feb 2018 05:01:49 +0000 (21:01 -0800)]
Reword E0044 and message for `!Send` types

 - Reword E0044 help.
 - Change error message for types that don't implement `Send`

6 years agoAuto merge of #47630 - canndrew:exhaustive-patterns, r=nikomatsakis
bors [Wed, 14 Mar 2018 23:43:04 +0000 (23:43 +0000)]
Auto merge of #47630 - canndrew:exhaustive-patterns, r=nikomatsakis

Stabilise feature(never_type). Introduce feature(exhaustive_patterns)

This stabilizes `!`, removing the feature gate as well as the old defaulting-to-`()` behavior. The pattern exhaustiveness checks which were covered by `feature(never_type)` have been moved behind a new `feature(exhaustive_patterns)` gate.

6 years agoAuto merge of #49008 - kennytm:rollup, r=kennytm
bors [Wed, 14 Mar 2018 20:59:09 +0000 (20:59 +0000)]
Auto merge of #49008 - kennytm:rollup, r=kennytm

Rollup of 12 pull requests

- Successful merges: #48765, #48831, #48840, #48964, #48970, #48971, #48981, #48988, #48991, #48966, #48993, #48874
- Failed merges:

6 years agoAuto merge of #49014 - Bobo1239:master, r=alexcrichton
bors [Wed, 14 Mar 2018 18:18:49 +0000 (18:18 +0000)]
Auto merge of #49014 - Bobo1239:master, r=alexcrichton

Update RLS

r? @alexcrichton
Includes https://github.com/rust-lang-nursery/rls/pull/762 which should fix the build.

6 years agoRollup merge of #48874 - jcowgill:mips-features, r=sanxiyn
kennytm [Wed, 14 Mar 2018 15:31:04 +0000 (23:31 +0800)]
Rollup merge of #48874 - jcowgill:mips-features, r=sanxiyn

bump mipsel isa leval and enable fpxx

This PR:
* Bumps the default ISA level of the mipsel targets to `mips32r2`. The big endian mips targets are already built with `mips32r2`. This is the usual baseline for the MIPS ISA these days used by other projects, although it does drop support for the 4K processor (which was the only processor released with mips32 r1). Debian no longer supports pre-R2 processors. Using R2 also improves code generation in FPXX in certain circumstances.
* Enables the FPXX floating point ABI[1] on 32-bit hard-float targets by default. This ABI adds some extra restrictions to the existing ABI which allows code to run on the two main floating point modes found on MIPS (FR0 and FR1) and remains compatible with the FR32 ABI currently in use. All code within an executable (including all shared libraries) must be compiled with FPXX/FP64 to be able to use MSA on 32-bit MIPS.
* Enables the "nooddspreg" feature with FPXX. This feature is usually enabled whenever FPXX is. It also helps workaround some issues on Loongson processors. I'm hoping this will fix some test failures mentioned in #39013.
* Adds the `fp64` feature to the MIPS whitelist. This feature must be enabled to use MSA on 32-bit MIPS, otherwise LLVM will complain.

[1] See https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking

6 years agoRollup merge of #48993 - alexheretic:fix-48816, r=michaelwoerister
kennytm [Wed, 14 Mar 2018 15:29:57 +0000 (23:29 +0800)]
Rollup merge of #48993 - alexheretic:fix-48816, r=michaelwoerister

fix #48816 don't print help on indirect compiler ICE

https://github.com/rust-lang/rust/issues/48816#issuecomment-372817573

6 years agoRollup merge of #48966 - retep007:hir-fingerprint-optimization, r=michaelwoerister
kennytm [Wed, 14 Mar 2018 15:26:28 +0000 (23:26 +0800)]
Rollup merge of #48966 - retep007:hir-fingerprint-optimization, r=michaelwoerister

Speed up SVH computation by using Fingerprint::combine()

Fix #47297

6 years agoRollup merge of #48991 - jsgf:remap-path-prefix, r=estebank
kennytm [Wed, 14 Mar 2018 08:29:54 +0000 (16:29 +0800)]
Rollup merge of #48991 - jsgf:remap-path-prefix, r=estebank

Clarify usage message for --remap-path-prefix.

6 years agoRollup merge of #48988 - bobtwinkles:add_48070_test, r=nikomatsakis
kennytm [Wed, 14 Mar 2018 08:29:53 +0000 (16:29 +0800)]
Rollup merge of #48988 - bobtwinkles:add_48070_test, r=nikomatsakis

Add a test for #48070

Resolves #48070.
The bug itself was fixed by #48770, but that PR didn't add a test for it.

r? @nikomatsakis

6 years agoRollup merge of #48981 - alexcrichton:lld-no-at-file, r=michaelwoerister
kennytm [Wed, 14 Mar 2018 08:29:51 +0000 (16:29 +0800)]
Rollup merge of #48981 - alexcrichton:lld-no-at-file, r=michaelwoerister

rustc: Don't invoke `lld` with an `@`-file

Looks like LLD doesn't support this yet, so always try to use the OS before we
fall back to using `@`

cc https://github.com/rust-lang/rust/issues/48948

6 years agoRollup merge of #48971 - mark-i-m:fix_readmes, r=nikomatsakis
kennytm [Wed, 14 Mar 2018 08:29:49 +0000 (16:29 +0800)]
Rollup merge of #48971 - mark-i-m:fix_readmes, r=nikomatsakis

Move librustc_typeck READMEs to rustc guide

cc https://github.com/rust-lang-nursery/rustc-guide/issues/2 and #48478

Don't merge this before https://github.com/rust-lang-nursery/rustc-guide/pull/85

r? @nikomatsakis

6 years agoRollup merge of #48970 - GuillaumeGomez:doc-examples, r=QuietMisdreavus
kennytm [Wed, 14 Mar 2018 08:29:48 +0000 (16:29 +0800)]
Rollup merge of #48970 - GuillaumeGomez:doc-examples, r=QuietMisdreavus

Add missing examples

r? @QuietMisdreavus

6 years agoRollup merge of #48964 - QuietMisdreavus:picket-fence, r=GuillaumeGomez
kennytm [Wed, 14 Mar 2018 08:29:47 +0000 (16:29 +0800)]
Rollup merge of #48964 - QuietMisdreavus:picket-fence, r=GuillaumeGomez

tweak code fences in the rustdoc book

You can stack backticks to create "big code fences" if you're documenting some markdown and need to have code fences inside your code fences. This is especially important in this spot in the Rustdoc Book, because we're showing that using no language specifier on your code blocks is interpreted as using `rust`, but the code blocks here lose their code fences!

`````````markdown
``````markdown
Just showing some recursion, nbd.

```rust
println!("sup");
```
``````

(If you have edit powers in the rust-lang/rust repo, hit the edit button to view the source and see even more recursion :P)
`````````

6 years agoRollup merge of #48840 - varkor:idxset-cleanup, r=pnkfelix
kennytm [Wed, 14 Mar 2018 08:29:45 +0000 (16:29 +0800)]
Rollup merge of #48840 - varkor:idxset-cleanup, r=pnkfelix

Remove some unnecessary IdxSet methods

This replaces `IdxSet:: reset_to_empty` with `IdxSet:: clear`, and `IdxSet::elems`/`IdxSet::each_bit` with `IdxSet::iter`. Based on some [comments on #rustc](https://botbot.me/mozilla/rustc/2018-01-23/?msg=96063396).

r? @pnkfelix

6 years agoRollup merge of #48831 - GuillaumeGomez:fix-theme-blink, r=QuietMisdreavus
kennytm [Wed, 14 Mar 2018 08:29:43 +0000 (16:29 +0800)]
Rollup merge of #48831 - GuillaumeGomez:fix-theme-blink, r=QuietMisdreavus

Fix blink when main theme is selected

r? @QuietMisdreavus

6 years agoRollup merge of #48765 - Phlosioneer:10234-wall-help-message, r=estebank
kennytm [Wed, 14 Mar 2018 08:29:42 +0000 (16:29 +0800)]
Rollup merge of #48765 - Phlosioneer:10234-wall-help-message, r=estebank

Add info message for -Wall command

Users coming from other languages (namely C and C++) often expect
to use a -Wall flag. Rustc doesn't support that, and previously it
simply printed that it didn't recognize the "all" lint.

This change makes rustc print out a help message, explaining:
- Why there is no -Wall flag
- How to view all the available warnings
- Point out that the most commonly used warning is -Wunused
- Instead of using a command-line flag, the user should consider
  a !#[warn(unused)] directive in the root of their crate.

I tried to keep the language consistent with the other usage help. Comment if I should change anything.

closes #10234, if accepted.

6 years agoUpdate RLS
Boris-Chengbiao Zhou [Wed, 14 Mar 2018 14:03:42 +0000 (15:03 +0100)]
Update RLS

6 years agoAuto merge of #48864 - oli-obk:miri_incremental_regression, r=eddyb
bors [Wed, 14 Mar 2018 15:39:59 +0000 (15:39 +0000)]
Auto merge of #48864 - oli-obk:miri_incremental_regression, r=eddyb

Cache const eval queries

fixes #48846 (I think, still running more perf tests, but tuple-stress stops recomputing any constants)

r? @michaelwoerister

6 years agoAuto merge of #48811 - Zoxc:syntax-globals, r=michaelwoerister
bors [Wed, 14 Mar 2018 12:44:17 +0000 (12:44 +0000)]
Auto merge of #48811 - Zoxc:syntax-globals, r=michaelwoerister

Remove syntax and syntax_pos thread locals

This moves `syntax` and `syntax_pos` globals into a struct which are pointed to by thread locals. Most of the changes here are indentation changes in test. It would probably be a good idea to ignore whitespace changes while reviewing. Some indentation is unchanged to avoid merge conflicts.

r? @michaelwoerister

6 years agoRemove syntax and syntax_pos thread locals
John Kåre Alsaker [Wed, 7 Mar 2018 01:44:10 +0000 (02:44 +0100)]
Remove syntax and syntax_pos thread locals

6 years agotry_reserve: updating message for feature-gate-try_reserve.stderr
snf [Wed, 14 Mar 2018 10:48:04 +0000 (03:48 -0700)]
try_reserve: updating message for feature-gate-try_reserve.stderr

6 years agotry_reserve: disabling tests for asmjs, blocked by #48968
snf [Tue, 13 Mar 2018 10:41:45 +0000 (03:41 -0700)]
try_reserve: disabling tests for asmjs, blocked by #48968

6 years agoimplementing fallible allocation API (try_reserve) for Vec, String and HashMap
snf [Thu, 8 Mar 2018 14:36:43 +0000 (14:36 +0000)]
implementing fallible allocation API (try_reserve) for Vec, String and HashMap

6 years agoAuto merge of #48859 - bdrewery:update-libc, r=alexcrichton
bors [Wed, 14 Mar 2018 08:20:23 +0000 (08:20 +0000)]
Auto merge of #48859 - bdrewery:update-libc, r=alexcrichton

Update libc to 0.2.39

CC #42681

r? @alexcrichton

6 years agofix ui test error again
Andrew Cann [Wed, 14 Mar 2018 05:31:02 +0000 (13:31 +0800)]
fix ui test error again

6 years agoFixes after rebase
Andrew Cann [Wed, 14 Mar 2018 04:36:58 +0000 (12:36 +0800)]
Fixes after rebase

6 years agoregister removed lints
Andrew Cann [Wed, 14 Mar 2018 04:04:29 +0000 (12:04 +0800)]
register removed lints

6 years agoFix fallback note
Andrew Cann [Wed, 14 Mar 2018 04:03:33 +0000 (12:03 +0800)]
Fix fallback note

6 years agoAdd note about fallback to `!: !Trait` error
Andrew Cann [Mon, 12 Mar 2018 04:15:06 +0000 (12:15 +0800)]
Add note about fallback to `!: !Trait` error

6 years agoreally actually fix ui test error for real
Andrew Cann [Sat, 3 Mar 2018 05:12:50 +0000 (13:12 +0800)]
really actually fix ui test error for real

6 years agoreally fix ui test errors for real
Andrew Cann [Thu, 1 Mar 2018 05:54:20 +0000 (13:54 +0800)]
really fix ui test errors for real

6 years agoreally fix ui test errors
Andrew Cann [Thu, 1 Mar 2018 03:41:38 +0000 (11:41 +0800)]
really fix ui test errors

6 years agochange never_type stabilisation version
Andrew Cann [Wed, 28 Feb 2018 17:41:10 +0000 (01:41 +0800)]
change never_type stabilisation version

6 years agoFix ui test errors
Andrew Cann [Wed, 28 Feb 2018 17:26:51 +0000 (01:26 +0800)]
Fix ui test errors

6 years agoMake coerce_never lint an error
Andrew Cann [Thu, 1 Feb 2018 07:23:04 +0000 (15:23 +0800)]
Make coerce_never lint an error

Remove the coerce_never lint and make the behaviour an error.

6 years agoFix version number
Andrew Cann [Sun, 21 Jan 2018 10:30:04 +0000 (18:30 +0800)]
Fix version number

6 years agostabilise feature(never_type)
Andrew Cann [Sun, 21 Jan 2018 08:44:41 +0000 (16:44 +0800)]
stabilise feature(never_type)

Replace feature(never_type) with feature(exhaustive_patterns).
feature(exhaustive_patterns) only covers the pattern-exhaustives checks
that used to be covered by feature(never_type)

6 years agoremove defaulting to unit
Andrew Cann [Sun, 21 Jan 2018 05:33:21 +0000 (13:33 +0800)]
remove defaulting to unit

Types will no longer default to `()`, instead always defaulting to `!`.
This disables the associated warning and removes the flag from TyTuple

6 years agoAuto merge of #48684 - GuillaumeGomez:put-back-ui-json-check, r=petrochenkov
bors [Wed, 14 Mar 2018 01:40:42 +0000 (01:40 +0000)]
Auto merge of #48684 - GuillaumeGomez:put-back-ui-json-check, r=petrochenkov

Put back ui json check

r? @petrochenkov

6 years agoupdate tests
Guillaume Gomez [Sat, 3 Mar 2018 14:59:40 +0000 (15:59 +0100)]
update tests

6 years agotest for putting back check on json
Guillaume Gomez [Wed, 28 Feb 2018 15:17:44 +0000 (16:17 +0100)]
test for putting back check on json

6 years agoSpeed up SVH computation by using Fingerprint::combine()
Peter Hrvola [Fri, 23 Feb 2018 19:18:38 +0000 (20:18 +0100)]
Speed up SVH computation by using Fingerprint::combine()

Fix #47297

r? @michaelwoerister

6 years agofix #48816 don't print help on indirect compiler ICE
Alex Butler [Tue, 13 Mar 2018 21:03:22 +0000 (21:03 +0000)]
fix #48816 don't print help on indirect compiler ICE

6 years agoClarify usage message for --remap-path-prefix.
Jeremy Fitzhardinge [Tue, 13 Mar 2018 20:26:07 +0000 (13:26 -0700)]
Clarify usage message for --remap-path-prefix.

6 years agoAuto merge of #48735 - 1011X:master, r=alexcrichton
bors [Tue, 13 Mar 2018 19:50:13 +0000 (19:50 +0000)]
Auto merge of #48735 - 1011X:master, r=alexcrichton

Move ascii::escape_default to libcore

As requested in #46409, the `ascii::escape_default` method has been added to the core library. All I did was copy over the `std::ascii` module file, remove the (redundant) `AsciiExt` trait, and change some of the documentation to match. None of the tests were changed.

I wasn't sure how to handle the annotations. For `EscapeDefault` and `escape_default()`, I changed them to `#[unstable(feature = "core_ascii", issue = "46409")]`. Is that alright? Or should I leave them as they were?

6 years agoMove 48070 test to ui
bobtwinkles [Tue, 13 Mar 2018 18:52:11 +0000 (14:52 -0400)]
Move 48070 test to ui

6 years agoAdds a test for #48070
bobtwinkles [Tue, 13 Mar 2018 18:21:51 +0000 (14:21 -0400)]
Adds a test for #48070

Resolves #48070.
The bug itself was fixed by #48770, but that PR didn't add a test for it.

6 years agoAuto merge of #48411 - nikomatsakis:chalkify-canonical-query-mir, r=eddyb
bors [Tue, 13 Mar 2018 15:24:45 +0000 (15:24 +0000)]
Auto merge of #48411 - nikomatsakis:chalkify-canonical-query-mir, r=eddyb

introduce canonical queries, use for normalization and dropck-outlives

This branch adds in the concept of a **canonicalized trait query** and uses it for three specific operations:

- `infcx.at(cause, param_env).normalize(type_foldable)`
    - normalizes all associated types in `type_foldable`
- `tcx.normalize_erasing_regions(param_env, type_foldable)`
    - like normalize, but erases regions first and in the result; this leads to better caching
- `infcx.at(cause, param_env).dropck_outlives(ty)`
    - produces the set of types that must be live when a value of type `ty` is dropped
    - used from dropck but also NLL outlives

This is a kind of "first step" towards a more Chalk-ified approach. It leads to a **big** speedup for NLL, which is basically dominated by the dropck-outlives computation. Here are some timing measurements for the `syn` crate (pre-branch measurements coming soon):

| Commit | NLL disabled | NLL enabled |
| ------- | --- | --- |
| Before my branch | 5.43s | 8.99s |
| After my branch | 5.36s | 7.25s |

(Note that NLL enabled still does *all the work* that NLL disabled does, so this is not really a way to compare the performance of NLL versus the AST-based borrow checker directly.) Since this affects all codepaths, I'd like to do a full perf run before we land anything.

Also, this is not the "final point" for canonicalization etc. I think canonicalization can be made substantially faster, for one thing. But it seems like a reasonable starting point for a branch that's gotten a bit larger than I would have liked.

**Commit convention:** First of all, this entire branch ought to be a "pure refactoring", I believe, not changing anything about external behavior. Second, I've tagged the most important commits with `[VIC]` (very important commit), so you can scan for those. =)

r? @eddyb

6 years agoadd "text" sections for things that seem likely to be a problem
Niko Matsakis [Sun, 11 Mar 2018 11:13:14 +0000 (07:13 -0400)]
add "text" sections for things that seem likely to be a problem

6 years agoremove dead code
Niko Matsakis [Sun, 11 Mar 2018 11:09:06 +0000 (07:09 -0400)]
remove dead code

6 years agoreplace inline docs with references to rustc-guide
Niko Matsakis [Sun, 11 Mar 2018 11:08:52 +0000 (07:08 -0400)]
replace inline docs with references to rustc-guide

6 years agoadd a debug assertion that only outlives-oblig. result from norm.
Niko Matsakis [Fri, 9 Mar 2018 21:44:20 +0000 (16:44 -0500)]
add a debug assertion that only outlives-oblig. result from norm.

6 years ago`trans_apply_param_substs` => `subst_and_normalize_erasing_regions`
Niko Matsakis [Fri, 9 Mar 2018 17:53:17 +0000 (12:53 -0500)]
`trans_apply_param_substs` => `subst_and_normalize_erasing_regions`

Consolidate `trans_apply_param_substs` and
`trans_apply_param_substs_env`. Also remove `trans_impl_self_ty`

6 years agoshort-circuit work when instantiating query responses
Niko Matsakis [Wed, 7 Mar 2018 19:08:21 +0000 (14:08 -0500)]
short-circuit work when instantiating query responses

Also, perform substitution in smaller parts.

6 years agoshort-circuit `dropck_outlives` for simple cases
Niko Matsakis [Wed, 7 Mar 2018 18:34:48 +0000 (13:34 -0500)]
short-circuit `dropck_outlives` for simple cases

6 years agoadd regression tests for various MIR bugs that get fixed
Niko Matsakis [Tue, 27 Feb 2018 21:14:41 +0000 (16:14 -0500)]
add regression tests for various MIR bugs that get fixed

Fixes #31567
Fixes #47470
Fixes #48132
Fixes #48179

6 years agoadd some debug output
Niko Matsakis [Mon, 26 Feb 2018 16:14:16 +0000 (11:14 -0500)]
add some debug output

6 years agomove `drain_fulfillment_cx_or_panic` to be private to traits::trans
Niko Matsakis [Tue, 13 Feb 2018 14:15:01 +0000 (09:15 -0500)]
move `drain_fulfillment_cx_or_panic` to be private to traits::trans

6 years agotransition various normalization functions to the new methods
Niko Matsakis [Sat, 3 Mar 2018 13:23:28 +0000 (08:23 -0500)]
transition various normalization functions to the new methods

In particular:

- `fully_normalize_monormophic_ty` => `normalize_erasing_regions`
- `normalize_associated_type_in_env` => `normalize_erasing_regions`
- `fully_normalize_associated_types_in` => `normalize_erasing_regions`
- `erase_late_bound_regions_and_normalize` => `normalize_erasing_late_bound_regions`

6 years agointroduce `tcx.normalize_erasing_regions(..)` operaton [VIC]
Niko Matsakis [Wed, 21 Feb 2018 16:24:13 +0000 (11:24 -0500)]
introduce `tcx.normalize_erasing_regions(..)` operaton [VIC]

6 years agointroduce `infcx.at(..).dropck_outlives(..)` operaton [VIC]
Niko Matsakis [Wed, 21 Feb 2018 15:55:16 +0000 (10:55 -0500)]
introduce `infcx.at(..).dropck_outlives(..)` operaton [VIC]

Backed by a canonicalized query. This computes all the types/regions that need
to be live when the destructor runs (i.e., that the dtor may access).

6 years agointroduce `infcx.at(..).normalize(..)` operation [VIC]
Niko Matsakis [Sun, 25 Feb 2018 15:58:54 +0000 (10:58 -0500)]
introduce `infcx.at(..).normalize(..)` operation [VIC]

It is backed by the new `normalize_projection_ty` query, which uses
canonicalization.

6 years agoReuse the query caching infrastructure for const eval
Oliver Schneider [Tue, 13 Mar 2018 15:21:54 +0000 (16:21 +0100)]
Reuse the query caching infrastructure for const eval

6 years agoin `Foo(X)` dep-nodes, allow X to be a `ty` not a `tt`
Niko Matsakis [Fri, 23 Feb 2018 20:30:27 +0000 (15:30 -0500)]
in `Foo(X)` dep-nodes, allow X to be a `ty` not a `tt`

Before, the identifier `X` was also used when generating a pattern
to match against the dep-node. So `Foo(DefId)` would generate a match
pattern like:

    match foo {
        Foo(DefId) => ...
    }

This does not scale to more general types like `&'tcx
Ty<'tcx>`. Therefore, we now require *exactly one* argument (the macro
was internally tupling anyway, and no actual nodes use more than one
argument), and then we can generate a fixed pattern like:

    match foo {
        Foo(arg) => ...
    }

Huzzah. (Also, hygiene is nice.)

6 years agoadd `canonicalize` method to `InferCtxt` [VIC]
Niko Matsakis [Fri, 9 Feb 2018 15:39:36 +0000 (10:39 -0500)]
add `canonicalize` method to `InferCtxt` [VIC]

6 years agochange `ParamEnv::and` to sometimes keep the environment [VIC]
Niko Matsakis [Tue, 20 Feb 2018 15:37:35 +0000 (10:37 -0500)]
change `ParamEnv::and` to sometimes keep the environment [VIC]

In general, we've been moving towards a semantics where you can have
contradictory where-clauses, and we try to honor them.  There are
already existing run-pass tests where we take that philosophy as
well (e.g., `compile-fail/issue-36839.rs`). The current behavior of
`and`, where it strips the environment, breaks that code.

6 years agomove ParamEnv methods from `ty/util` to `ty/mod`
Niko Matsakis [Wed, 14 Feb 2018 10:08:02 +0000 (05:08 -0500)]
move ParamEnv methods from `ty/util` to `ty/mod`

6 years agorefactor `ParamEnv::empty(Reveal)` into two distinct methods
Niko Matsakis [Sat, 10 Feb 2018 18:18:02 +0000 (13:18 -0500)]
refactor `ParamEnv::empty(Reveal)` into two distinct methods

- `ParamEnv::empty()` -- does not reveal all, good for typeck
- `ParamEnv::reveal_all()` -- does, good for trans
- `param_env.with_reveal_all()` -- converts an existing parameter environment

6 years agoadd handy helper for Cell<usize>, used for perf stats
Niko Matsakis [Tue, 20 Feb 2018 15:36:29 +0000 (10:36 -0500)]
add handy helper for Cell<usize>, used for perf stats

6 years agorandom reformatting
Niko Matsakis [Wed, 21 Feb 2018 09:16:25 +0000 (04:16 -0500)]
random reformatting

6 years agocomment the purpose of `TransNormalize`
Niko Matsakis [Fri, 9 Feb 2018 15:43:36 +0000 (10:43 -0500)]
comment the purpose of `TransNormalize`

6 years agomake regions "traceable" so you can do `infcx.at(..).eq(r1, r2)`
Niko Matsakis [Fri, 9 Feb 2018 15:43:15 +0000 (10:43 -0500)]
make regions "traceable" so you can do `infcx.at(..).eq(r1, r2)`

6 years agofix typo in comment
Niko Matsakis [Fri, 9 Feb 2018 16:24:18 +0000 (11:24 -0500)]
fix typo in comment

6 years agoadd `TypeRelation` and `Lift` impls for `Kind`
Niko Matsakis [Fri, 9 Feb 2018 15:39:46 +0000 (10:39 -0500)]
add `TypeRelation` and `Lift` impls for `Kind`

6 years agoimprove TypeFoldable/Lift macros and make a bunch of stuff use them
Niko Matsakis [Fri, 9 Feb 2018 15:34:23 +0000 (10:34 -0500)]
improve TypeFoldable/Lift macros and make a bunch of stuff use them

Improvements:

- Use Clone not Copy for the "simple cases"
- Separate TypeFoldable and Lift for the "simple cases"
- Support generics type parameters
- Support named fields in enum variants
- etc

6 years agorequire `Lifted` types to outlive `'tcx`
Niko Matsakis [Wed, 14 Feb 2018 21:00:07 +0000 (16:00 -0500)]
require `Lifted` types to outlive `'tcx`

6 years agoCache const eval queries
Oliver Schneider [Fri, 9 Mar 2018 06:09:24 +0000 (07:09 +0100)]
Cache const eval queries

6 years agorustc: Don't invoke `lld` with an `@`-file
Alex Crichton [Tue, 13 Mar 2018 14:54:03 +0000 (07:54 -0700)]
rustc: Don't invoke `lld` with an `@`-file

Looks like LLD doesn't support this yet, so always try to use the OS before we
fall back to using `@`

6 years agoAuto merge of #48958 - alexcrichton:update-rls-rustc, r=sfackler
bors [Tue, 13 Mar 2018 09:18:12 +0000 (09:18 +0000)]
Auto merge of #48958 - alexcrichton:update-rls-rustc, r=sfackler

Update the rls-rustc package

Should hopefully fix compiling the rls!