summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits
AgeCommit message (Collapse)AuthorLines
2022-12-11revert-overflowouz-a-15/+0
2022-11-20Revert "Normalize opaques with escaping bound vars"Michael Goulet-2/+2
This reverts commit 43119d643857efc366bfca527ac2dadfc3f2e906.
2022-11-15Use `nominal_obligations_without_const` in wf for FnDefDeadbeef-1/+1
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-3/+5
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-25Move a wf-check into the site where the value is instantiatedOli Scherer-26/+0
2022-10-23Rollup merge of #103368 - compiler-errors:normalization-ambiguity-bug, r=oli-obkMatthias Krüger-2/+19
Delay ambiguity span bug in normalize query iff not rustdoc Oli and I decided that the compiler debt of adding another usage of `tcx.sess.opts.actually_rustdoc` is fine, because we don't really want to add more complexity to the normalize query, and moving rustdoc to use fulfill normalization (`fully_normalize`, i.e. not use the normalize query) is unnecessary overhead given that it's skipping binders and stuff. r? oli-obk Fixes #102827 Fixes #103181
2022-10-23Rollup merge of #103328 - compiler-errors:trivial-false-const-sugg, r=jackh726Matthias Krüger-5/+7
Do not suggest trivially false const predicates Pass through constness to `predicate_can_apply` and don't suggest other impls if it's satisfied but not const. Fixes #103267
2022-10-22Auto merge of #103227 - lcnr:bye-bye-unevaluated-const, r=oli-obkbors-53/+28
stop using `ty::UnevaluatedConst` directly best reviewed commit by commit. simplifies #99798 because we now don't have to expand `ty::UnevaluatedConst` to `ty::Const`. I also remember some other places where using `ty::UnevaluatedConst` directly was annoying and caused issues, though I don't quite remember what they were rn '^^ r? `@oli-obk` cc `@JulianKnodt`
2022-10-21Delay ambiguity span bug in normalize query iff not rustdocMichael Goulet-2/+19
2022-10-21fix some typosRageking8-1/+1
2022-10-20Do not suggest trivially false const predicatesMichael Goulet-5/+7
2022-10-19Don't call `own_existential_vtable_entries` on unresolved trait refMichael Goulet-17/+6
2022-10-19stop folding `UnevaluatedConst`lcnr-14/+4
2022-10-19instantiate -> constructMichael Goulet-2/+2
2022-10-19Generalize call suggestion for unsatisfied predicateMichael Goulet-46/+123
2022-10-19Standardize arg suggestions between typeck and trait selectionMichael Goulet-50/+56
2022-10-19Use predicate_must_hold_modulo_regionsMichael Goulet-14/+8
2022-10-19Suggest calling ctor when trait is unimplementedMichael Goulet-1/+18
2022-10-18`const_evaluatable_unchecked` to const evallcnr-21/+1
2022-10-18change `ConstEvaluatable` to use `ty::Const`lcnr-18/+23
2022-10-18Rollup merge of #103142 - fmease:fix-103052, r=oli-obkYuki Okushi-0/+4
Make diagnostic for unsatisfied `Termination` bounds more precise Don't blindly emit a diagnostic claiming that “*`main` has an invalid return type*” if we encounter a type that should but doesn't implement `std::process::Termination` and isn't actually the return type of the program entry `main`. Fixes #103052. ``@rustbot`` label A-diagnostics T-compiler T-libs r? diagnostics
2022-10-17Auto merge of #103151 - matthiaskrgr:rollup-t3mmnsg, r=matthiaskrgrbors-24/+27
Rollup of 4 pull requests Successful merges: - #102454 (Suggest parentheses for possible range method calling) - #102466 (only allow `ConstEquate` with `feature(gce)`) - #102945 (Do not register placeholder `RegionOutlives` obligations when `considering_regions` is false) - #103091 (rustdoc: remove unused HTML class `sidebar-title`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-17Rollup merge of #102945 - compiler-errors:placeholder-region-outlives, r=lcnrMatthias Krüger-1/+1
Do not register placeholder `RegionOutlives` obligations when `considering_regions` is false **NOTE:** I'm kinda just putting this up for discussion. I'm not certain this is correct...? This was introduced in [`608625d`](https://github.com/rust-lang/rust/commit/608625dae95cde00e4570eb6c2d63b2244bbf34c#diff-6e54b18681342ec725d75591dbf384ad08cd73df29db00485fe51b4e90f76ff7R361). Interestingly, we only check `data.has_placeholders()` for `RegionOutlives`, and not for `TypeOutlives`... why? For the record, that different treatment between `RegionOutlives` and `TypeOutlives` is why the fix "The compiling succeeds when all `'a : 'b` are replaced with `&'a () : 'b`" in #100689 _"works"_, but it seems like an implementation detail considering this. Also, why do we care about placeholder regions being registered if `considering_regions` is false? It doesn't seem to affect any UI tests, for example. r? `@lcnr` Fixes #102899 Fixes #100689
2022-10-17Rollup merge of #102466 - lcnr:const-equate-uwu, r=BoxyUwUMatthias Krüger-23/+26
only allow `ConstEquate` with `feature(gce)`
2022-10-17Make diagnostic for unsatisfied Termination bounds more preciseLeón Orell Valerian Liehr-0/+4
2022-10-17mir constants: type traversing bye byelcnr-8/+0
2022-10-16Auto merge of #102334 - compiler-errors:rpitit-substs-issue, r=cjgillotbors-1/+4
Fix subst issues with return-position `impl Trait` in trait 1. Fix an issue where we were rebase impl substs onto trait method substs, instead of trait substs 2. Fix an issue where early-bound regions aren't being mapped correctly for RPITIT hidden types Fixes #102301 Fixes #102310 Fixes #102334 Fixes #102918
2022-10-16Auto merge of #102931 - camsteffen:inline-overlapping-impls, r=cjgillotbors-41/+29
Make `overlapping_impls` not generic Trying to win back perf from #101632.
2022-10-15Fix subst issues with RPITITMichael Goulet-1/+4
2022-10-15Rollup merge of #103003 - TaKO8Ki:fix-102989, r=compiler-errorsDylan DPC-13/+9
Fix `suggest_floating_point_literal` ICE Fixes #102989
2022-10-14Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8KiDylan DPC-3/+3
More dupe word typos I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
2022-10-14more dupe word typosRageking8-3/+3
2022-10-14check if the self type is `ty::Float` before getting second substsTakayuki Maeda-13/+9
2022-10-13Make overlapping_impls non-genericCameron Steffen-41/+29
This improves perf
2022-10-13Sort elaborated existential predicates in object_ty_for_traitMichael Goulet-11/+18
2022-10-12Auto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakisbors-3/+45
Support default-body trait functions with return-position `impl Trait` in traits Introduce a new `Trait` candidate kind for the `ImplTraitInTrait` projection candidate, which just projects an RPITIT down to its opaque type form. This is a hack until we lower RPITITs to regular associated types, after which we will need to rework how these default bodies are type-checked, so comments are left in a few places for us to clean up later. Fixes #101665
2022-10-12Do not register placeholder region outlives when considering_regions is falseMichael Goulet-1/+1
2022-10-11Auto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgrbors-0/+68
Rollup of 6 pull requests Successful merges: - #101360 (Point out incompatible closure bounds) - #101789 (`let`'s not needed in struct field definitions) - #102846 (update to syn-1.0.102) - #102871 (rustdoc: clean up overly complex `.trait-impl` CSS selectors) - #102876 (suggest candidates for unresolved import) - #102888 (Improve rustdoc-gui search-color test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-10Rollup merge of #101360 - compiler-errors:multiple-closure-bounds, ↵Matthias Krüger-0/+68
r=petrochenkov Point out incompatible closure bounds Fixes #100295
2022-10-10Fix compiler docsGuillaume Gomez-7/+8
2022-10-10Rollup merge of #102786 - compiler-errors:no-tuple-candidate, r=lcnrDylan DPC-12/+6
Remove tuple candidate, nothing special about it r? `@lcnr` you mentioned this during the talk you gave i think
2022-10-10Point out incompatible closure boundsMichael Goulet-0/+68
2022-10-10Rollup merge of #102845 - cjgillot:gat-object, r=fee1-deadYuki Okushi-29/+15
Elaborate trait ref to compute object safety. instead of building them manually from supertraits and associated items. This allows to have the correct substs for GATs. Fixes https://github.com/rust-lang/rust/issues/102751
2022-10-10Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8KiYuki Okushi-2/+2
rename `ImplItemKind::TyAlias` to `ImplItemKind::Type` The naming of this variant seems inconsistent given that this is not really a "type alias", and the associated type variant for `TraitItemKind` is just called `Type`.
2022-10-09Elaborate trait ref to compute object safety.Camille GILLOT-29/+15
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-2/+2
2022-10-08Auto merge of #102809 - matthiaskrgr:rollup-qq62vuv, r=matthiaskrgrbors-19/+18
Rollup of 8 pull requests Successful merges: - #101520 (Allow transmutes between the same types after erasing lifetimes) - #102675 (Remove `mir::CastKind::Misc`) - #102778 (Fix MIR inlining of asm_unwind) - #102785 (Remove `DefId` from some `SelectionCandidate` variants) - #102788 (Update rustc-dev-guide) - #102789 (Update browser UI test version) - #102797 (rustdoc: remove no-op CSS `.rightside { position: initial }`) - #102798 (rustdoc: add main-heading and example-wrap link CSS to big selector) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-08Rollup merge of #102785 - fee1-dead-contrib:rm_autoimpl_defid, r=compiler-errorsMatthias Krüger-19/+18
Remove `DefId` from some `SelectionCandidate` variants They are both from `obligation.predicate.def_id()`, which do not need to be on the `SelectionCandidate`. cc ````@lcnr```` ````@compiler-errors````
2022-10-08Auto merge of #100720 - camsteffen:representable, r=cjgillotbors-76/+0
Rewrite representability * Improve placement of `Box` in the suggestion * Multiple items in a cycle emit 1 error instead of an error for each item in the cycle * Introduce `representability` query to avoid traversing an item every time it is used. * Also introduce `params_in_repr` query to avoid traversing generic items every time it is used.
2022-10-07Auto merge of #102787 - Dylan-DPC:rollup-fvbb4t9, r=Dylan-DPCbors-13/+15
Rollup of 6 pull requests Successful merges: - #102300 (Use a macro to not have to copy-paste `ConstFnMutClosure::new(&mut fold, NeverShortCircuit::wrap_mut_2_imp)).0` everywhere) - #102475 (unsafe keyword: trait examples and unsafe_op_in_unsafe_fn update) - #102760 (Avoid repeated re-initialization of the BufReader buffer) - #102764 (Check `WhereClauseReferencesSelf` after all other object safety checks) - #102779 (Fix `type_of` ICE) - #102780 (run Miri CI when std::sys changes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup