about summary refs log tree commit diff
path: root/src/librustc/traits
AgeCommit message (Collapse)AuthorLines
2019-01-04implement a hack to make traitobject 0.1.0 compileAriel Ben-Yehuda-13/+57
2019-01-04Revert "add coherence future-compat warnings for marker-only trait objects"Ariel Ben-Yehuda-76/+16
This reverts commit 760639635facb6c9a0926ac9278bcba71880b0b3.
2019-01-04add support for principal-less trait object typesAriel Ben-Yehuda-7/+22
should be a pure refactoring.
2019-01-03Directly check if input_ty is a type parameter and therefore aGeorg Semmler-41/+1
uncoverd type
2019-01-03Fix tidyGeorg Semmler-4/+4
2019-01-03Implement the re-rebalance coherence rfcGeorg Semmler-30/+95
2019-01-02try to detect affected code and direct people to #56105Niko Matsakis-7/+42
2019-01-02track if any region constraints involved placeholdersNiko Matsakis-4/+3
2019-01-02universe transitionNiko Matsakis-134/+59
Remove the leak-check and its associated machinery. Replace with making the solver aware of universes.
2019-01-02select.rs: unsizing coercion should use a subtypeNiko Matsakis-2/+2
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-02introduce ability to detect region constraints from snapshotNiko Matsakis-8/+22
2019-01-02make evaluation track whether outlives relationships matteredNiko Matsakis-106/+62
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-02remove wrapper functions that had no purposeNiko Matsakis-56/+37
2019-01-02remove `commit_if_ok` wrapperNiko Matsakis-10/+1
2019-01-01Simplify and fix some diagnostics around arraysOliver Scherer-14/+10
2019-01-01Move the `Unevaluated` constant arm upwards in the type structureOliver Scherer-24/+27
2018-12-30Stop well-formedness checking unreachable code.David Wood-61/+1
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-2/+62
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-27Use `TraitEngine` in `enter_canonical_trait_query`scalexm-5/+8
2018-12-27Handle sub-typing in chalk-enginescalexm-0/+4
2018-12-27Integrate chalk enginescalexm-41/+218
2018-12-27Add a def-id in `ty::ParamEnv`scalexm-6/+21
2018-12-27Implement "lifetime juggling" methods from chalk integration traitscalexm-3/+39
Fixes #55097.
2018-12-27Auto merge of #56838 - Aaron1011:fix/rustdoc-infer-unify, r=nikomatsakisbors-2/+2
Call poly_project_and_unify_type on types that contain inference types Commit f57247c48cb59 (Ensure that Rusdoc discovers all necessary auto trait bounds) added a check to ensure that we only attempt to unify a projection predicatre with inference variables. However, the check it added was too strict - instead of checking that a type *contains* an inference variable (e.g. '&_', 'MyType<_>'), it required the type to *be* an inference variable (i.e. only '_' would match). This commit relaxes the check to use 'ty.has_infer_types', ensuring that we perform unification wherever possible. Fixes #56822
2018-12-26Various changes to string format diagnosticsEsteban Küber-2/+2
- Point at opening mismatched formatting brace - Account for differences between raw and regular strings - Account for differences between the code snippet and `InternedString` - Add more tests
2018-12-25Remove licensesMark Rousskov-310/+0
2018-12-23Rollup merge of #56984 - ljedrz:dropck_outlives_tweaks, r=oli-obkkennytm-8/+7
A few tweaks to dropck_outlives - remove an unnecessary call to `cloned()` - simplify common patterns
2018-12-22Auto merge of #56862 - arielb1:fundamentally-clean, r=nikomatsakisbors-4/+3
stop treating trait objects from #[fundamental] traits as fundamental This is a [breaking-change] to code that exploits this functionality (which should be limited to code using `#![feature(fundamental)]`. Fixes #56503. r? @nikomatsakis
2018-12-19Auto merge of #54252 - arielb1:deref-query, r=nikomatsakisbors-3/+79
process nested obligations in autoderef Fixes #53843. r? @nikomatsakis
2018-12-19dropck: remove unnecessary call to cloned()ljedrz-1/+1
2018-12-19dropck: simplify common patternsljedrz-7/+6
2018-12-18Auto merge of #56863 - arielb1:supertrait-self-4, r=nikomatsakisbors-1/+20
fix trait objects with a Self-containing projection values Fixes #56288. This follows ALT2 in the issue. beta-nominating since this is a regression. r? @nikomatsakis
2018-12-18Auto merge of #56481 - arielb1:dynamic-order, r=nikomatsakisbors-16/+76
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. Note: this lint should be made to default-warn before we merge. It is deny only for the crater run. r? @nikomatsakis / @scalexm . cc @Centril & @alexreg.
2018-12-16fix trait objects with a Self-having projection vaAriel Ben-Yehuda-1/+20
This follows ALT2 in the issue. Fixes #56288.
2018-12-15stop treating trait objects from #[fundamental] traits as fundamentalAriel Ben-Yehuda-4/+3
Fixes #56503.
2018-12-14Call poly_project_and_unify_type on types that contain inference typesAaron Hill-2/+2
Commit f57247c48cb59 (Ensure that Rusdoc discovers all necessary auto trait bounds) added a check to ensure that we only attempt to unify a projection predicatre with inference variables. However, the check it added was too strict - instead of checking that a type *contains* an inference variable (e.g. '&_', 'MyType<_>'), it required the type to *be* an inference variable (i.e. only '_' would match). This commit relaxes the check to use 'ty.has_infer_types', ensuring that we perform unification wherever possible. Fixes #56822
2018-12-15move overflow error reporting out of the queryAriel Ben-Yehuda-2/+5
that allows the error reporting to contain the span.
2018-12-15make autoderef steps a queryAriel Ben-Yehuda-0/+53
2018-12-14add coherence future-compat warnings for marker-only trait objectsAriel Ben-Yehuda-16/+76
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-14process nested obligations in autoderefAriel Ben-Yehuda-3/+23
This is a hack-fix to #53843, but I am worried it might break things because it makes the "inference pollution" problem worse. Fixes #53843 (but introduces a bug that someone might notice).
2018-12-12specialize: remove Boxes used by Children::insertljedrz-8/+33
2018-12-07Re-added accidentally-removed imports.Alexander Regueiro-1/+5
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-100/+100
2018-12-07Auto merge of #56502 - Zoxc:hir-func, r=eddybbors-15/+15
Use a function to access the Hir map to be able to turn it into a query later r? @eddyb
2018-12-06Auto merge of #55318 - Aaron1011:fix/final-auto-trait-resolve, r=nikomatsakisbors-17/+81
Ensure that Rustdoc discovers all necessary auto trait bounds Fixes #50159 This commit makes several improvements to AutoTraitFinder: * Call infcx.resolve_type_vars_if_possible before processing new predicates. This ensures that we eliminate inference variables wherever possible. * Process all nested obligations we get from a vtable, not just ones with depth=1. * The 'depth=1' check was a hack to work around issues processing certain predicates. The other changes in this commit allow us to properly process all predicates that we encounter, so the check is no longer necessary, * Ensure that we only display predicates *without* inference variables to the user, and only attempt to unify predicates that *have* an inference variable as their type. Additionally, the internal helper method is_of_param now operates directly on a type, rather than taking a Substs. This allows us to use the 'self_ty' method, rather than directly dealing with Substs.
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-15/+15
2018-12-03pass the parameter environment to `traits::find_associated_item`Ariel Ben-Yehuda-3/+13
dropping the param-env on the floor is obviously the wrong thing to do. The ICE was probably exposed by #54490 adding the problem-exposing use of `traits::find_associated_item`. Fixes #55380.
2018-12-01Rollup merge of #56355 - Zoxc:inline-things, r=michaelwoeristerkennytm-0/+1
Add inline attributes and add unit to CommonTypes
2018-12-01Rollup merge of #55821 - ljedrz:cached_key_sorts, r=michaelwoeristerkennytm-1/+1
Use sort_by_cached_key when the key function is not trivial/free I'm not 100% sure about `def_path_hash` (everything it does is inlined) but it seems like a good idea at least for the rest, as they are cloning.
2018-11-29Add inline attributes and add unit to CommonTypesJohn Kåre Alsaker-0/+1