about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
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
2022-10-07Remove tuple candidate, nothing special about itMichael Goulet-12/+6
2022-10-07Remove `DefId` from some `SelectionCandidate` variantsDeadbeef-19/+18
2022-10-07Rewrite representabilityCameron Steffen-76/+0
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-378/+308
2022-10-07Remove TypeckResults from InferCtxtCameron Steffen-78/+72
2022-10-07Introduce TypeErrCtxtCameron Steffen-322/+316
TypeErrCtxt optionally has a TypeckResults so that InferCtxt doesn't need to.
2022-10-07Check WhereClauseReferencesSelf after all other object safety checksMichael Goulet-13/+15
2022-10-06Auto merge of #99324 - reez12g:issue-99144, r=jyn514bors-1/+0
Enable doctests in compiler/ crates Helps with https://github.com/rust-lang/rust/issues/99144
2022-10-05Validate opaques in default trait bodies, don't normalize unless a body is ↵Michael Goulet-1/+2
provided
2022-10-05Fix test for default body with implMichael Goulet-2/+3
2022-10-04Rollup merge of #102670 - lyming2007:issue-101866-fix, r=compiler-errorsMichael Howell-1/+1
follow-up fix about 101866 to print the self type. modified: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs modified: src/test/ui/error-codes/E0283.stderr modified: src/test/ui/error-codes/E0790.stderr modified: src/test/ui/traits/static-method-generic-inference.stderr modified: src/test/ui/type/issue-101866.stderr
2022-10-05Support default-body trait functions with RPITITMichael Goulet-3/+43
2022-10-04follow-up fix about 101866 to print the self type.Yiming Lei-1/+1
modified: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs modified: src/test/ui/error-codes/E0283.stderr modified: src/test/ui/error-codes/E0790.stderr modified: src/test/ui/traits/static-method-generic-inference.stderr modified: src/test/ui/type/issue-101866.stderr
2022-10-04Rollup merge of #102651 - oli-obk:non_region_things, r=lcnrMatthias Krüger-20/+20
It's not about types or consts, but the lack of regions pulled out of https://github.com/rust-lang/rust/pull/101900 which adds a fourth kind of non-lifetime generic parameter, and the naming of these methods would get ridiculous.
2022-10-04Rollup merge of #102647 - oli-obk:tilde_const_bounds, r=fee1-deadMatthias Krüger-0/+26
Only allow ~const bounds for traits with #[const_trait] r? `@fee1-dead`
2022-10-04Rollup merge of #102488 - compiler-errors:gat-compatibility, r=oli-obkMatthias Krüger-2/+40
Check generic argument compatibility when projecting assoc ty Fixes #102114