about summary refs log tree commit diff
path: root/src/librustc/traits/project.rs
AgeCommit message (Collapse)AuthorLines
2020-02-16Move librustc/{traits,infer} to librustc_infer.Camille GILLOT-1669/+0
2020-02-10Rollup merge of #68694 - nnethercote:reduce-RefCells-in-InferCtxt, r=varkorDylan DPC-6/+6
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-10Reduce the number of `RefCell`s in `InferCtxt`.Nicholas Nethercote-6/+6
`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-09Rollup merge of #68911 - jonas-schievink:inherent-overlap, r=petrochenkovJonas Schievink-1/+1
Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in https://github.com/rust-lang/rust/pull/68837#discussion_r375701767.
2020-02-08Reduce Vec allocations in normalization by passing &mut VecMarkus Westerlind-22/+59
2020-02-08Make `associated_items` query return a sliceJonas Schievink-1/+1
2020-02-05Move traits::Reveal to traits::types.Camille GILLOT-42/+1
2020-01-27don't clone types that are copy, round two.Matthias Krüger-2/+2
2020-01-20Add `ConstnessAnd` that implements `ToPredicate`Dylan MacKenzie-3/+8
2020-01-12Rollup merge of #67867 - matthewjasper:opaque-assoc-lookup, r=oli-obkMazdak Farrokhzad-1/+1
Correctly check for opaque types in `assoc_ty_def` Closes #67856
2020-01-09refactor 'Output = $ty' & reduce rustc depMazdak Farrokhzad-2/+1
2020-01-07Make traits::util::* free functions.Camille GILLOT-35/+39
2020-01-05Correctly check for opaque types in `assoc_ty_def`Matthew Jasper-1/+1
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-1/+1
2020-01-05Auto merge of #67808 - Marwes:projection_normalization_recurse, r=nikomatsakisbors-0/+3
perf: Don't recurse into types that do not need normalizing A bit speculative at this stage but profiling shows that type folding takes up a substantial amount of time during normalization which may indicate that many types may be folded despite there being nothing to normalize
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-1/+1
2020-01-02perf: Don't recurse into types that do not need normalizingMarkus Westerlind-0/+3
A bit speculative at this stage but profiling shows that type folding takes up a substantial amount of time during normalization which may indicate that many types may be folded despite there being nothing to normalize
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-27Fix `Instance::resolve()` incorrectly returning specialized instancesWesley Wiser-0/+3
We only want to return specializations when `Reveal::All` is passed, not when `Reveal::UserFacing` is. Resolving this fixes several issues with the `ConstProp`, `SimplifyBranches`, and `Inline` MIR optimization passes. Fixes #66901
2019-12-22Format the worldMark Rousskov-455/+407
2019-12-20Use `delay_span_bug` less oftenMatthew Jasper-5/+21
2019-12-02rustc: include ParamEnv in global trait select/eval cache keys.Eduard-Mihai Burtescu-6/+4
2019-11-13Use TypeFoldable derive macro.Camille GILLOT-1/+1
2019-10-06Auto merge of #64564 - jonas-schievink:cowardly-default, r=nikomatsakisbors-2/+2
Deny specializing items not in the parent impl Part of https://github.com/rust-lang/rust/issues/29661 (https://github.com/rust-lang/rfcs/pull/2532). At least sort of? This was discussed in https://github.com/rust-lang/rust/pull/61812#discussion_r300504114 and is needed for that PR to make progress (fixing an unsoundness). One annoyance with doing this is that it sometimes requires users to copy-paste a provided trait method into an impl just to mark it `default` (ie. there is no syntax to forward this impl method to the provided trait method). cc @Centril and @arielb1
2019-10-05Deny specializing items not in the parent implJonas Schievink-2/+2
2019-10-04remove GeneratorSubsts visitorscsmoe-1/+1
2019-10-03generate ClosureSubsts from SubstsRefcsmoe-1/+2
2019-09-25Rename `sty` to `kind`varkor-3/+3
2019-08-23Simplify eager normalization of constantsOliver Scherer-35/+1
2019-08-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-1/+1
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
2019-08-02Replace "existential" by "opaque"varkor-1/+1
2019-07-03Remove needless lifetimesJeremy Stucki-2/+2
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-1/+0
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-14Remove unnecessary lift callsJohn Kåre Alsaker-1/+0
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-86/+73
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-55/+55
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-2/+2
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-2/+2
2019-06-05Refactor `TypeVariableOrigin` into `TypeVariableOrigin` and ↵varkor-3/+11
`TypeVariableOriginKind`
2019-05-28Rename `OpportunisticTypeResolver` to `OpportunisticVarResolver`varkor-3/+3
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-12/+12
We are going to uniform the terminology of all associated items. Methods that may or may not have `self` are called "associated functions". Because `AssociatedFn` is a bit long, we rename `Associated` to `Assoc`.
2019-05-25Don't use `ty::Const` without immediately interningOliver Scherer-2/+1
2019-05-17Change `rustc::util::common::FN_OUTPUT_NAME` to a `Symbol`.Nicholas Nethercote-1/+1
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-2/+3
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-08Use `delay_span_bug` for "Failed to unify obligation"Esteban Küber-5/+10
2019-05-01Create ShallowResolvervarkor-3/+3
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-05-01Rename *shallow_resolve to *shallow_resolve_typevarkor-3/+3
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>