about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2022-11-29Rollup merge of #105066 - lcnr:mv-candidate_from_obligation, r=compiler-errorsMatthias Krüger-210/+207
move `candidate_from_obligation` out of assembly it doesn't belong there as it also does winnowing r? `@compiler-errors`
2022-11-29move `candidate_from_obligation` out of assemblylcnr-210/+207
it doesn't belong there as it also does winnowing
2022-11-29Explain why rematch_impl fails to be infallibleMichael Goulet-0/+7
2022-11-29Auto merge of #105012 - WaffleLapkin:into, r=oli-obkbors-4/+2
Make `tcx.mk_const` more permissive wrt `kind` argument (`impl Into`) r? `@oli-obk` you've asked for this >:)
2022-11-29Rollup merge of #104959 - compiler-errors:revert-104269, r=lcnrMatthias Krüger-6/+4
Revert #104269 (to avoid spurious hang/test failure in CI) Causes hangs/memory overflows in the test suite apparently :cry: Reopens #104225 Fixes #104957 r? ``@lcnr``
2022-11-28Simplify checking for `GeneratorKind::Async`Arpad Borsos-12/+3
Adds a helper method around `generator_kind` that makes matching async constructs simpler.
2022-11-28Make ObligationCtxt::normalize take cause by borrowMichael Goulet-8/+7
2022-11-28Make normalize and normalize_to pub(crate)Michael Goulet-6/+8
2022-11-28partially_normalize_... -> At::normalizeMichael Goulet-59/+36
2022-11-28Rename At::normalize to At::query_normalizeMichael Goulet-3/+3
2022-11-28Remove `Const::from_value`Maybe Waffle-3/+1
...it's just `mk_const` but without the sparcles
2022-11-28Simplify calls to `tcx.mk_const`Maybe Waffle-1/+1
`mk_const(ty::ConstKind::X(...), ty)` can now be simplified to `mk_cosnt(..., ty)`. I searched with the following regex: \mk_const\([\n\s]*(ty::)?ConstKind\ I've left `ty::ConstKind::{Bound, Error}` as-is, they seem clearer this way.
2022-11-28Rollup merge of #104907 - compiler-errors:selcx-infcx, r=oli-obkDylan DPC-92/+75
Remove `SelectionContext::infcx()` in favor of field access Encapsulation doesn't seem particularly important here, and having two choices is always more confusing than having one. r? types
2022-11-28Rollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errorsDylan DPC-15/+12
Refactor `ty::ClosureKind` related stuff I've tried to fix all duplication and weirdness, but if I missed something do tell :p r? `@compiler-errors`
2022-11-28Keep track of the start of the argument block of a closureSarthak Singh-20/+15
2022-11-27Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillotMatthias Krüger-3/+3
Prefer doc comments over `//`-comments in compiler Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
2022-11-27Rollup merge of #104931 - Swatinem:async-pretty, r=eholkMatthias Krüger-1/+1
Pretty-print generators with their `generator_kind` After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$async-type@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-3/+3
2022-11-27Use `TyCtxt::is_fn_trait` is a couple more placesMaybe Waffle-2/+1
2022-11-27Add `TyCtxt::is_fn_trait`Maybe Waffle-9/+6
2022-11-27Remove `ty::ClosureKind::from_def_id`Maybe Waffle-6/+7
…in favour of `TyCtxt::fn_trait_kind_from_def_id`
2022-11-27Rename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaningMaybe Waffle-5/+5
2022-11-26Revert "Do not need to account for overflow in predicate_can_apply"Michael Goulet-4/+1
This reverts commit cbe932801892da06688b53638622be1c8a1c8974.
2022-11-26Revert "Drive-by: Don't manually call evaluate_obligation_no_overflow"Michael Goulet-2/+3
This reverts commit a884a9e634b827781e77bddf4082f1196301d86f.
2022-11-26Pretty-print generators with their `generator_kind`Arpad Borsos-1/+1
After removing `GenFuture`, I special-cased async generators to pretty-print as `impl Future<Output = X>` mainly to avoid too much diagnostics changes originally. This now reverses that change so that async fn/blocks are pretty-printed as `[$movability `async` $something@$source-position]` in various diagnostics, and updates the tests that this touches.
2022-11-26Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errorsGuillaume Gomez-2/+2
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
2022-11-25Remove SelectionContext::infcx() in favor of field accessMichael Goulet-92/+75
2022-11-25Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwUbors-237/+206
Add `ConstKind::Expr` Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready. r? `@lcnr`
2022-11-25Auto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgrbors-232/+190
Rollup of 8 pull requests Successful merges: - #104716 (move 2 candidates into builtin candidate) - #104760 (Clarify `SyntaxExtensionKind::LegacyDerive`.) - #104797 (rustc_codegen_ssa: write `.dwp` in a streaming fashion) - #104835 (Use infcx.partially_normalize_associated_types_in) - #104853 (Fix typo in miri sysroot) - #104879 (jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath) - #104887 (rustbuild: Don't build doc::SharedAssets when building JSON docs.) - #104896 (rustdoc: fix broken tooltip CSS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-25Rollup merge of #104835 - ↵Matthias Krüger-28/+25
spastorino:use-partially_normalize_associated_types_in, r=lcnr Use infcx.partially_normalize_associated_types_in r? ``@lcnr``
2022-11-25Rollup merge of #104716 - lcnr:selection-candidate, r=jackh726Matthias Krüger-204/+165
move 2 candidates into builtin candidate having separate candidates for these isn't too helpful i think r? types
2022-11-25Auto merge of #104846 - ↵bors-99/+118
spastorino:santa-clauses-make-goals-early-christmas-🎄, r=oli-obk Branch Clause from Predicate r? `@oli-obk` This is part of what's proposed in https://github.com/rust-lang/compiler-team/issues/531
2022-11-25move 2 candidates into builtin candidatelcnr-204/+165
2022-11-25Rollup merge of #104841 - compiler-errors:fishy-bound-var, r=jackh726Matthias Krüger-24/+25
Assert that we don't capture escaping bound vars in `Fn` trait selection Fixes #104825
2022-11-25only emit "enable gce" error if it would fix compile errorBoxy-8/+17
2022-11-25Make `expand_abstract_consts` infallibleBoxy-30/+19
2022-11-25add FIXME'sBoxy-0/+7
2022-11-25dont skip const evalautable of non unevaluatedsBoxy-6/+1
2022-11-25add FIXME for things that I couldn't find ways to triggerBoxy-3/+5
2022-11-25fmtBoxy-1/+1
2022-11-25also handle it in evaluateBoxy-24/+51
2022-11-25handle assoc consts in fulfill `ConstEquate`Boxy-23/+27
2022-11-25fmtBoxy-16/+18
2022-11-25handle nested obligations in `satisfied_from_param_env`Boxy-37/+47
2022-11-25Add expand_abstract_constkadmin-74/+53
Adds the ability to directly expand a const to an expr without having to deal with intermediate steps.
2022-11-25Add empty ConstKind::Abstractkadmin-196/+141
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-69/+97
2022-11-25Simplify a bunch of trait ref obligation creationsOli Scherer-9/+4
2022-11-25get rid of to_poly_trait_predicateOli Scherer-21/+17
2022-11-24Remove comment, simplify since we asserted fn ptr Self type has no bound varsMichael Goulet-10/+1