about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
AgeCommit message (Collapse)AuthorLines
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`
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