about summary refs log tree commit diff
path: root/src/librustc/traits/select.rs
AgeCommit message (Collapse)AuthorLines
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-331/+0
2020-03-14Move IntercrateAmbiguityCause back to rustc::traits::select.Camille GILLOT-0/+41
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-1/+1
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-2/+2
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-1/+1
2020-02-16Make librustc compile.Camille GILLOT-0/+290
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-3832/+0
2020-02-13Constness -> enum Const { Yes(Span), No }Mazdak Farrokhzad-4/+4
Same idea for `Unsafety` & use new span for better diagnostics.
2020-02-11Review comments.Camille GILLOT-3/+3
2020-02-11Move lang_items definitions to librustc_lang_items.Camille GILLOT-4/+3
2020-02-11Rollup merge of #69022 - ljedrz:traits_tweak_vecs, r=petrochenkovDylan DPC-1/+1
traits: preallocate 2 Vecs of known initial size The 2 preallocations are pretty obvious; both vectors will be as big as or larger than the collections they are created from. In `WfPredicates::normalize` the change from a functional style improves readability and should be perf-friendly, too.
2020-02-10preallocate 2 Vecs in traits; tweak WfPredicates::normalizeljedrz-1/+1
2020-02-10Rollup merge of #68966 - jonas-schievink:coherence-perf, r=varkorDylan DPC-29/+15
Improve performance of coherence checks The biggest perf improvement in here is expected to come from the removal of the remaining #43355 warning code since that effectively runs the expensive parts of coherence *twice*, which can even be visualized by obtaining a flamegraph: ![image](https://user-images.githubusercontent.com/5047365/74091959-e1f41200-4a8b-11ea-969d-2849d3f86c63.png)
2020-02-10Rollup merge of #68694 - nnethercote:reduce-RefCells-in-InferCtxt, r=varkorDylan DPC-1/+1
Reduce the number of `RefCell`s in `InferCtxt`. `InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places. r? @varkor
2020-02-09Remove vestigial #43355-compat codeJonas Schievink-29/+15
This was previously a future-compat warning that has since been turned into hard error, but without actually removing all the code. Avoids a call to `traits::overlapping_impls`, which is expensive.
2020-02-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-1/+1
`InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places.
2020-02-08Reduce Vec allocations in normalization by passing &mut VecMarkus Westerlind-28/+28
2020-02-05Move EvaluationCache::clear.Camille GILLOT-7/+0
2020-02-05Move traits::select datatypes to traits::types.Camille GILLOT-293/+2
2020-01-27don't clone types that are copy, round two.Matthias Krüger-7/+4
2020-01-20Add `ConstnessAnd` that implements `ToPredicate`Dylan MacKenzie-2/+2
2020-01-20Add `constness` field to `ty::Predicate::Trait`Dylan MacKenzie-4/+6
2020-01-20Auto merge of #68057 - Aaron1011:fix/marker-trait-selection, r=matthewjasperbors-5/+57
Don't discard marker trait impls when inference variables are present Fixes #61651 Previously, we would unconditionally discard impl candidates for marker traits during trait selection. However, if the predicate had inference variables, this could have the effect of constrainting inference variables (due to a successful trait selection) when we would have otherwise failed due to mutliple applicable impls, This commit prevents marker trait impls from being discarded while the obligation predicate has any inference variables, ensuring that discarding impls will never cause us to incorrectly constraint inference variables.
2020-01-16remove dead codeMatthias Krüger-10/+6
The condition if obligation.recursion_depth >= 0 is always true since recursion_depth is usize. The else branch is dead code and can be removed. Found by Clippy. Fixes #68251
2020-01-11Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obkbors-2/+7
Promote references to constants instead of statics r? @oli-obk
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-2/+7
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-1/+1
2020-01-09Don't discard marker trait impls when inference variables are presentAaron Hill-5/+57
Fixes #61651 Previously, we would unconditionally discard impl candidates for marker traits during trait selection. However, if the predicate had inference variables, this could have the effect of constrainting inference variables (due to a successful trait selection) when we would have otherwise failed due to mutliple applicable impls, This commit prevents marker trait impls from being discarded while the obligation predicate has any inference variables, ensuring that discarding impls will never cause us to incorrectly constraint inference variables.
2020-01-07Move ty::wf to traits.Camille GILLOT-2/+3
2020-01-07Make traits::util::* free functions.Camille GILLOT-28/+31
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2019-12-22Format the worldMark Rousskov-527/+265
2019-12-22Rollup merge of #66877 - skinny121:const-eval-entry-points, r=oli-obkMazdak Farrokhzad-16/+6
Add simpler entry points to const eval for common usages. I found the `tcx.const_eval` API to be complex/awkward to work with, because of the inherent complexity from all of the different situations it is called from. Though it mainly used in one of the following ways: - Evaluates the value of a constant without any substitutions, e.g. evaluating a static, discriminant, etc. - Evaluates the value of a resolved instance of a constant. this happens when evaluating unevaluated constants or normalising trait constants. - Evaluates a promoted constant. This PR adds three new functions `const_eval_mono`, `const_eval_resolve`, and `const_eval_promoted` to `TyCtxt`, which each cater to one of the three ways `tcx.const_eval` is normally used.
2019-12-22Add simpler entry points to const eval for common usages.Ben Lewis-16/+6
2019-12-201. ast::Mutability::{Mutable -> Mut, Immutable -> Not}.Mazdak Farrokhzad-2/+2
2. mir::Mutability -> ast::Mutability.
2019-12-02rustc: allow non-empty ParamEnv's in global trait select/eval caches.Eduard-Mihai Burtescu-8/+4
2019-12-02rustc: include ParamEnv in global trait select/eval cache keys.Eduard-Mihai Burtescu-10/+15
2019-11-29allow customising ty::TraitRef's printing behaviorMikhail Babenko-2/+2
fix clippy allow customising ty::TraitRef's printing behavior fix clippy stylistic fix
2019-11-21Applied suggestions from code review.Alexander Regueiro-15/+15
2019-11-21Aggregation of drive-by cosmetic changes.Alexander Regueiro-146/+142
2019-11-19More HashStable.Camille GILLOT-13/+2
2019-11-13Use TypeFoldable derive macro.Camille GILLOT-18/+1
2019-11-10Merge hir::GeneratorMovability into ast::Movability.Camille GILLOT-2/+2
2019-11-10Merge hir::Mutability into ast::Mutability.Camille GILLOT-2/+2
2019-10-22RFC 2027: "first draft" of implementationMathias Blikstad-1/+7
These are a squashed series of commits.
2019-10-08Remove `InferCtxt::in_snapshot()`.Nicholas Nethercote-17/+18
It's the same as `InferCtxt::commit_unconditionally()` except that it is passed a snapshot and has a worse name. The commit also changes `commit_unconditionally()` to receive a snapshot, for consistency with `commit_if_ok()` and `probe()`.
2019-10-04generate GeneratorSubsts from SubstsRefcsmoe-5/+6
2019-10-04Rollup merge of #64817 - csmoe:closure, r=nikomatsakisMazdak Farrokhzad-6/+16
Replace ClosureSubsts with SubstsRef Addresses https://github.com/rust-lang/rust/issues/42340 part 3 https://github.com/rust-lang/rust/pull/59312 might benefit from this clean up. r? @nikomatsakis