summary refs log tree commit diff
path: root/src/librustc_traits
AgeCommit message (Collapse)AuthorLines
2020-05-28standardize limit comparisons with `Limit` typeDavid Wood-1/+1
This commit introduces a `Limit` type which is used to ensure that all comparisons against limits within the compiler are consistent (which can result in ICEs if they aren't). Signed-off-by: David Wood <david@davidtw.co>
2020-05-24Auto merge of #72362 - matthewjasper:remove-rescope, r=nikomatsakisbors-1/+0
Remove ReScope `ReScope` is unnecessary now that AST borrowck is gone and we're erasing the results of region inference in function bodies. This removes about as much of the old regionck code as possible without having to enable NLL fully. cc #68261 r? @nikomatsakis
2020-05-22Use `OnceCell` instead of `Once`Dylan MacKenzie-1/+1
2020-05-22Remove ReScopeMatthew Jasper-1/+0
2020-05-20intern `PredicateKind`Bastian Kauschke-4/+2
2020-05-20introduce newtype'd `Predicate<'tcx>`Bastian Kauschke-42/+47
2020-05-20rename `Predicate` to `PredicateKind`, introduce aliasBastian Kauschke-22/+23
2020-05-17chalkBastian Kauschke-7/+6
2020-05-17Assume unevaluated consts are equal to the other consts and add ConstEquate ↵Ben Lewis-2/+4
obligation. This delays the need to evaluate consts eagerly and therefore gets around const eval query cycles.
2020-05-14Rollup merge of #72150 - jackh726:unnorm_projection, r=nikomatsakisRalf Jung-3/+0
Remove UnnormalizedProjection This was only used for the old chalk integration with chalk-engine r? @nikomatsakis
2020-05-12Remove ty::UnnormalizedProjectionJack Huey-3/+0
2020-05-11Fix clippy warningsMatthias Krüger-40/+36
Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}
2020-05-07Fix nit and cargo.lockJack Huey-1/+1
2020-05-07Reintegrate chalk using chalk-solveJack Huey-0/+1476
2020-05-02Move ensure_sufficient_stack to data_structuresSimonas Kazlauskas-3/+3
We anticipate this to have uses in all sorts of crates and keeping it in `rustc_data_structures` enables access to it from more locations without necessarily pulling in the large `librustc` crate.
2020-05-02Prevent stack overflow for deeply recursive codeOliver Scherer-5/+9
2020-05-01Remove leftover chalk typesJack Huey-896/+0
2020-04-24Remove `Option` from the return type of `def_kind`.Eduard-Mihai Burtescu-9/+7
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-1/+1
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-1/+1
2020-04-20Remove unused dependenciesShotaro Yamada-2/+0
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-8/+9
2020-04-13Use `CRATE_HIR_ID` instead of `DUMMY_HIR_ID` when appropriate.marmeladema-1/+1
Those usage ends up forwarded to a `ObligationClause` which uses `CRATE_HIR_ID` for dummy value as seen in `ObligationClause::dummy`.
2020-04-12Remove usage of `DUMMY_HIR_ID` in calls to `ObligationClause::misc`marmeladema-3/+1
Use `ObligationClause::dummy()` when appropriate or replace `hir::DUMMY_HIR_ID` by `hir::CRATE_HIR_ID`, as used in `ObligationClause::dummy()`.
2020-04-06ty: switch `Ty::walk` from `Ty` to `GenericArg`.Eduard-Mihai Burtescu-6/+19
2020-04-03Minor follow-up after renaming librustc(_middle)Yuki Okushi-1/+2
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-20/+20
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-28/+28
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1
2020-03-25Rollup merge of #70319 - lcnr:issue63695, r=eddybDylan DPC-7/+8
correctly normalize constants closes #70317 implements https://github.com/rust-lang/rust/issues/70125#issuecomment-602133708 r? eddyb cc @varkor
2020-03-23query normalize_generic_arg_after_erasing_regionsBastian Kauschke-7/+8
2020-03-23Rollup merge of #69968 - eddyb:tupled-closure-captures, r=nikomatsakisMazdak Farrokhzad-5/+5
rustc: keep upvars tupled in {Closure,Generator}Substs. Previously, each closure/generator capture's (aka "upvar") type was tracked as one "synthetic" type parameter in the closure/generator substs, and figuring out where the parent `fn`'s generics end and the synthetics start involved slicing at `tcx.generics_of(def_id).parent_count`. Needing to query `generics_of` limited @davidtwco (who wants to compute some `TypeFlags` differently for parent generics vs upvars, and `TyCtxt` is not available there), which is how I got started on this, but it's also possible that the `generics_of` queries are slowing down `{Closure,Generator}Substs` methods. To give an example, for a `foo::<T, U>::{closure#0}` with captures `x: X` and `y: Y`, substs are: * before this PR: `[T, U, /*kind*/, /*signature*/, X, Y]` * after this PR: `[T, U, /*kind*/, /*signature*/, (X, Y)]` You can see that, with this PR, no matter how many captures, the last 3 entries in the substs (or 5 for a generator) are always the "synthetic" ones, with the last one being the tuple of capture types. r? @nikomatsakis cc @Zoxc
2020-03-23Auto merge of #70204 - Centril:unshackled-lowering, r=Zoxcbors-1/+1
Liberate `rustc_ast_lowering` from `rustc` The whole point of this PR is the very last commit, in which we remove `rustc` as one of `rustc_ast_lowering`'s dependencies, thereby improving `./x.py` parallelism and working towards https://github.com/rust-lang/rust/issues/65031. Noteworthy: - From `rustc::arena` we move logic into `arena`, in particular `declare_arena!`. This is then used in `rustc_ast_lowering` so that lowering has its own separate arena. - Some linting code is unfortunately moved to `rustc_session::lint` cause its used both in `rustc_lint` and `rustc_ast_lowering`, and this is their common dependency. - `rustc_session::CrateDisambiguator` is moved into `rustc_ast` so that `rustc::hir::map::definitions` can be moved into `rustc_hir`, so that `rustc_ast_lowering` can stop referring to `rustc::hir`. r? @Zoxc
2020-03-21{rustc::hir::map -> rustc_hir}::definitionsMazdak Farrokhzad-1/+1
2020-03-21clarify when we pass () to functions (clippy::unit_arg)Matthias Krüger-7/+9
2020-03-21rustc: keep upvars tupled in {Closure,Generator}Substs.Eduard-Mihai Burtescu-5/+5
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-1/+1
2020-03-15More Method->Fn renamingMark Mansi-1/+1
2020-03-14Index HIR after creating TyCtxtJohn Kåre Alsaker-2/+2
2020-03-14Make downstream crates compile.Camille GILLOT-23/+38
2020-03-14Move rustc_infer::traits to new crate rustc_trait_selection.Camille GILLOT-0/+1
2020-03-14Rollup merge of #69809 - matthiaskrgr:lifetimes, r=eddybYuki Okushi-1/+1
remove lifetimes that can be elided (clippy::needless_lifetimes)
2020-03-12remove lifetimes that can be elided (clippy::needless_lifetimes)Matthias Krüger-1/+1
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-5/+5
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-10Rename rustc guide to rustc dev guideSantiago Pastorino-5/+5
2020-03-03rename TraitItemKind::Method -> FnMark Mansi-1/+1
2020-03-02Remove chalk integrationCAD97-1873/+0
2020-03-01Fix use of `has_infer_types`Matthew Jasper-1/+1
* Add a new method `has_infer_types_or_consts` that's used instead most of the time, since there's generally no reason to only consider types. * Remove use of `has_closure_types`, because closures are no longer implicitly linked to the `InferCtxt`.
2020-03-01Auto merge of #69592 - petrochenkov:nosyntax, r=Centrilbors-2/+2
Rename `libsyntax` to `librustc_ast` This was the last rustc crate that wasn't following the `rustc_*` naming convention. Follow-up to https://github.com/rust-lang/rust/pull/67763.
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2