Niko Matsakis
1336b8e8c7
integrate trait aliases into def-paths / metadata
...
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2019-01-10 17:04:19 -05:00
bors
2fba17fc97
Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakis
...
Add support for trait-objects without a principal
The hard-error version of #56481 - should be merged after we do something about the `traitobject` crate.
Fixes #33140 .
Fixes #57057 .
r? @nikomatsakis
2019-01-05 03:36:31 +00:00
Ariel Ben-Yehuda
7eb444e4f1
Revert "add coherence future-compat warnings for marker-only trait objects"
...
This reverts commit 760639635f
.
2019-01-04 01:18:34 +02:00
Oliver Scherer
b903cb9d60
Move the Unevaluated
constant arm upwards in the type structure
2019-01-01 20:05:02 +01:00
David Wood
28fd1b04e5
Stop well-formedness checking unreachable code.
...
This commit stops well-formedness checking applying to unreachable code
and therefore stops some of the ICEs that the intended solution taken by
this PR causes.
By disabling these checks, we can land the other fixes and larger
refactors that this PR includes.
2018-12-30 14:30:59 +01:00
David Wood
f2532012dd
Always check well-formedness.
...
This commit uses the map introduced by the previous commit to ensure
that types are always checked for well-formedness by the NLL type check.
Previously, without the map introduced by the previous commit, types
would not be checked for well-formedness if the `AscribeUserType`
statement that would trigger that check was removed as unreachable code.
2018-12-30 14:25:25 +01:00
David Wood
24a7a010d1
Refactor UserTypeAnnotation
.
...
This commit refactors the `UserTypeAnnotation` type to be referred to by
an index within `UserTypeProjection`. `UserTypeAnnotation` is instead
kept in an `IndexVec` within the `Mir` struct.
Further, instead of `UserTypeAnnotation` containing canonicalized types,
it now contains normal types and the entire `UserTypeAnnotation` is
canonicalized. To support this, the type was moved from the `rustc::mir`
module to `rustc::ty` module.
2018-12-30 14:25:20 +01:00
scalexm
3790f08a42
Fix tcx.environment
for inherent impls
2018-12-27 19:21:16 +01:00
scalexm
8e2bdaacac
Add wf_clause_for_fn_def
2018-12-27 19:21:16 +01:00
scalexm
26e0ea8148
Use TraitEngine
in enter_canonical_trait_query
2018-12-27 19:21:16 +01:00
scalexm
da9467d147
Handle sub-typing in chalk-engine
2018-12-27 19:21:16 +01:00
scalexm
ba6314a0d6
Integrate chalk engine
2018-12-27 19:21:16 +01:00
scalexm
ea4187a842
Fix binding levels in implied bounds rules
2018-12-27 19:21:16 +01:00
scalexm
e5992e7ae9
Fix Sized
requirement for empty tuples in program_clauses
2018-12-27 19:21:16 +01:00
scalexm
dfcad82509
Add builtin impls for Sized
in chalk_context::program_clauses
2018-12-27 19:21:16 +01:00
scalexm
6f488b945e
Rename functions giving WF clauses for builtin types
2018-12-27 19:21:15 +01:00
scalexm
7b8da7908f
Add utilities for creating generic types
2018-12-27 19:21:15 +01:00
scalexm
ec7362442c
Return an instantiated environment instead of a generic one
2018-12-27 19:21:15 +01:00
scalexm
37ef0c38b7
Fix visit_ex_clause_with
...
The sub-visits were incorrectly combined with an `&&` instead of
an `||`.
2018-12-27 19:21:15 +01:00
scalexm
69007bd660
Implement "lifetime juggling" methods from chalk integration trait
...
Fixes #55097 .
2018-12-27 19:21:15 +01:00
scalexm
9b87f590dc
Implement is_coinductive
...
Fixes #55096 .
2018-12-27 19:21:15 +01:00
Mark Rousskov
2a663555dd
Remove licenses
2018-12-25 21:08:33 -07:00
Ariel Ben-Yehuda
760639635f
add coherence future-compat warnings for marker-only trait objects
...
The future-compat warnings break code that assumes that `dyn Send + Sync !=
dyn Sync + Send`, and are the first step in making them equal. cc #33140 .
It should be possible to revert this commit when we're done with the
warnings.
2018-12-14 19:14:22 +02:00
Nicholas Nethercote
ecf6cd4b3c
Upgrade smallvec
to 0.6.7 and use the new may_dangle
feature.
2018-12-10 09:31:27 +11:00
Alexander Regueiro
ee89c088b0
Various minor/cosmetic improvements to code
2018-12-07 23:53:34 +00:00
John Kåre Alsaker
a70babed03
Use a function to access the Hir map to be able to turn it into a query later
2018-12-06 17:24:36 +01:00
scalexm
b2b82f790b
Implement AggregateOps
...
`make_solution` does not return any guidance for now
2018-11-29 21:57:40 +01:00
scalexm
0169dc3f36
Implement ResolventOps
2018-11-29 21:57:40 +01:00
scalexm
3b2cfc510b
Handle inference variables in nll_relate
and use it for chalk
2018-11-29 21:57:34 +01:00
scalexm
c0f98e8390
Fix ChalkInferenceContext::into_hh_goal
2018-11-24 01:24:40 +01:00
scalexm
5b2baa8336
Implement some instantiate / canonical routines
2018-11-24 01:24:40 +01:00
scalexm
95861b1590
Move BoundTy
debruijn index to the TyKind
enum variant
2018-11-24 01:24:40 +01:00
scalexm
05995a8522
Introduce TyKind::Placeholder
variant
2018-11-24 01:24:40 +01:00
Pietro Albini
97d0d8964e
Rollup merge of #55778 - nnethercote:LrcPreds, r=eddyb
...
Wrap some query results in `Lrc`.
So that the frequent clones in `try_get` are cheaper.
2018-11-15 11:04:36 +01:00
Nicholas Nethercote
98dab3335f
Wrap some query results in Lrc
.
...
So that the frequent clones in `try_get` are cheaper.
Fixes #54274 .
2018-11-14 12:31:27 +11:00
csmoe
e853d6c5b6
Implement ProjectionEq-Normalize
2018-11-13 20:33:21 +01:00
scalexm
afa884c03a
Instantiate all bound vars existentially
2018-11-13 12:28:43 +01:00
scalexm
79b6c41bc2
Use a dummy outlives requirement for where Type:,
(see #53696 )
...
A `WF(Type)` predicate was used previously, which did not play
well with implied bounds in chalk.
2018-11-13 12:28:43 +01:00
scalexm
239df7be37
Bypass ppaux for Outlives
predicates
2018-11-13 12:28:43 +01:00
scalexm
3510805f7e
Provide program clauses for builtin types
2018-11-13 12:28:43 +01:00
scalexm
79ba84fa79
Adjust documentation
2018-11-13 12:28:43 +01:00
scalexm
eacebf24b0
Pretty print quantified goals and clauses
2018-11-13 12:28:43 +01:00
scalexm
64aac8d4c1
Replace type params with bound vars in rustc_traits::lowering
2018-11-13 12:28:43 +01:00
Pietro Albini
f0a6e3a583
Rollup merge of #55745 - nnethercote:outlives_components-SmallVec, r=matthewjasper
...
Convert `outlives_components`' return value to a `SmallVec` outparam.
This avoids some allocations, reducing instruction counts by 1% on a
couple of benchmarks.
2018-11-11 00:21:12 +01:00
bors
4cd3294a1d
Auto merge of #55637 - pnkfelix:issue-55552-dont-attempt-to-ascribe-projections-out-of-a-ty-var, r=nikomatsakis
...
Do not attempt to ascribe projections out of a ty var
If we encounter `_` ascribed to structural pattern like `(a, b)`, just skip relate_types.
Fix #55552
2018-11-10 09:38:10 +00:00
Nicholas Nethercote
5b2314b3ca
Use SmallVec
outparams in several functions.
...
This avoids some allocations, reducing instruction counts by 1% on a
couple of benchmarks.
2018-11-08 19:10:53 +11:00
scalexm
d99195ad8f
Rename Binder::no_late_bound_regions
to Binder::no_bound_vars
2018-11-03 11:41:55 +01:00
scalexm
d0447550da
Shift both late bound regions and bound types
2018-11-03 11:41:51 +01:00
scalexm
1003b7f85e
Move BoundTy
to ty::TyKind
2018-11-03 11:33:14 +01:00
Felix S. Klock II
09edfb885c
If we encounter _
ascribed to structural pattern like (a, b)
, just skip relate_types.
2018-11-03 01:53:57 +01:00