88962 Commits

Author SHA1 Message Date
Aaron Hill
b1a8da6e61
Improve error generation, fixup recursion limits 2019-01-03 21:58:57 -05:00
Aaron Hill
1f08280555
More tidy fixes 2019-01-03 21:58:57 -05:00
Aaron Hill
03cd934ba9
Ensure that we properly increment obligation depth 2019-01-03 21:58:21 -05:00
Aaron Hill
54fd8caddc
Remove extra recursion_depth tracking 2019-01-03 21:58:21 -05:00
Aaron Hill
c55c312c17
Fix tidy errors 2019-01-03 21:56:53 -05:00
Aaron Hill
6d54672acf
Fix stack overflow when finding blanket impls
Currently, SelectionContext tries to prevent stack overflow by keeping
track of the current recursion depth. However, this depth tracking is
only used when performing normal section (which includes confirmation).
No such tracking is performed for evaluate_obligation_recursively, which
can allow a stack overflow to occur.

To fix this, this commit tracks the current predicate evaluation depth.
This is done separately from the existing obligation depth tracking:
an obligation overflow can occur across multiple calls to 'select' (e.g.
when fulfilling a trait), while a predicate evaluation overflow can only
happen as a result of a deep recursive call stack.

Fixes #56701
2019-01-03 21:56:52 -05:00
Mazdak Farrokhzad
e75dab7f67 stabilize convert::identity 2019-01-04 01:42:31 +01:00
Ariel Ben-Yehuda
0b511b7bd2 implement a hack to make traitobject 0.1.0 compile 2019-01-04 01:50:35 +02:00
Ariel Ben-Yehuda
7eb444e4f1 Revert "add coherence future-compat warnings for marker-only trait objects"
This reverts commit 760639635facb6c9a0926ac9278bcba71880b0b3.
2019-01-04 01:18:34 +02:00
Ariel Ben-Yehuda
e030aa8015 Revert "fix stupid bug"
This reverts commit 6e4b2b3ae79770c7ccfcdbfc90dc34fe47ec5f09.
2019-01-04 00:34:53 +02:00
Ariel Ben-Yehuda
391a7ebd83 add comment to <List<ExistentialPredicates>>::principal 2019-01-04 00:34:53 +02:00
Ariel Ben-Yehuda
64857de2bd hack-fix to rustdoc 2019-01-04 00:34:53 +02:00
Ariel Ben-Yehuda
c2aa7485d2 add tests 2019-01-04 00:34:52 +02:00
Ariel Ben-Yehuda
4ab27b255c fix ppaux 2019-01-04 00:34:52 +02:00
Ariel Ben-Yehuda
571a15bd15 avoid giving a principal to marker-only trait objects
Fixes #33140.
2019-01-04 00:34:52 +02:00
Ariel Ben-Yehuda
3aa1503a61 add support for principal-less trait object types
should be a pure refactoring.
2019-01-04 00:34:52 +02:00
Matthew Jasper
65c1f54a06 Forbid impl Trait from referring to unnamable recursive types
There is no type T, such that `T = [T; 2]`, we should not allow this
to be circumvented by impl Trait.
2019-01-03 22:15:02 +00:00
Alex Crichton
ccbf28eae8 rustc: Fix regression where jemalloc isn't used
In #56986 the linkage of jemalloc to the compiler was switched from the
driver library to the rustc binary to ensure that only rustc itself uses
jemalloc. In doing so, however, it turns out jemalloc wasn't actually
linked in at all! None of the symbols were referenced so the static
library wasn't used. This means that jemalloc wasn't pulled in at all.

This commit performs a bit of a dance to reference jemalloc symbols,
attempting to pull it in despite LLVM's optimizations.

Closes #57115
2019-01-03 13:52:36 -08:00
Georg Semmler
ae5c092682
More test deduplication 2019-01-03 22:29:11 +01:00
Georg Semmler
2bc436e713
Add missing files 2019-01-03 22:27:12 +01:00
Georg Semmler
d6ffd88d21
Fix typo 2019-01-03 22:27:09 +01:00
Georg Semmler
464b4dcb2b
Unify tests
Implement compile tests as variants of existing tests
2019-01-03 22:27:06 +01:00
Georg Semmler
2888d5631c
Update some new tests to changed error messages 2019-01-03 22:27:03 +01:00
Georg Semmler
992712ef30
Fix failing compile tests 2019-01-03 22:27:00 +01:00
Georg Semmler
a31dd0a2f7
Directly check if input_ty is a type parameter and therefore a
uncoverd type
2019-01-03 22:26:57 +01:00
varkor
854ac40104
Update src/doc/unstable-book/src/language-features/re-rebalance-coherence.md
Co-Authored-By: weiznich <Georg_semmler_05@web.de>
2019-01-03 22:26:54 +01:00
Georg Semmler
1715be0e3c
Fix tidy 2019-01-03 22:26:51 +01:00
Georg Semmler
70645e79b6
Add some docs about the new feature to the unstable book 2019-01-03 22:26:47 +01:00
Georg Semmler
bcd7acfe04
Add some tests
This copies and adjusts the existing coherence tests to ensure that
they continue to work using the new implementation.
2019-01-03 22:26:44 +01:00
Georg Semmler
757d7ba9c9
Implement the re-rebalance coherence rfc 2019-01-03 22:26:40 +01:00
Eric Huss
57790b8524 Update cargo 2019-01-03 12:59:54 -08:00
Matthew Jasper
7ba17aa72f Display impl Sized correctly
It used to display as just `impl`
2019-01-03 20:49:01 +00:00
Wiktor Kuchta
190d139f3a Fix repeated word typos
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2019-01-03 21:33:37 +01:00
Alex Crichton
66f0e42b4e ci: Upgrade Travis to Xenial
In theory we shouldn't require trusty so long as docker continues to
work!
2019-01-03 12:22:37 -08:00
Wim Looman
d1a42ea8d0 Add discoverable function for converting Box<T> -> Pin<Box<T>> 2019-01-03 21:04:35 +01:00
Wim Looman
5e3a560299 Allow converting Box<T: !Sized> -> Pin<Box<T>> 2019-01-03 21:03:29 +01:00
Mendess2526
3fb42cfb7c const fn no longer comming soon on const docs 2019-01-03 19:23:25 +00:00
Andy Russell
e3fe0ee97b
use structured suggestion for method calls
Furthermore, don't suggest calling the method if it is part of a place
expression, as this is invalid syntax.
2019-01-03 13:42:52 -05:00
David Wood
49337938cb
Fix bug in associated constant type annotations.
This commit reverses the variance used when relating types from the type
annotation of an associated constant - this matches the behaviour of the
lexical borrow checker and fixes a bug whereby matching a `&'a str`
against a `&'static str` would produce an error.
2019-01-03 19:33:05 +01:00
bors
c0bbc3927e Auto merge of #55517 - nikomatsakis:universes, r=scalexm
Universes

This PR transitions the compiler to use **universes** instead of the **leak-check**. It is marked as [WIP] for a few reasons:

- The diagnostics at present are terrible =)
- This changes the behavior of coherence, regressing some things that used to compile

The goals of this PR at present are:

- To start getting some eyes on the code
- To do a crater run
- To see the full travis results (due to https://github.com/rust-lang/rust/issues/52452, I am not able to run the full test suite locally anymore at present)

The first few commits in the PR are changing how `evaluate` treats regions. We now track whether region comparisons occurred, reverting the "staticized" query approach that @arielb1 put in. The problem with "staticized" queries is that it relied on the leak-check to get higher-ranked things correct, and we are removing the leak-check in this PR series, so that caused problems.

You can see at the end a collection of test updates. Mostly we behave the same but with atrocious diagnostics, but there are a number of cases where we used to error and now no longer do, as well as single case where we used to **not** error but we now do (the coherence-subtyping change).

(Note: it would be possible to do a version of leak-check that propagates universe information and recover the old behavior. I am reluctant to do so because I'd like to leave us room to get more precise -- e.g., I want to eventually handle things like `exists<'a> { for<'b> { if ('a: 'b) { 'a: 'b } } }` which presently the leak-check cannot cope with etc. Also because it seems more consistent to me: most folks I've talked to expect the new behavior and are surprised to learn that binding sites were so significant before when it comes to coherence. One question is, though, to what extent are people relying on this in the wild?)
2019-01-03 17:18:15 +00:00
John Kåre Alsaker
75b2e143f1 Make CompileController thread-safe 2019-01-03 18:14:01 +01:00
Dan Robertson
917985e7fe
VaList::copy should not require a mutable ref
VaList::copy does not need to take a mutable reference. The va_copy
intrinsic takes a immutable reference.
2019-01-03 15:51:50 +00:00
Shotaro Yamada
069b0c4108 Cleanup
`for` loops are no longer closures.
2019-01-03 23:25:41 +09:00
Shotaro Yamada
6bae4a763d Fix unused_assignments false positive
Make `continue` jump to the loop condition's `LiveNode` instead of one
of the loop body.
2019-01-03 23:25:41 +09:00
bors
2442823ef5 Auto merge of #56507 - nikomatsakis:polonius-integrate, r=MatthewJasper
polonius tweaks

- bump polonius to 0.6.0
- fix 2-phase-borrow activations

r? @matthewjasper
2019-01-03 12:42:16 +00:00
Joseph Lyons
40658fdade Fixed the link to the ? operator 2019-01-03 00:20:31 -05:00
Mazdak Farrokhzad
61fb909559
Update src/liballoc/vec.rs
Add @centril's comment

Co-Authored-By: scottmcm <scottmcm@users.noreply.github.com>
2019-01-02 21:05:37 -08:00
bors
140936307e Auto merge of #57282 - matthewjasper:wellformed-return-ty, r=nikomatsakis
Wf-check the output type of a function in MIR-typeck

Closes #57265

cc @scalexm
2019-01-03 03:48:12 +00:00
Daniel Mueller
a944ecfa15
Fix 'be be' constructs
I noticed a duplicated "be" somewhere in the code. A search for it
manifested a couple more locations with the same problem. This change
removes one of the "be"s.
2019-01-02 18:06:49 -08:00
Ozaren
ea68b3ff3d update to reflect changes recommended by @shepmaster his review 2019-01-02 20:38:50 -05:00