about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
2023-01-27Use now solver in evaluate_obligationMichael Goulet-6/+37
2023-01-27Auto merge of #107372 - JohnTitor:rollup-zkl2ges, r=JohnTitorbors-13/+11
Rollup of 9 pull requests Successful merges: - #106806 (Replace format flags u32 by enums and bools.) - #107194 (Remove dependency on slice_internals feature in rustc_ast) - #107234 (Revisit fix_is_ci_llvm_available logic) - #107316 (Update snap from `1.0.1` to `1.1.0`) - #107321 (solver comments + remove `TyCtxt::evaluate_goal`) - #107332 (Fix wording from `rustbuild` to `bootstrap`) - #107347 (reduce rightward-drift) - #107352 (compiler: Fix E0587 explanation) - #107357 (Fix infinite loop in rustdoc get_all_import_attributes function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-28Rollup merge of #107321 - lcnr:comment, r=compiler-errorsYuki Okushi-13/+11
solver comments + remove `TyCtxt::evaluate_goal` from the `RustcContributor::explore` session yesterday. This also removes `TyCtxt::evaluate_goal` because to canonicalize you have to use an `InferCtxt` anyways at which point we should just always get people to use `evaluate_root_goal`. r? ``@spastorino``
2023-01-27Auto merge of #107055 - kylematsuda:eb-fn-sig, r=lcnrbors-2/+2
Switch to `EarlyBinder` for `fn_sig` query Part of the work to finish #105779 (also see https://github.com/rust-lang/types-team/issues/78). Several queries `X` have a `bound_X` variant that wraps the output in [`EarlyBinder`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/subst/struct.EarlyBinder.html). This adds `EarlyBinder` to the return type of the `fn_sig` query and removes `bound_fn_sig`. r? `@lcnr`
2023-01-27assert that solver results are stablelcnr-8/+46
2023-01-27small refactor to new projection codelcnr-37/+40
2023-01-26fixup new usages of fn_sig, bound_fn_sig after rebasingKyle Matsuda-1/+1
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-1/+1
EarlyBinder to fn_sig in metadata
2023-01-26replace usages of fn_sig query with bound_fn_sigKyle Matsuda-1/+1
2023-01-26Make make_identity take CanonicalVarInfosMichael Goulet-21/+2
2023-01-26Intern CanonicalVarValuesMichael Goulet-22/+19
2023-01-26Use new solver during selectionMichael Goulet-14/+43
2023-01-26solver comments + remove `TyCtxt::evaluate_goal`lcnr-13/+11
2023-01-26Rollup merge of #107286 - compiler-errors:new-solver-deny-infers, r=lcnrMatthias Krüger-22/+33
ICE in new solver if we see an inference variable By construction, we do not expect to see any `ty::Infer(ty::TyVar(_))` inference types in the solver (we treat this as ambiguous, since we need to be able to structurally resolve the self type at least one layer to assemble candidates for it). Additionally, since we're doing no freshening, we also don't expect to see any fresh vars of any kind in the solver. Let's make that an ICE so we can catch any mistakes. When #107282 lands, we should also ICE there too if we see a non-int/float infer. r? `@lcnr`
2023-01-26Rollup merge of #107285 - compiler-errors:new-solver-future-and-generator, ↵Matthias Krüger-11/+184
r=lcnr Implement `Generator` and `Future` in the new solver r? `@lcnr`
2023-01-26Rollup merge of #107272 - compiler-errors:new-solver-more-predicates, r=lcnrMatthias Krüger-6/+63
Implement ObjectSafe and WF in the new solver r? ``@lcnr``
2023-01-26ICE in new solver if we see an inference variableMichael Goulet-22/+33
2023-01-26Implement Generator and FutureMichael Goulet-1/+127
2023-01-26Report the right fulfillment errorsMichael Goulet-10/+57
2023-01-25Don't normalize obligations in WF goal for the new solverMichael Goulet-7/+31
2023-01-25Implement ObjectSafe and WF in the new solverMichael Goulet-4/+37
2023-01-25Rollup merge of #107282 - BoxyUwU:erica_builtin_pointee_impls, r=compiler-errorsMatthias Krüger-0/+105
erica solver: implement builtin `Pointee` trait impl candidates r? ```@compiler-errors```
2023-01-25Rollup merge of #106897 - estebank:issue-99430, r=davidtwcoMatthias Krüger-1/+1
Tweak E0597 CC #99430
2023-01-25Suggest mutable borrows correctlyMichael Goulet-8/+18
2023-01-25Liberate late-bound regions correctlyMichael Goulet-2/+2
2023-01-25Auto merge of #103902 - vincenzopalazzo:macros/obligation_rulesv2, r=oli-obkbors-73/+60
use `LocalDefId` instead of `HirId` in trait resolution to simplify the obligation clause resolution This commit introduces a refactoring suggested by `@lcnr` to simplify the obligation clause resolution. This is just the first PR that introduces a type of refactoring, but others PRs will follow this to introduce name changing to change from the variable name from `body_id` to something else. Fixes https://github.com/rust-lang/rust/issues/104827 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com> `@rustbot` r? `@lcnr`
2023-01-25Rollup merge of #107227 - lcnr:solver-new-external-api, r=compiler-errorsDylan DPC-17/+32
`new_outside_solver` -> `evaluate_root_goal` r? ```@rust-lang/initiative-trait-system-refactor```
2023-01-24no without_constnessBoxy-2/+1
2023-01-24sorry ericaBoxy-1/+1
2023-01-24implement builtin candidateBoxy-0/+106
2023-01-23Point at specific field in struct literal when trait fulfillment failsNathan Fenner-1/+3
2023-01-23`new_outside_solver` -> `evaluate_root_goal`lcnr-17/+32
2023-01-23fix: use LocalDefId instead of HirId in trait resVincenzo Palazzo-73/+60
use LocalDefId instead of HirId in trait resolution to simplify the obligation clause resolution Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-23Rollup merge of #107101 - compiler-errors:perf-106309-1, r=petrochenkovYuki Okushi-2/+2
Filter param-env predicates for errors before calling `to_opt_poly_trait_pred` cc #106309 https://github.com/rust-lang/rust/pull/106757#issuecomment-1396616318 r? `@ghost`
2023-01-23Rollup merge of #104926 - spastorino:calculate_diverging_fallback-cleanups, ↵Dylan DPC-89/+5
r=lcnr Move relationships from FulfillmentContext to Inherited r? `@lcnr`
2023-01-22Store relationships on InherentSantiago Pastorino-89/+5
2023-01-21Address goal nitsMichael Goulet-38/+54
2023-01-21Implement some more predicatesMichael Goulet-7/+57
2023-01-20Rollup merge of #107061 - compiler-errors:new-solver-new-candidates-3, r=lcnrMichael Goulet-20/+202
Implement some more new solver candidates and fix some bugs First, fix some bugs: 1. `IndexVec::drain_enumerated(a..b)` does not give us an iterator of index keys + items enumerated from `a..b`, but from `0..(b-a)`... That caused a bug. See first commit for the fix. 2. Implement the `_: Trait` ambiguity hack. I put it in assemble, let me know if it should live elsewhere. This is important, since we otherwise consider `_: Sized` to have no solutions, and nothing passes! 3. Swap `Ambiguity` and `Unimplemented` cases for the new solver. Sorry for accidentally swapping them 😄 4. Check GATs' own predicates during projection confirmation. Then implement a few builtin traits: 5. Implement `PointerSized`. Pretty independent. 6. Implement `Fn` family of traits for fnptr, fndef, and closures. Closures are currently broken because `FulfillCtxt::relationships` is intentionally left unimplemented. See comment in the test. r? ```@lcnr```
2023-01-20Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnrbors-23/+70
Check ADT fields for copy implementations considering regions Fixes #88901 r? `@ghost`
2023-01-20Auto merge of #107106 - matthiaskrgr:rollup-g7r1ep0, r=matthiaskrgrbors-8/+26
Rollup of 6 pull requests Successful merges: - #106699 ([drop tracking] Visit break expressions ) - #106738 (Fix known-bug annotations) - #106891 (Tweak "borrow closure argument" suggestion) - #106928 (add raw identifier for keyword in suggestion) - #107065 (Clippy: Make sure to include in beta: Move `unchecked_duration_subtraction` to pedantic) - #107068 (autoderive Subdiagnostic for AddtoExternBlockSuggestion) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-20Auto merge of #107105 - matthiaskrgr:rollup-rkz9t7r, r=matthiaskrgrbors-22/+20
Rollup of 8 pull requests Successful merges: - #106783 (Recover labels written as identifiers) - #106973 (Don't treat closures from other crates as local) - #106979 (Document how to get the type of a default associated type) - #107053 (signal update string representation for haiku.) - #107058 (Recognise double-equals homoglyph) - #107067 (Custom MIR: Support storage statements) - #107076 (Added const-generic ui test case for issue #106419) - #107091 (Fix broken format strings in `infer.ftl`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-20Rollup merge of #106891 - estebank:issue-45727, r=petrochenkovMatthias Krüger-8/+26
Tweak "borrow closure argument" suggestion Fix #45727.
2023-01-20Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnrMatthias Krüger-22/+20
Don't treat closures from other crates as local fixes #104817 r? `@lcnr` Specialization can prefer an impl for an opaque type over a blanket impls that also matches. If the blanket impl only applies if an auto-trait applies, we look at the hidden type of the opaque type to see if that implements the auto trait. The hidden type can be a closure or generator, and thus we will end up seeing these types in coherence and have to handle them properly.
2023-01-20Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstriebbors-9/+9
Remove some `ref` patterns from the compiler Previous PR: https://github.com/rust-lang/rust/pull/105368 r? `@Nilstrieb`
2023-01-20Filter predicates first for fast-path type flagsMichael Goulet-2/+2
2023-01-19Tweak "borrow closure argument" suggestionEsteban Küber-8/+26
Fix #45727.
2023-01-19trait solver: Implement Fn traits and tuple traitMichael Goulet-7/+142
2023-01-19trait solver: PointerSizedMichael Goulet-2/+39
2023-01-19swap Ambiguity and Unimplemented in new trait engineMichael Goulet-2/+4