about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
AgeCommit message (Collapse)AuthorLines
2022-11-15use `ocx` type relation routineslcnr-7/+19
2022-11-15Rollup merge of #104316 - cjgillot:simplify-async-suggestion, r=estebankMatthias Krüger-51/+42
Simplify suggestions for errors in generators. Split from https://github.com/rust-lang/rust/pull/101692/
2022-11-15Auto merge of #104428 - matthiaskrgr:rollup-jo3078i, r=matthiaskrgrbors-35/+8
Rollup of 13 pull requests Successful merges: - #103842 (Adding Fuchsia compiler testing script, docs) - #104354 (Remove leading newlines from `NonZero*` doc examples) - #104372 (Update compiler-builtins) - #104380 (rustdoc: remove unused CSS `code { opacity: 1 }`) - #104381 (Remove dead NoneError diagnostic handling) - #104383 (Remove unused symbols and diagnostic items) - #104391 (Deriving cleanups) - #104403 (Specify language of code comment to generate document) - #104404 (Fix missing minification for static files) - #104413 ([llvm-wrapper] adapt for LLVM API change) - #104415 (rustdoc: fix corner case in search keyboard commands) - #104422 (Fix suggest associated call syntax) - #104426 (Add test for #102154) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-14Rollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwcoMatthias Krüger-81/+78
Don't print full paths in overlap errors We don't print the full path in other diagnostics -- I don't think it particularly helps with the error message. I also delayed the printing until actually needing to render the error message. r? diagnostics
2022-11-13Remove dead NoneError error handlingmejrs-35/+8
2022-11-13Store a LocalDefId in hir::GenericParam.Camille GILLOT-3/+2
2022-11-12Simplify suggestions for errors in generators.Camille GILLOT-51/+42
2022-11-12Rollup merge of #104206 - compiler-errors:ocx-more-2, r=lcnrDylan DPC-26/+24
Remove `save_and_restore_in_snapshot_flag`, use `ObligationCtxt` more r? ```@lcnr```
2022-11-12Rollup merge of #103970 - oli-obk:unhide_unknown_spans, r=estebankDylan DPC-2/+2
Unhide unknown spans r? ```@estebank```
2022-11-11Don't add message that will never be shown to usersOli Scherer-2/+2
It will still be used in json, as seen by the ui test changes
2022-11-10Unbreak upcastingMichael Goulet-3/+7
2022-11-10Don't CoerceUnsized dyn* to dyn*Michael Goulet-2/+2
2022-11-10Don't allow implement CoerceUnsized into dyn-starMichael Goulet-1/+1
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-10Don't print full paths in overlap errorsMichael Goulet-81/+78
2022-11-10Use TraitEngine in more places, make FulfillmentCtxt constructor more privateMichael Goulet-9/+10
2022-11-09Remove save_and_restore_in_snapshot_flagMichael Goulet-26/+24
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