about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2022-11-03CleanupsBoxy-0/+1
2022-11-02Rollup merge of #103862 - compiler-errors:ocx-in-fully-normalize, r=spastorinoDylan DPC-18/+9
Use `ObligationCtxt` in `fully_normalize` Simplifies the implementation a bit
2022-11-02Use TraitEngine lessMichael Goulet-11/+11
2022-11-02Use ObligationCtxt in fully_normalizeMichael Goulet-18/+9
2022-11-02Use codegen_select in vtable_trait_upcasting_coercion_new_vptr_slotMichael Goulet-18/+6
2022-11-01Auto merge of #103217 - mejrs:track, r=eholkbors-0/+1
Track where diagnostics were created. This implements the `-Ztrack-diagnostics` flag, which uses `#[track_caller]` to track where diagnostics are created. It is meant as a debugging tool much like `-Ztreat-err-as-bug`. For example, the following code... ```rust struct A; struct B; fn main(){ let _: A = B; } ``` ...now emits the following error message: ``` error[E0308]: mismatched types --> src\main.rs:5:16 | 5 | let _: A = B; | - ^ expected struct `A`, found struct `B` | | | expected due to this -Ztrack-diagnostics: created at compiler\rustc_infer\src\infer\error_reporting\mod.rs:2275:31 ```
2022-11-01Auto merge of #103590 - compiler-errors:ocx-more, r=lcnrbors-10/+49
(almost) Always use `ObligationCtxt` when dealing with canonical queries Hope this is a step in the right direction. cc rust-lang/types-team#50. r? `@lcnr`
2022-11-01Remap RPITIT substs properlyMichael Goulet-0/+7
2022-11-01Check for substs compatibility for RPITITsMichael Goulet-3/+15
2022-10-31Add more track_callermejrs-0/+1
2022-10-31Rollup merge of #103603 - camsteffen:refactor-lang, r=oli-obkDylan DPC-3/+3
Lang item cleanups Various cleanups related to lang items.
2022-10-30Rollup merge of #103726 - TaKO8Ki:avoid-&str-to-string-conversions, ↵Matthias Krüger-6/+6
r=compiler-errors Avoid unnecessary `&str` to `String` conversions
2022-10-29Use LanguageItems::require lessCameron Steffen-1/+1
2022-10-29Improve LanguageItems apiCameron Steffen-2/+2
2022-10-29Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errorsGuillaume Gomez-1/+1
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions` This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3 r? `@compiler-errors`
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-29avoid unnecessary `&str` to `String` conversionsTakayuki Maeda-6/+6
2022-10-27remove _types from ocx method namesMichael Goulet-2/+2
2022-10-27Address some more nitsMichael Goulet-3/+20
2022-10-27(almost) Always use ObligationCtxt when dealing with canonical queriesMichael Goulet-7/+29
2022-10-27Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functionsMaybe Waffle-1/+1
Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions`
2022-10-25Move a wf-check into the site where the value is instantiatedOli Scherer-26/+0
2022-10-23Auto merge of #103345 - Nilstrieb:diag-flat, r=compiler-errorsbors-11/+11
Flatten diagnostic slug modules This makes it easier to grep for the slugs in the code. See https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Localization.20infra.20interferes.20with.20grepping.20for.20error for more discussion about it. This was mostly done with a few regexes and a bunch of manual work. This also exposes a pretty annoying inconsistency for the extra labels. Some of the extra labels are defined as additional properties in the fluent message (which makes them not prefixed with the crate name) and some of them are new fluent messages themselves (which makes them prefixed with the crate name). I don't know whether we want to clean this up at some point but it's useful to know. r? `@davidtwco`
2022-10-23Migrate all diagnosticsNilstrieb-11/+11
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.