Commit Graph

88136 Commits

Author SHA1 Message Date
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
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
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
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
Niko Matsakis
8e89184a7b rename type_moves_by_default to type_is_copy_modulo_regions 2019-01-02 17:35:06 -05:00
Niko Matsakis
4c8fd2e80a try to detect affected code and direct people to #56105 2019-01-02 17:35:06 -05:00
Niko Matsakis
2c17af0bf7 track if any region constraints involved placeholders 2019-01-02 17:35:06 -05:00
Niko Matsakis
13ea9b877c pacify the mercilous eddyb ;) 2019-01-02 17:35:06 -05:00
Niko Matsakis
c04563e1b0 add some comments about lifetimes etc 2019-01-02 17:35:06 -05:00
Niko Matsakis
1db7193162 address tmandry nits 2019-01-02 17:35:06 -05:00
Niko Matsakis
cf2f7cccb4 pacify the mercilous tidy 2019-01-02 17:35:06 -05:00
Niko Matsakis
bc4404c0b5 improve handling for subtype
Still not great, but good enough to land this PR.
2019-01-02 17:35:06 -05:00
Niko Matsakis
a24e04dff6 say "the lifetime" instead of "some lifetime" when it feels right
In particular, when we want to indicate that there is a connection
between the self type and the other types.
2019-01-02 17:35:06 -05:00
Niko Matsakis
7bc3f5585a apply the same logic to ConcreteFailure errors 2019-01-02 17:35:06 -05:00
Niko Matsakis
77924de4a6 refactor highlighting to take any RegionKind, making it more general 2019-01-02 17:35:06 -05:00
Niko Matsakis
6cbbee1dc7 apply the new placeholder errors even with just one placeholder 2019-01-02 17:35:06 -05:00
Niko Matsakis
0a61d682a1 introduce placeholder-placeholder errors for trait matching 2019-01-02 17:35:06 -05:00
Niko Matsakis
1597f2a0fc add the ability to highlight placeholders 2019-01-02 17:35:05 -05:00
Niko Matsakis
37b0b3e9a3 generalize region highlights into a struct 2019-01-02 17:35:05 -05:00
Niko Matsakis
6a6d2f4b3f dump out the exact state in error reporting debugs 2019-01-02 17:35:05 -05:00
Niko Matsakis
995192a472 make get_highlight_region_for_regionvid only affect re-vid
In NLL, ReVid is all there is, but I might want to repurpose.
2019-01-02 17:35:05 -05:00
Niko Matsakis
0b03b9bbcf remove outdated rustc_driver tests
they are subsumed by `hr-subtype/hr-subtype.rs` and other tests
2019-01-02 17:35:05 -05:00
Niko Matsakis
a2d917989c WIP other test changes 2019-01-02 17:35:05 -05:00
Niko Matsakis
c8e0a90dfc tests: cases where we now do the right thing but did not before
Fixes #33684
2019-01-02 17:35:05 -05:00
Niko Matsakis
d3c96ff152 tests: worse diagnostics, but basically same errors 2019-01-02 17:35:05 -05:00
Niko Matsakis
78705b5ec7 tests: move coherence-subtyping from run-pass to compile-fail
This is the pattern we no longer accept.
2019-01-02 17:35:05 -05:00
Niko Matsakis
652fd2efdf add tests exercising exists<'a> { forall<'b> { .. } } pattern
Amazingly, this scenario was not tested for trait matching.
2019-01-02 17:35:05 -05:00
Niko Matsakis
b68fad670b universe transition
Remove the leak-check and its associated machinery. Replace with
making the solver aware of universes.
2019-01-02 17:35:05 -05:00
Niko Matsakis
eba2ae526b WIP: wfcheck ability to detect 2019-01-02 17:35:05 -05:00
Niko Matsakis
904a0bde93 select.rs: unsizing coercion should use a subtype
When we coerce `dyn Foo` to `dyn Bar`, that is OK as long as `Foo` is
usable in all contexts where `Bar` is usable (hence using the source
must be a subtype of the target).

This is needed for the universe-based code to handle
`old-lub-glb-object`; that test used to work sort of by accident
before with the old code.
2019-01-02 17:35:05 -05:00
Niko Matsakis
4170829e53 introduce ability to detect region constraints from snapshot 2019-01-02 17:35:05 -05:00
Niko Matsakis
4b5f274f90 make evaluation track whether outlives relationships mattered
Previously, evaluation ignored outlives relationships. Since we using
evaluation to skip the "normal" trait selection (which enforces
outlives relationships) this led to incorrect results in some cases.
2019-01-02 17:35:05 -05:00
Niko Matsakis
79efed84a0 remove wrapper functions that had no purpose 2019-01-02 17:35:05 -05:00
Niko Matsakis
5f0fe8f093 remove commit_if_ok wrapper 2019-01-02 17:35:04 -05:00
Matthew Jasper
8ca83e915e Add missing 'static bound for the Machine trait 2019-01-02 21:28:08 +00:00
Alex Crichton
71fed3a8ab Don't package up libLLVM.so with libstd
It's only meant for rustc, so we should only install it once!
2019-01-02 13:07:26 -08:00
Matthew Jasper
5dfc5f205c Wf-check the output type of a function in MIR-typeck 2019-01-02 20:00:56 +00:00
Niko Matsakis
826fb1dbbb adopt polonius-engine 0.6.2
Also datafrog 2.0.1, which works around a rustdoc bug
2019-01-02 14:45:30 -05:00
Niko Matsakis
5efcff11a4 generate invalidations from 2-phase-borrow activations 2019-01-02 14:44:25 -05:00
Alex Crichton
c0662a033e Update the stdsimd submodule
Add a new cmpxchg16b intrinsics for x86_64!
2019-01-02 11:37:59 -08:00
Alex Crichton
fa4f014110 Remove now stray comment 2019-01-02 11:34:08 -08:00
Alex Crichton
82a1bb3314 Remove no longer working test 2019-01-02 11:34:04 -08:00
Alex Crichton
a175969b29 Avoid using open_global_now 2019-01-02 11:33:41 -08:00
Alex Crichton
ea7fef1ccf bootstrap: Link LLVM as a dylib with ThinLTO
When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334
2019-01-02 11:33:38 -08:00