about summary refs log tree commit diff
path: root/src/librustc/traits
AgeCommit message (Collapse)AuthorLines
2017-10-08address more FIXME whose associated issues were marked as closedNiv Kaminer-13/+2
update FIXME(#6298) to point to open issue 15020 update FIXME(#6268) to point to RFC 811 update FIXME(#10520) to point to RFC 1751 remove FIXME for emscripten issue 4563 and include target in `test_estimate_scaling_factor` remove FIXME(#18207) since node_id isn't used for `ref` pattern analysis remove FIXME(#6308) since DST was implemented in #12938 remove FIXME(#2658) since it was decided to not reorganize module remove FIXME(#20590) since it was decided to stay conservative with projection types remove FIXME(#20297) since it was decided that solving the issue is unnecessary remove FIXME(#27086) since closures do correspond to structs now remove FIXME(#13846) and enable `function_sections` for windows remove mention of #22079 in FIXME(#22079) since this is a general FIXME remove FIXME(#5074) since the restriction on borrow were lifted
2017-10-07Add suggestionsinkuu-31/+100
2017-10-07Rename variablessinkuu-21/+21
2017-10-06Auto merge of #45065 - arielb1:not-correct, r=nikomatsakisbors-1/+1
fix logic error in #44269's `prune_cache_value_obligations` We want to retain obligations that *contain* inference variables, not obligations that *don't contain* them, in order to fix #43132. Because of surrounding changes to inference, the ICE doesn't occur in its original case, but I believe it could still be made to occur on master. Maybe I should try to write a new test case? Certainly not right now (I'm mainly trying to get us a beta that we can ship) but maybe before we land this PR on nightly? This seems to cause a 10% performance regression in my imprecise attempt to benchmark item-body checking for #43613, but it's better to be slow and right than fast and wrong. If we want to recover that, I think we can change the constrained-type-parameter code to actually give a list of projections that are important for resolving inference variables and filter everything else out.
2017-10-07Better error for missing tuple pattern in args (#44150)sinkuu-22/+72
2017-10-06fix logic error in #44269's `prune_cache_value_obligations`Ariel Ben-Yehuda-1/+1
We want to retain obligations that *contain* inference variables, not obligations that *don't contain* them, in order to fix #43132. Because of surrounding changes to inference, the ICE doesn't occur in its original case, but I believe it could still be made to occur on master. Maybe I should try to write a new test case? Certainly not right now (I'm mainly trying to get us a beta that we can ship) but maybe before we land this PR on nightly? This seems to cause a 10% performance regression in my imprecise attempt to benchmark item-body checking for #43613, but it's better to be slow and right than fast and wrong. If we want to recover that, I think we can change the constrained-type-parameter code to actually give a list of projections that are important for resolving inference variables and filter everything else out.
2017-10-06Improve resolution of associated types in macros 2.0Vadim Petrochenkov-12/+14
2017-09-26Auto merge of #44741 - qmx:trans_fulfill_obligation_should_not_crash, ↵bors-5/+6
r=nikomatsakis use param_env on the trait_cache key We bailed from making trans_fulfill_obligation return `Option` or `Result`, just made it less prone to crashing outside trans r? @nikomatsakis
2017-09-25add comment per @nikomatsakis requestDouglas Campos-0/+1
2017-09-25expose ParamEnv as a paramDouglas Campos-2/+2
2017-09-25add ParamEnv to the trait_cache keyDouglas Campos-4/+4
2017-09-23Print fn signature when there is closure argument type mismatchWonwoo Choi-66/+75
Fixes #42143. E0281 is totally replaced by E0631. UI tests are updated accordingly.
2017-09-20Fix ICEscalexm-2/+2
2017-09-20Implement `Copy`/`Clone` for closuresscalexm-7/+22
2017-09-18incr.comp.: Remove tcx from StableHashingContext.Michael Woerister-2/+2
2017-09-18incr.comp.: Use StableHash impls instead of functions for hashing most maps.Michael Woerister-17/+4
2017-09-18incr.comp.: Compute hashes of all query results.Michael Woerister-0/+34
2017-09-14bring Ty into scopeDouglas Campos-1/+1
2017-09-11rustc: evaluate fixed-length array length expressions lazily.Eduard-Mihai Burtescu-8/+111
2017-09-08Auto merge of #44269 - nikomatsakis:issue-43613-limit-cache-obligations, ↵bors-7/+102
r=arielb1 limit and clear cache obligations opportunistically Keeping **all** the obligations for every projection is wasteful of memory and compilation time. We only really care about those subobligations that may inform the result of the projection (i.e., may help to resolve any inference variables that appear within). Therefore, we can clear the subobligations from the cache that don't potentially affect the result of the projection. On every cache hit, we also take the opportunity to check if the type variables have been resolved *yet* and, if so, clear out the pending obligations. Fixes #43613. r? @arielb1 NB -- not sure how to test for this. Probably we should add the #43613 test case to perf.
2017-09-08Auto merge of #44142 - alexcrichton:dllimport-query, r=nikomatsakisbors-20/+20
Migrate a slew of metadata methods to queries This PR intends to make more progress on #41417, knocking off some low-hanging fruit. Closes #44190 cc #44137
2017-09-07update commentNiko Matsakis-7/+18
2017-09-06add in a "paranoid" trait boundNiko Matsakis-0/+34
2017-09-05factor out helper methodNiko Matsakis-12/+14
2017-09-05Fix misdetection of upstream intercrate ambiguity.Masaki Hara-8/+13
2017-09-05Print more detailed trait-ref for intercrate ambiguity.Masaki Hara-17/+44
2017-09-05Unify intercrate ambiguity emitters into a function.Masaki Hara-11/+21
2017-09-05Slightly modify hint messages.Masaki Hara-2/+2
2017-09-05Add hints when intercrate ambiguity causes overlap.Masaki Hara-9/+63
2017-09-05rustc: Store InternedString in `DefPathData`Alex Crichton-3/+3
Previously a `Symbol` was stored there, but this ended up causing hash collisions in situations that otherwise shouldn't have a hash collision. Only the symbol's string value was hashed, but it was possible for distinct symbols to have the same string value, fooling various calcuations into thinking that these paths *didn't* need disambiguating data when in fact they did! By storing `InternedString` instead we're hopefully triggering all the exising logic to disambiguate paths with same-name `Symbol` but actually distinct locations.
2017-09-05rustc: Migrate lang items to a queryAlex Crichton-15/+17
This commit moves the calculation of the `LanguageItems` structure into a query rather than being calculated before the `TyCtxt` exists, with the eventual end goal of removing some `CrateStore` methods.
2017-09-05rustc: Move `impl_defaultness` to a queryAlex Crichton-2/+0
2017-09-03Auto merge of #44191 - arielb1:on-unimplemented-label, r=nikomatsakisbors-74/+369
More general `on_unimplemented`, with uses in `Try` Allow `on_unimplemented` directives to specify both the label and the primary message of the trait error, and allow them to be controlled by flags - currently only to be desugaring-sensitive. e.g. ```Rust #[rustc_on_unimplemented( on(all(direct, from_desugaring="?"), message="the `?` operator can only be used in a \ function that returns `Result` \ (or another type that implements `{Try}`)", label="cannot use the `?` operator in a function that returns `{Self}`"), )] ``` r? @nikomatsakis
2017-09-03on_unimplemented: add method-name checks and use them in TryAriel Ben-Yehuda-5/+26
2017-09-03address review commentsAriel Ben-Yehuda-5/+12
2017-09-03enable desugaring-sensitive error messages and use them in TryAriel Ben-Yehuda-1/+17
Maybe I should allow error messages to check the *specific* desugaring? Thanks @huntiep for the idea!
2017-09-03implement improved on_unimplemented directivesAriel Ben-Yehuda-34/+185
2017-09-03move the on_unimplemented logic to its own fileAriel Ben-Yehuda-142/+160
2017-09-03refactor and centralize `on_unimplemented` parsingAriel Ben-Yehuda-63/+145
2017-09-02limit and clear cache obligations opportunisticallyNiko Matsakis-7/+57
Keep **all** the obligations for every projection is wasteful of memory and compilation time. We only really care about those subobligations that may inform the result of the projection (i.e., may help to resolve any inference variables that appear within). Therefore, we can clear the subobligations from the cache that don't potentially affect the result of the projection. On every cache hit, we also take the opportunity to check if the type variables have been resolved *yet* and, if so, clear out the pending obligations. Fixes #43613
2017-09-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-3/+3
2017-09-01rustc: use hir::ItemLocalId instead of ast::NodeId in CodeExtent.Eduard-Mihai Burtescu-1/+1
2017-08-30Rollup merge of #44157 - alexcrichton:no-specializes-cache, r=eddybAlex Crichton-18/+13
rustc: Remove `specialization_cache` in favor of a query This commit removes the `specialization_cache` field of `TyCtxt` by moving it to a dedicated query, which it turned out was already quite easily structured to do so! cc #44137
2017-08-30Auto merge of #43880 - arielb1:noninvasive-probe, r=nikomatsakisbors-106/+80
Remove the trait selection impl in method::probe This removes the hacky trait selection reimplementation in `method::probe`, which occasionally comes and causes problems. There are 2 issues I've found with this approach: 1. The older implementation sometimes had a "guess" type from an impl, which allowed subtyping to work. This is why I needed to make a change in `libtest`: there's an `impl<A> Clone for fn(A)` and we're calling `<for<'a> fn(&'a T) as Clone>::clone`. The older implementation would do a subtyping between the impl type and the trait type, so it would do the check for `<fn(A) as Clone>::clone`, and confirmation would continue with the subtyping. The newer implementation directly passes `<for<'a> fn(&'a T) as Clone>::clone` to selection, which fails. I'm not sure how big of a problem that would be in reality, especially after #43690 would remove the `Clone` problem, but I still want a crater run to avoid breaking the world. 2. The older implementation "looked into" impls to display error messages. I'm not sure that's an advantage - it looked exactly 1 level deep. r? @eddyb
2017-08-29remove the data from ClosureCandidateAriel Ben-Yehuda-106/+80
the data serves no purpose - it can be recovered from the obligation - and I think may leak stale inference variables into global caches.
2017-08-29rustc: Remove `specailization_cache` in favor of a queryAlex Crichton-18/+13
This commit removes the `specialization_cache` field of `TyCtxt` by moving it to a dedicated query, which it turned out was already quite easily structured to do so!
2017-08-29Track closure signatures & kinds in freshened typesAriel Ben-Yehuda-56/+9
This allows caching closure signatures and kinds in the normal selection and evaluation caches, and fixes the exponential worst-case in @remram44's example, which is a part of #43787. This improvement is complenentary to #43999 - they fix different cases.
2017-08-28Auto merge of #43999 - arielb1:immediate-project, r=nikomatsakisbors-19/+112
clear out projection subobligations after they are processed After a projection was processed, its derived subobligations no longer need any processing when encountered, and can be removed. This improves the status of #43787. This is actually complementary to #43938 - that PR fixes selection caching (and @remram44's example, which "accidentally" worked because of the buggy projection caching) while this PR fixes projection caching. r? @nikomatsakis
2017-08-27clear out projection subobligations after they are processedAriel Ben-Yehuda-19/+112
After a projection was processed, its derived subobligations no longer need any processing when encountered, and can be removed. This improves the status of #43787. This is actually complementary to #43938 - that PR fixes selection caching (and @remram44's example, which "accidentally" worked because of the buggy projection caching) while this PR fixes projection caching
2017-08-21Merge remote-tracking branch 'origin/master' into genAlex Crichton-5/+17