about summary refs log tree commit diff
path: root/src/librustc_traits
AgeCommit message (Collapse)AuthorLines
2019-02-07Transition librustc_traits to 2018 editionHirokazu Hata-23/+20
2019-01-25Auto merge of #57714 - matthewjasper:wellformed-unreachable, r=pnkfelixbors-38/+5
[NLL] Clean up handling of type annotations * Renames (Canonical)?UserTypeAnnotation -> (Canonical)?UserType so that the name CanonicalUserTypeAnnotation is free. * Keep the inferred type associated to user type annotations in the MIR, so that it can be compared against the annotated type, even when the annotated expression gets removed from the MIR. (#54943) * Use the inferred type to allow infallible handling of user type projections (#57531) * Uses revisions for the tests in #56993 * Check the types of `Unevaluated` constants with no annotations (#46702) * Some drive-by cleanup Closes #46702 Closes #54943 Closes #57531 Closes #57731 cc #56993 leaving this open to track the underlying issue: we are not running tests with full NLL enabled on CI at the moment r? @nikomatsakis
2019-01-19Handle lifetime annotations in unreachable codeMatthew Jasper-38/+5
We equate the type in the annotation with the inferred type first so that we have a fully inferred type to perform the well-formedness check on.
2019-01-10integrate trait aliases into def-paths / metadataNiko Matsakis-1/+2
Co-authored-by: Alexander Regueiro <alexreg@me.com>
2019-01-05Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakisbors-5/+1
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-04Revert "add coherence future-compat warnings for marker-only trait objects"Ariel Ben-Yehuda-5/+1
This reverts commit 760639635facb6c9a0926ac9278bcba71880b0b3.
2019-01-01Move the `Unevaluated` constant arm upwards in the type structureOliver Scherer-1/+1
2018-12-30Stop well-formedness checking unreachable code.David Wood-76/+27
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-30Always check well-formedness.David Wood-29/+77
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-30Refactor `UserTypeAnnotation`.David Wood-22/+8
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-27Fix `tcx.environment` for inherent implsscalexm-31/+48
2018-12-27Add `wf_clause_for_fn_def`scalexm-1/+21
2018-12-27Use `TraitEngine` in `enter_canonical_trait_query`scalexm-6/+10
2018-12-27Handle sub-typing in chalk-enginescalexm-6/+28
2018-12-27Integrate chalk enginescalexm-31/+133
2018-12-27Fix binding levels in implied bounds rulesscalexm-15/+11
2018-12-27Fix `Sized` requirement for empty tuples in `program_clauses`scalexm-1/+4
2018-12-27Add builtin impls for `Sized` in `chalk_context::program_clauses`scalexm-1/+150
2018-12-27Rename functions giving WF clauses for builtin typesscalexm-21/+38
2018-12-27Add utilities for creating generic typesscalexm-59/+87
2018-12-27Return an instantiated environment instead of a generic onescalexm-28/+28
2018-12-27Fix `visit_ex_clause_with`scalexm-3/+3
The sub-visits were incorrectly combined with an `&&` instead of an `||`.
2018-12-27Implement "lifetime juggling" methods from chalk integration traitscalexm-8/+42
Fixes #55097.
2018-12-27Implement `is_coinductive`scalexm-3/+20
Fixes #55096.
2018-12-25Remove licensesMark Rousskov-110/+0
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-1/+5
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-10Upgrade `smallvec` to 0.6.7 and use the new `may_dangle` feature.Nicholas Nethercote-1/+1
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-7/+7
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-5/+5
2018-11-29Implement `AggregateOps`scalexm-2/+28
`make_solution` does not return any guidance for now
2018-11-29Implement `ResolventOps`scalexm-29/+256
2018-11-29Handle inference variables in `nll_relate` and use it for chalkscalexm-17/+132
2018-11-24Fix `ChalkInferenceContext::into_hh_goal`scalexm-1/+4
2018-11-24Implement some instantiate / canonical routinesscalexm-52/+113
2018-11-24Move `BoundTy` debruijn index to the `TyKind` enum variantscalexm-10/+14
2018-11-24Introduce `TyKind::Placeholder` variantscalexm-1/+3
2018-11-15Rollup merge of #55778 - nnethercote:LrcPreds, r=eddybPietro Albini-5/+7
Wrap some query results in `Lrc`. So that the frequent clones in `try_get` are cheaper.
2018-11-14Wrap some query results in `Lrc`.Nicholas Nethercote-5/+7
So that the frequent clones in `try_get` are cheaper. Fixes #54274.
2018-11-13Implement `ProjectionEq-Normalize`csmoe-1/+43
2018-11-13Instantiate all bound vars existentiallyscalexm-4/+3
2018-11-13Use a dummy outlives requirement for `where Type:,` (see #53696)scalexm-6/+7
A `WF(Type)` predicate was used previously, which did not play well with implied bounds in chalk.
2018-11-13Bypass ppaux for `Outlives` predicatesscalexm-1/+1
2018-11-13Provide program clauses for builtin typesscalexm-229/+509
2018-11-13Adjust documentationscalexm-3/+4
2018-11-13Pretty print quantified goals and clausesscalexm-10/+3
2018-11-13Replace type params with bound vars in `rustc_traits::lowering`scalexm-60/+118
2018-11-11Rollup merge of #55745 - nnethercote:outlives_components-SmallVec, ↵Pietro Albini-2/+4
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-10Auto merge of #55637 - ↵bors-6/+24
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-08Use `SmallVec` outparams in several functions.Nicholas Nethercote-2/+4
This avoids some allocations, reducing instruction counts by 1% on a couple of benchmarks.
2018-11-03Rename `Binder::no_late_bound_regions` to `Binder::no_bound_vars`scalexm-2/+2