about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check/compare_method.rs
AgeCommit message (Collapse)AuthorLines
2022-12-28Rename module compare_method -> compare_impl_itemMichael Goulet-1974/+0
2022-12-28make some things less pubMichael Goulet-5/+5
2022-12-24Bubble up ErrorGuaranteed from region constraints in method item compareMichael Goulet-5/+5
2022-12-24Rename some compare_method functionsMichael Goulet-3/+3
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
2022-12-19Make fast-path for implied wf lint betterMichael Goulet-71/+92
2022-12-19Add IMPLIED_BOUNDS_ENTAILMENT lintMichael Goulet-5/+70
2022-12-17Rollup merge of #105711 - compiler-errors:rpitit-references-errors, r=eholkMatthias Krüger-0/+2
bail in `collect_trait_impl_trait_tys` if signatures reference errors Fixes #105290
2022-12-15Rollup merge of #104592 - ComputerDruid:async_check, r=compiler-errorsMatthias Krüger-0/+32
Ensure async trait impls are async (or otherwise return an opaque type) As a workaround for the full `#[refine]` semantics not being implemented yet, forbit returning a concrete future type like `Box<dyn Future>` or a manually implemented Future. `-> impl Future` is still permitted; while that can also cause accidental refinement, that's behind a different feature gate (`return_position_impl_trait_in_trait`) and that problem exists regardless of whether the trait method is async, so will have to be solved more generally. Fixes https://github.com/rust-lang/rust/issues/102745
2022-12-14Ensure async trait impls are async (or otherwise return an opaque type)Dan Johnson-0/+32
As a workaround for the full `#[refine]` semantics not being implemented yet, forbit returning a concrete future type like `Box<dyn Future>` or a manually implemented Future. `-> impl Future` is still permitted; while that can also cause accidental refinement, that's behind a different feature gate (`return_position_impl_trait_in_trait`) and that problem exists regardless of whether the trait method is async, so will have to be solved more generally. Fixes #102745
2022-12-14bail in collect_trait_impl_trait_tys if signatures reference errorsMichael Goulet-0/+2
2022-12-14Guard `AliasTy` creation against passing the wrong number of substsOli Scherer-4/+1
2022-12-13Combine projection and opaque into aliasMichael Goulet-2/+2
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-1/+1
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-7/+7
2022-12-05On E0195 point at where clause lifetime boundsEsteban Küber-11/+40
Fix #104733
2022-12-02Check lifetime param count in collect_trait_impl_trait_tysMichael Goulet-21/+18
2022-11-28Make ObligationCtxt::normalize take cause by borrowMichael Goulet-10/+10
2022-11-23Use ObligationCtxt::normalizeSantiago Pastorino-17/+4
2022-11-22Rollup merge of #104701 - compiler-errors:rpitit-remove-reempty-hack, r=TaKO8KiDylan DPC-11/+1
Remove a lifetime resolution hack from `compare_predicate_entailment` This is not needed anymore, probably due to #102334 equating the function signatures fully in `collect_trait_impl_trait_tys`. Also, the assertion in in #102903 makes sure that this is actually fixed, so I'm pretty confident this isn't needed.
2022-11-22Remove a hack from compare_predicate_entailmentMichael Goulet-11/+1
2022-11-22Delay bug to deduplicate diagnosticsMichael Goulet-8/+10
2022-11-22drive-by: style nitsMichael Goulet-25/+19
2022-11-22Check generics parity between impl and trait before collecting RPITITsMichael Goulet-3/+11
2022-11-19Rollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, ↵Matthias Krüger-3/+1
r=fee1-dead Improve spans for RPITIT object-safety errors No reason why we can't point at the `impl Trait` that causes the object-safety violation. Also [drive-by: Add is_async fn to hir::IsAsync](https://github.com/rust-lang/rust/pull/104593/commits/c4165f3a965e258531928180195637455299c6f3), which touches clippy too.
2022-11-19Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errorsDylan DPC-8/+4
nll: correctly deal with bivariance fixes #104409 when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions. r? types cc ``@RalfJung``
2022-11-19drive-by: Add is_async fn to hir::IsAsyncMichael Goulet-3/+1
2022-11-17Rollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errorsMatthias Krüger-3/+4
Convert predicates into Predicate in the Obligation constructor instead of having almost all callers do that. This reduces a bit of boilerplate, and also paves the way for my work towards https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
2022-11-17Rollup merge of #103852 - compiler-errors:rpitit-early-from-impl, r=lcnrMatthias Krüger-1/+7
Don't remap early-bound regions for return-position `impl Trait` in trait originating from `impl` long title :sweat: We don't want to remap early-bound regions that originate from the `impl`s themselves, since they have no corresponding region in the trait. Not sure if there's a better condition than checking if the EBR's def-id's parent is the impl -- maybe we should be checking if the region comes from the method or RPITIT... :shrug: r? types Fixes #103850
2022-11-16Convert predicates into Predicate in the Obligation constructorOli Scherer-3/+4
2022-11-15use `ocx` type relation routineslcnr-8/+4
2022-11-09Emit error in `collecting_trait_impl_trait_tys` on mismatched signaturesNilstrieb-105/+142
Previously, a `delay_span_bug` was isssued, failing normalization. This create a `TyKind::Error` in the signature, which caused `compare_predicate_entailment` to swallow its signature mismatch error, causing ICEs because no error was emitted.
2022-11-09Auto merge of #103723 - CastilloDel:master, r=jackh726bors-3/+3
Remove allow(rustc::potential_query_instability) in rustc_trait_selection Related to https://github.com/rust-lang/rust/issues/84447 This PR needs to be benchmarked to check for regressions.
2022-11-08Reduce the scope of allow(rustc::potential_query_instability) in ↵CastilloDel-3/+3
rustc_trait_selection Make InferCtxtExt use a FxIndexMap This should be faster, because the map is only being used to iterate, which is supposed to be faster with the IndexMap Make the user_computed_preds use an IndexMap It is being used mostly for iteration, so the change shouldn't result in a perf hit Make the RegionDeps fields use an IndexMap This change could be a perf hit. Both `larger` and `smaller` are used for iteration, but they are also used for insertions. Make types_without_default_bounds use an IndexMap It uses extend, but it also iterates and removes items. Not sure if this will be a perf hit. Make InferTtxt.reported_trait_errors use an IndexMap This change brought a lot of other changes. The map seems to have been mostly used for iteration, so the performance shouldn't suffer. Add FIXME to change ProvisionalEvaluationCache.map to use an IndexMap Right now this results in a perf hit. IndexMap doesn't have the `drain_filter` API, so in `on_completion` we now need to iterate two times over the map.
2022-11-08add 'ty_error_with_guaranteed' and 'const_error_with_guaranteed'yukang-2/+2
2022-11-06Move fallback_has_occurred to FnCtxtMichael Goulet-5/+5
2022-11-04Refactor tcx mk_const parameters.Mateusz-7/+4
2022-11-01Don't remap early-bound RPITIT regions that originate from implMichael Goulet-1/+7
2022-11-01Auto merge of #103590 - compiler-errors:ocx-more, r=lcnrbors-14/+4
(almost) Always use `ObligationCtxt` when dealing with canonical queries Hope this is a step in the right direction. cc rust-lang/types-team#50. r? `@lcnr`
2022-10-27remove _types from ocx method namesMichael Goulet-5/+4
2022-10-27Address some more nitsMichael Goulet-12/+3
2022-10-27Remap early bound lifetimes tooMichael Goulet-1/+1
2022-10-24Delay span bug when we can't map lifetimes back in collect_trait_impl_trait_tysMichael Goulet-2/+10
2022-10-22Introduce subst_iter and subst_iter_copied on EarlyBinderMichael Goulet-12/+4
2022-10-15typosMichael Goulet-9/+9
2022-10-15Equate full fn signatures to infer all region variablesMichael Goulet-13/+33
2022-10-15Fix subst issues with RPITITMichael Goulet-6/+31
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-521/+506
2022-10-07Remove TypeckResults from InferCtxtCameron Steffen-2/+2
2022-10-07Introduce TypeErrCtxtCameron Steffen-9/+10
TypeErrCtxt optionally has a TypeckResults so that InferCtxt doesn't need to.