about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
AgeCommit message (Collapse)AuthorLines
2023-01-30Rollup merge of #107146 - compiler-errors:unsizing-params, r=cjgillotDylan DPC-44/+10
Make `unsizing_params_for_adt` into a query Addresses a FIXME in confirmation. r? ``@ghost``
2023-01-29Auto merge of #106253 - nbdd0121:upcast, r=compiler-errorsbors-19/+38
Skip possible where_clause_object_safety lints when checking `multiple_supertrait_upcastable` Fix #106247 To achieve this, I lifted the `WhereClauseReferencesSelf` out from `object_safety_violations` and move it into `is_object_safe` (which is changed to a new query). cc `@dtolnay` r? `@compiler-errors`
2023-01-28Make unsizing_params_for_adt into a queryMichael Goulet-44/+10
2023-01-28Auto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkinbors-9/+6
Remove HirId -> LocalDefId map from HIR. Having this map in HIR prevents the creating of new definitions after HIR has been built. Thankfully, we do not need it. Based on https://github.com/rust-lang/rust/pull/103902
2023-01-28Rename `is_object_safe` to `check_is_object_safe` to hint side effectsGary Guo-7/+10
2023-01-28Make `is_object_safe` a query and move lint_object_unsafe_trait call thereGary Guo-14/+32
2023-01-28Replace `object_safety_violations().is_empty()` calls with `is_object_safe`Gary Guo-3/+1
2023-01-28Remove `HirId -> LocalDefId` map from HIR.Camille GILLOT-9/+6
2023-01-28Rollup merge of #107306 - ↵Matthias Krüger-10/+20
compiler-errors:correct-sugg-for-closure-arg-needs-borrow, r=oli-obk Correct suggestions for closure arguments that need a borrow Fixes #107301 by dealing with binders correctly Fixes another issue where we were suggesting adding just `&` when we expected `&mut _` in a closure arg
2023-01-28Rollup merge of #107103 - compiler-errors:new-solver-evaluate_obligation, r=lcnrMatthias Krüger-6/+37
Use new solver in `evaluate_obligation` query (when new solver is enabled) (only when `-Ztrait-solver=next`, of course) ... Does this make sense? It seems to me like it should be reasonable, but maybe there's some reason why this is a bad idea. r? ``@lcnr`` Needs a perf run because I guess this `solver == TraitSolver::Next` check is on a hot path.
2023-01-27Pacify tidy.Camille GILLOT-5/+5
2023-01-27Restrict amount of ignored locals.Camille GILLOT-1/+1
2023-01-27Compute generator saved locals on MIR.Camille GILLOT-9/+177
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-3/+24
2023-01-27Separate trait selection from ambiguity reporting.Camille GILLOT-17/+2
2023-01-27Do not abort compilation when failing to normalize opaque types.Camille GILLOT-11/+43
2023-01-27Use now solver in evaluate_obligationMichael Goulet-6/+37
2023-01-27Auto merge of #107055 - kylematsuda:eb-fn-sig, r=lcnrbors-1/+1
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-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-26Use new solver during selectionMichael Goulet-14/+43
2023-01-26Rollup merge of #107272 - compiler-errors:new-solver-more-predicates, r=lcnrMatthias Krüger-2/+30
Implement ObjectSafe and WF in the new solver r? ``@lcnr``
2023-01-25Don't normalize obligations in WF goal for the new solverMichael Goulet-2/+30
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-23Point at specific field in struct literal when trait fulfillment failsNathan Fenner-1/+3
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-22Store relationships on InherentSantiago Pastorino-83/+5
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-19Encode whether foreign opaques are TAITs or notMichael Goulet-1/+1
2023-01-19Don't treat closures from other crates as localOli Scherer-22/+20
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-24/+24
Switching them to `Break(())` and `Continue(())` instead. libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-17Rollup merge of #106970 - kylematsuda:earlybinder-item-bounds, r=lcnrMatthias Krüger-6/+5
Switch to `EarlyBinder` for `item_bounds` 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`. This adds `EarlyBinder` to the return type of the `item_bounds` query and removes `bound_item_bounds`. r? `@lcnr`
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-17/+17
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17change item_bounds query to return EarlyBinder; remove bound_item_bounds queryKyle Matsuda-6/+5
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-17/+17
2023-01-17Untouch back perf sensetive code :sweat_smile:Maybe Waffle-5/+7
2023-01-17Review suggestionsMaybe Waffle-1/+1
2023-01-17Don't call closures immediately, use `try{}` blocksMaybe Waffle-17/+15
2023-01-15Tweak E0597Esteban Küber-1/+1
CC #99430