about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2022-11-10More nitsMichael Goulet-4/+1
2022-11-10make `Sized` coinductivelcnr-1/+4
2022-11-10Rollup merge of #103863 - compiler-errors:fulfillcx-less, r=wesleywiserManish Goregaokar-9/+10
Use `TraitEngine` in more places, restrict visibility of `FulfillmentCtxt` constructor Most places that are constructing a `FulfillmentContext` should be constructing a `TraitEngine` generically, so later on if/when we're transitioning it'll be easier. Logical extension of #99746
2022-11-09Rollup merge of #102763 - compiler-errors:nits, r=cjgillotMichael Goulet-1/+1
Some diagnostic-related nits 1. Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` 2. Make `diag.span_suggestions` take an `IntoIterator` instead of `Iterator`, just to remove some `.into_iter` calls on the caller. idk if I should add a lint to make sure people use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` in cases where we're just, e.g., adding subdiagnostics to the diagnostic... maybe a followup.
2022-11-10Use TraitEngine in more places, make FulfillmentCtxt constructor more privateMichael Goulet-9/+10
2022-11-09Rollup merge of #104156 - oli-obk:autoderef, r=estebankManish Goregaokar-8/+0
Cleanups in autoderef impl Just something I noticed. Turns out the `overloaded_span` is not actually used separately from the main span, so I merged them.
2022-11-09Make span_suggestions take IntoIteratorMichael Goulet-1/+1
2022-11-09Auto merge of #103723 - CastilloDel:master, r=jackh726bors-18/+24
Remove allow(rustc::potential_query_instability) in rustc_trait_selection Related to https://github.com/rust-lang/rust/issues/84447 This PR needs to be benchmarked to check for regressions.
2022-11-09Auto merge of #104180 - fee1-dead-contrib:fix-wf-fndef, r=oli-obkbors-1/+1
Use `nominal_obligations_without_const` in wf for FnDef Fixes #104155.
2022-11-09Auto merge of #104179 - Manishearth:rollup-yvsx5hh, r=Manishearthbors-3/+22
Rollup of 7 pull requests Successful merges: - #100508 (avoid making substs of type aliases late bound when used as fn args) - #101381 (Test that target feature mix up with homogeneous floats is sound) - #103353 (Fix Access Violation when using lld & ThinLTO on windows-msvc) - #103521 (Avoid possible infinite loop when next_point reaching the end of file) - #103559 (first move on a nested span_label) - #103778 (Update several crates for improved support of the new targets) - #103827 (Properly remap and check for substs compatibility in `confirm_impl_trait_in_trait_candidate`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-09Use `nominal_obligations_without_const` in wf for FnDefDeadbeef-1/+1
2022-11-08Rollup merge of #103827 - compiler-errors:rpitit-substs-compat, r=wesleywiserManish Goregaokar-3/+22
Properly remap and check for substs compatibility in `confirm_impl_trait_in_trait_candidate` Fixes #103824
2022-11-09Auto merge of #103171 - jackh726:gen-interior-hrtb-error, r=cjgillotbors-0/+1
Better error for HRTB error from generator interior cc #100013 This is just a first pass at an error. It could be better, and shouldn't really be emitted in the first place. But this is better than what was being emitted before.
2022-11-08Reduce the scope of allow(rustc::potential_query_instability) in ↵CastilloDel-18/+24
rustc_trait_selection Make InferCtxtExt use a FxIndexMap This should be faster, because the map is only being used to iterate, which is supposed to be faster with the IndexMap Make the user_computed_preds use an IndexMap It is being used mostly for iteration, so the change shouldn't result in a perf hit Make the RegionDeps fields use an IndexMap This change could be a perf hit. Both `larger` and `smaller` are used for iteration, but they are also used for insertions. Make types_without_default_bounds use an IndexMap It uses extend, but it also iterates and removes items. Not sure if this will be a perf hit. Make InferTtxt.reported_trait_errors use an IndexMap This change brought a lot of other changes. The map seems to have been mostly used for iteration, so the performance shouldn't suffer. Add FIXME to change ProvisionalEvaluationCache.map to use an IndexMap Right now this results in a perf hit. IndexMap doesn't have the `drain_filter` API, so in `on_completion` we now need to iterate two times over the map.
2022-11-08Remove an unused spanOli Scherer-10/+0
2022-11-08Remove overloaded_span argument from `new`, where it is usually redundant ↵Oli Scherer-3/+5
with the main span
2022-11-08delay errors as buglcnr-2/+2
2022-11-08selection failure: recompute applicable implslcnr-43/+95
2022-11-08Auto merge of #104063 - compiler-errors:ct-norm-unless, r=jackh726bors-1/+5
Don't normalize constants unless they need normalization Maybe makes normalization a bit faster when we have many constants in a type r? `@ghost`
2022-11-08Rollup merge of #104094 - lcnr:on_unimplemented-move, r=wesleywiserDylan DPC-409/+400
fully move `on_unimplemented` to `error_reporting` the `traits` module has a few too many submodules in my opinion.
2022-11-08Rollup merge of #103865 - compiler-errors:fallback-has-occurred-tracking, ↵Dylan DPC-11/+4
r=eholk Move `fallback_has_occurred` state tracking to `FnCtxt` Removes a ton of callsites that defaulted to `false`
2022-11-07Add an optional Span to BrAnon and use it to print better error for HRTB ↵Jack Huey-0/+1
error from generator interior
2022-11-07fully move `on_unimplemented` to error reportinglcnr-409/+400
2022-11-07Don't normalize constants unless they need normalizationMichael Goulet-1/+5
2022-11-06Auto merge of #99943 - compiler-errors:tuple-trait, r=jackh726bors-7/+23
Implement `std::marker::Tuple`, use it in `extern "rust-call"` and `Fn`-family traits Implements rust-lang/compiler-team#537 I made a few opinionated decisions in this implementation, specifically: 1. Enforcing `extern "rust-call"` on fn items during wfcheck, 2. Enforcing this for all functions (not just ones that have bodies), 3. Gating this `Tuple` marker trait behind its own feature, instead of grouping it into (e.g.) `unboxed_closures`. Still needing to be done: 1. Enforce that `extern "rust-call"` `fn`-ptrs are well-formed only if they have 1/2 args and the second one implements `Tuple`. (Doing this would fix ICE in #66696.) 2. Deny all explicit/user `impl`s of the `Tuple` trait, kinda like `Sized`. 3. Fixing `Tuple` trait built-in impl for chalk, so that chalkification tests are un-broken. Open questions: 1. Does this need t-lang or t-libs signoff? Fixes #99820
2022-11-06Auto merge of #103861 - compiler-errors:codegen-select-in-vtable-slot, r=nagisabors-18/+6
Use `codegen_select` in `vtable_trait_upcasting_coercion_new_vptr_slot` A super tiny clean up
2022-11-06Move fallback_has_occurred to FnCtxtMichael Goulet-11/+4
2022-11-06Auto merge of #103975 - oli-obk:tracing, r=jackh726bors-40/+10
Some tracing and comment cleanups Pulled out of https://github.com/rust-lang/rust/pull/101900 to see if that is the perf impact
2022-11-05Bless chalk testsMichael Goulet-1/+2
2022-11-05Adjust diagnostics, bless testsMichael Goulet-6/+20
2022-11-05Enforce rust-check ABI in signatures, callsMichael Goulet-1/+2
2022-11-05Rollup merge of #103984 - V0ldek:103974-refactor-mk_const, r=BoxyUwUMatthias Krüger-12/+7
Refactor tcx mk_const parameters. Unroll the `ty::ConstS` parameter to `TyCtxt::mk_const` into separate `ty::ConstKind` and `Ty` parameters. Signature change is in: https://github.com/V0ldek/rust/blob/c97fd8183a98d6a89b8fc2e02eb068298e6fb7dc/compiler/rustc_middle/src/ty/context.rs#L2234 and https://github.com/V0ldek/rust/blob/c97fd8183a98d6a89b8fc2e02eb068298e6fb7dc/compiler/rustc_middle/src/ty/context.rs#L2572-L2575 the rest is callsites. Closes #103974 r? `@oli-obk`
2022-11-05Rollup merge of #103868 - compiler-errors:trait-engine-less, r=jackh726Matthias Krüger-11/+11
Use `TraitEngine` (by itself) less Replace `TraitEngine` in favor of `ObligationCtxt` or `fully_solve_*`, improving code readability.
2022-11-04Refactor tcx mk_const parameters.Mateusz-12/+7
2022-11-04Some tracing and comment cleanupsOli Scherer-40/+10
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`