about summary refs log tree commit diff
path: root/src/librustc/traits
AgeCommit message (Collapse)AuthorLines
2018-06-28Move everything over from `middle::const_val` to `mir::interpret`Oliver Schneider-5/+4
2018-06-28Move the Lrc outside the error type and name the fieldsOliver Schneider-5/+7
2018-06-28Address review commentsOliver Schneider-2/+2
2018-06-28Eliminate old CTFE's `ErrKind`Oliver Schneider-2/+4
2018-06-28Use `Ident`s for associated item definitions in HIRVadim Petrochenkov-13/+12
Remove emulation of hygiene with gensyms
2018-06-28Use `Ident`s for associated type bindings in HIRVadim Petrochenkov-3/+4
2018-06-28Auto merge of #51538 - nikomatsakis:nll-perf-examination, r=eddybbors-150/+828
convert NLL ops to caches This is a extension of <https://github.com/rust-lang/rust/pull/51460>. It uses a lot more caching than we used to do. This caching is not yet as efficient as it could be, but I'm curious to see the current perf results. This is the high-level idea: in the MIR type checker, use [canonicalized queries](https://rust-lang-nursery.github.io/rustc-guide/traits/canonical-queries.html) for all the major operations. This is helpful because the MIR type check is operating in a context where all types are fully known (mostly, anyway) but regions are completely renumbered. This means we often wind up with duplicate queries like `Foo<'1, '2> :Bar` and `Foo<'3, '4>: Bar`. Canonicalized queries let us re-use the results. By the final commit in this PR, we can essentially just "read off" the resulting region relations and add them to the NLL type check.
2018-06-28Rollup merge of #51658 - oli-obk:unregress_perf, r=nikomatsakiskennytm-3/+3
Only do sanity check with debug assertions on r? @nnethercote I'm slighty confused. These changes address code that the `unused-warnings` benchmark doesn't go through, yet I see a 5% improvement to nightly on the `check` run, and no improvement on the other runs. Maybe this change allows unrelated code in the same function to be better optimized?
2018-06-27rustfmt various filesNiko Matsakis-5/+9
2018-06-27change the `enter_canonical_trait_query` method to give a fulfill cxNiko Matsakis-33/+31
2018-06-27update commentsNiko Matsakis-3/+15
2018-06-27rename `prequery` to `try_fast_path`Niko Matsakis-7/+7
2018-06-27pull out `ParamEnvAnd` and remove `QueryKey`Niko Matsakis-153/+150
2018-06-27rename to `shrink_to_tcx_lifetime`Niko Matsakis-13/+13
2018-06-27improve comments on `dropck_outlives`Niko Matsakis-0/+15
2018-06-27rename `upcast` to `cast_to_tcx_lifetime` and improve commentNiko Matsakis-16/+21
2018-06-26convert query-type-op to create query-region-constraint directlyNiko Matsakis-148/+133
2018-06-26convert `dropck_outlives` type-op to use the queryNiko Matsakis-32/+67
2018-06-26introduce `QueryKey` separationNiko Matsakis-3/+27
2018-06-26Flatten some occurrences of `[P<T>]` to `[T]`Oliver Schneider-1/+1
2018-06-26transition to `Fallible`Niko Matsakis-33/+55
2018-06-26introduce `Normalizable` trait for things directly normalizableNiko Matsakis-41/+180
2018-06-26convert `prove_predicate` into a queryNiko Matsakis-14/+38
2018-06-26convert `predicates` to operate on 1 predicate at a timeNiko Matsakis-19/+12
2018-06-26make `Subtype` a true queryNiko Matsakis-13/+41
2018-06-26make `Eq` a true queryNiko Matsakis-22/+13
2018-06-26introduce `canonicalize_hr_query_hack`Niko Matsakis-1/+5
As the comment explains, this is needed to prevent subtype from going awry in higher-ranked cases, due to #33684. The proper fix here is introducing universes (#48536).
2018-06-26move `type_op` into `rustc`Niko Matsakis-0/+495
2018-06-26remove `Canonicalization` trait, which serves no purposeNiko Matsakis-72/+5
2018-06-26rename `instantiate_query_result`Niko Matsakis-2/+2
2018-06-26make one `Canonicalize` impl for `QueryResult`Niko Matsakis-28/+2
This lets us simplify a few type aliases.
2018-06-26improve `trivial_case` handlingNiko Matsakis-1/+1
2018-06-26Use proper debugging statements for infinite recursion assertionOliver Schneider-3/+3
2018-06-26Rollup merge of #51769 - alexcameron89:update_rustc_guide_links, r=frewsxcvPietro Albini-7/+7
Update broken rustc-guide links Recently, there has been some rearrangement of the content in the Rustc Guide, and this commit changes the urls the match the updated guide.
2018-06-25Make where clause object safety be a warn-by-default lintleonardo.yvens-3/+31
2018-06-25`Self` in where clauses may not be object safeleonardo.yvens-0/+11
This is virtually certain to cause regressions, needs crater. In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses. This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error. Fixes #50781. r? @nikomatsakis
2018-06-24Update broken rustc-guide linksAlex Kitchens-7/+7
Recently, there has been some rearrangement of the content in the Rustc Guide, and this commit changes the urls the match the updated guide.
2018-06-23hygiene: Merge `NameAndSpan` into `ExpnInfo`Vadim Petrochenkov-2/+1
2018-06-22Auto merge of #51433 - scalexm:finish-rules, r=nikomatsakisbors-47/+102
[chalkify] Small refactoring and WF/FromEnv rules for types r? @nikomatsakis
2018-06-20Remove all traces of lifetimes() and types() methodsvarkor-5/+3
2018-06-18Auto merge of #51414 - oli-obk:impl_trait_type_def, r=pnkfelixbors-0/+5
Add existential type definitions Note: this does not allow creating named existential types, it just desugars `impl Trait` to a less (but still very) hacky version of actual `existential type` items. r? @nikomatsakis
2018-06-16Auto merge of #51550 - eddyb:queries-not-maps, r=nikomatsakisbors-2/+2
rustc: rename ty::maps to ty::query. Should've never been `maps` but "query system/engine" didn't fully settle from the start. r? @michaelwoerister or @nikomatsakis
2018-06-16Auto merge of #51411 - nnethercote:process_predicate, r=nikomatsakisbors-249/+253
Speed up obligation forest code Here are the rustc-perf benchmarks that get at least a 1% speedup on one or more of their runs with these patches applied: ``` inflate-check avg: -8.7% min: -12.1% max: 0.0% inflate avg: -5.9% min: -8.6% max: 1.1% inflate-opt avg: -1.5% min: -2.0% max: -0.3% clap-rs-check avg: -0.6% min: -1.9% max: 0.5% coercions avg: -0.2%? min: -1.3%? max: 0.6%? serde-opt avg: -0.6% min: -1.0% max: 0.1% coercions-check avg: -0.4%? min: -1.0%? max: -0.0%? ```
2018-06-14rustc: rename ty::maps to ty::query.Eduard-Mihai Burtescu-2/+2
2018-06-09Auto merge of #51042 - matthewjasper:reenable-trivial-bounds, r=nikomatsakisbors-16/+61
Re-enable trivial bounds cc #50825 Remove implementations from global bounds in winnowing when there is ambiguity. This results in the reverse of #24066 happening sometimes. I'm not sure if anything can be done about that though. cc #48214 r? @nikomatsakis
2018-06-08Rollup merge of #51412 - nnethercote:pending_obligations, r=estebankMark Rousskov-4/+4
Avoid useless Vec clones in pending_obligations(). The only instance of `ObligationForest` in use has an obligation type of `PendingPredicateObligation`, which contains a `PredicateObligation` and a `Vec<Ty>`. `FulfillmentContext::pending_obligations()` calls `ObligationForest::pending_obligations()`, which clones all the `PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned obligations is never touched. This patch changes `ObligationForest::pending_obligations()` to `map_pending_obligations` -- which gives callers control about which part of the obligation to clone -- and takes advantage of the change to avoid cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf benchmarks, the best by 1%.
2018-06-08Reenable trivial boundsMatthew Jasper-16/+61
Removes extra global bounds at the winnowing stage rather than when normalizing the param_env. This avoids breaking inference when there is a global bound.
2018-06-08Avoid useless Vec clones in pending_obligations().Nicholas Nethercote-4/+4
The only instance of `ObligationForest` in use has an obligation type of `PendingPredicateObligation`, which contains a `PredicateObligation` and a `Vec<Ty>`. `FulfillmentContext::pending_obligations()` calls `ObligationForest::pending_obligations()`, which clones all the `PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned obligations is never touched. This patch changes `ObligationForest::pending_obligations()` to `map_pending_obligations` -- which gives callers control about which part of the obligation to clone -- and takes advantage of the change to avoid cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf benchmarks, the best by 1%.
2018-06-07Add existential type definitonsOliver Schneider-0/+5
2018-06-07Introduce `ProcessResult`.Nicholas Nethercote-37/+41
A tri-valued enum is nicer than Result<Option<T>>, and it's slightly faster.