about summary refs log tree commit diff
path: root/src/librustc/traits/query
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-1029/+0
2020-02-05Move traits::query datatypes to traits::types.Camille GILLOT-249/+20
2020-01-28Add an early-exit to `QueryNormalizer::fold_ty`Jonas Schievink-0/+4
2020-01-21Rollup merge of #68140 - ecstatic-morse:const-trait-bound-opt-out, r=oli-obkMazdak Farrokhzad-1/+1
Implement `?const` opt-out for trait bounds For now, such bounds are treated exactly the same as unprefixed ones in all contexts. [RFC 2632](https://github.com/rust-lang/rfcs/pull/2632) does not specify whether such bounds are forbidden outside of `const` contexts, so they are allowed at the moment. Prior to this PR, the constness of a trait bound/impl was stored in `TraitRef`. Now, the constness of an `impl` is stored in `ast::ItemKind::Impl` and the constness of a bound in `ast::TraitBoundModifer`. Additionally, constness of trait bounds is now stored in an additional field of `ty::Predicate::Trait`, and the combination of the constness of the item along with any `TraitBoundModifier` determines the constness of the bound in accordance with the RFC. Encoding the constness of impls at the `ty` level is left for a later PR. After a discussion in \#wg-grammar on Discord, it was decided that the grammar should not encode the mutual exclusivity of trait bound modifiers. The grammar for trait bound modifiers remains `[?const] [?]`. To encode this, I add a dummy variant to `ast::TraitBoundModifier` that is used when the syntax `?const ?` appears. This variant causes an error in AST validation and disappears during HIR lowering. cc #67794 r? @oli-obk
2020-01-20Add `constness` field to `ty::Predicate::Trait`Dylan MacKenzie-1/+1
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-2/+0
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-1/+1
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-4/+4
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-07Move normalize_erasing_regions to rustc::ty.Camille GILLOT-79/+0
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-2/+2
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-3/+3
2019-12-22Format the worldMark Rousskov-143/+85
2019-11-19More HashStable.Camille GILLOT-42/+8
2019-11-19More HashStable.Camille GILLOT-31/+6
2019-11-18Retire EnumLiftImpl.Camille GILLOT-11/+2
2019-11-18Retire BraceStructLiftImpl.Camille GILLOT-74/+9
2019-11-17Auto merge of #66384 - cjgillot:typefoldable, r=Zoxcbors-74/+10
Derive TypeFoldable using a proc-macro A new proc macro is added in librustc_macros. It is used to derive TypeFoldable inside librustc and librustc_traits. For now, the macro uses the `'tcx` lifetime implicitly, and does not allow for a more robust selection of the adequate lifetime. The Clone-based TypeFoldable implementations are not migrated. Closes #65674
2019-11-14Update to use new librustc_error_codes libraryGuillaume Gomez-0/+2
2019-11-13Use TypeFoldable derive macro.Camille GILLOT-74/+10
2019-11-01De-querify `trivial_dropck_outlives`.Nicholas Nethercote-14/+6
It's sufficiently simple and fast that memoizing it is a slight pessimization.
2019-10-21Remove many unnecessary trait derivations.Nicholas Nethercote-2/+2
2019-10-12Make trivial dropck outlives a queryMark Rousskov-6/+13
This allows caching some recursive types and getting to an error much more quickly.
2019-10-09Obligation must apply modulo regionsEsteban Küber-1/+1
2019-10-03generate ClosureSubsts from SubstsRefcsmoe-0/+1
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-5/+2
2019-09-27Remove shrink_to_tcx_lifetimeMark Rousskov-98/+9
There's no longer two distinct gcx and tcx lifetimes which made this necessary (or, at least, the code compiles -- it's possible we got better at normalizing, but that seems unlikely).
2019-09-27Remove stray uses of gcx nameMark Rousskov-1/+1
2019-09-27Remove global_tcx from TyCtxtMark Rousskov-6/+5
The non-global context was removed; there's only one context now. This is a noop method that only serves to confuse readers -- remove it.
2019-09-26Rename `subst::Kind` to `subst::GenericArg`varkor-5/+5
2019-09-25Rename `sty` to `kind`varkor-2/+2
2019-09-07Aggregation of cosmetic changes made during work on REPL PRs: librustcAlexander Regueiro-7/+8
2019-08-23Simplify eager normalization of constantsOliver Scherer-36/+2
2019-07-24Stabilize the type_name intrinsic in core::anySteven Fackler-2/+2
Closes rust-lang/rfcs#1428
2019-07-02pass a `&mut QueryRegionConstraints` not just outlives constraintsNiko Matsakis-6/+6
2019-07-02introduce `QueryRegionConstraints` structNiko Matsakis-13/+13
2019-07-02rename `QueryRegionConstraint` to `QueryOutlivesConstraint`Niko Matsakis-7/+7
2019-06-26Don't use lift to detect local typesJohn Kåre Alsaker-2/+3
2019-06-19Rollup merge of #61842 - Zoxc:trim-lift, r=eddybMazdak Farrokhzad-5/+4
Remove unnecessary lift calls Note that some of these might be useful for sanity checking that there's no infer types or regions. r? @eddyb
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-1/+1
2019-06-16Auto merge of #61754 - nikomatsakis:trait-caching-perf-3, r=pnkfelixbors-1/+1
create a "provisional cache" to restore performance in the case of cycles Introduce a "provisional cache" that caches the results of auto trait resolutions but keeps them from entering the *main* cache until everything is ready. This turned out a bit more complex than I hoped, but I don't see another short term fix -- happy to take suggestions! In the meantime, it's very clear we need to rework the trait solver. This resolves the extreme performance slowdown experienced in #60846 -- I plan to add a perf.rust-lang.org regression test to track this. Caveat: I've not run `x.py test` in full yet. r? @pnkfelix cc @arielb1 Fixes #60846
2019-06-14Remove unnecessary lift callsJohn Kåre Alsaker-5/+4
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-3/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-123/+108
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-6/+1
2019-06-12rustc: remove some unnecessary lifetimes in -> TyCtxt methods.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-28/+28
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-30/+30
2019-06-11rename `evaluate_obligation_recursively`Niko Matsakis-1/+1
It does not, in fact, execute in a recursive context.
2019-06-11rustc: deny(unused_lifetimes).Eduard-Mihai Burtescu-1/+1