about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2023-04-16Rollup merge of #110345 - nnethercote:rm-Super-impls-for-Region, ↵fee1-dead-2/+2
r=compiler-errors Remove `TypeSuper{Foldable,Visitable}` impls for `Region`. These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods. r? `@compiler-errors`
2023-04-16use matches! macro in more placesMatthias Krüger-15/+12
2023-04-16Account for variance in outlives obligations.Camille GILLOT-9/+20
2023-04-16Various minor Idx-related tweaksScott McMurray-2/+1
Nothing particularly exciting here, but a couple of things I noticed as I was looking for more index conversions to simplify.
2023-04-16Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.Nicholas Nethercote-2/+2
These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods.
2023-04-14fix import ApplicabilityAlex Chi-1/+1
Signed-off-by: Alex Chi <iskyzh@gmail.com>
2023-04-14use param instead of tyAlex Chi-5/+17
Signed-off-by: Alex Chi <iskyzh@gmail.com>
2023-04-14better suggestion based on hirAlex Chi-41/+49
Signed-off-by: Alex Chi <iskyzh@gmail.com>
2023-04-14suggest lifetime for closure parameter type when mismatchAlex Chi-1/+58
2023-04-13Rollup merge of #110220 - lcnr:regionzz, r=compiler-errorsMatthias Krüger-179/+147
cleanup our region error API - require `TypeErrCtxt` to always result in an error, closing #108810 - move `resolve_regions_and_report_errors` to the `ObligationCtxt` - call `process_registered_region_obligations` in `resolve_regions` - move `resolve_regions` into the `outlives` submodule - add `#[must_use]` to functions returning lists of errors r? types
2023-04-12Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgrbors-4/+9
Rollup of 8 pull requests Successful merges: - #109810 (Replace rustdoc-ui/{c,z}-help tests with a stable run-make test ) - #110035 (fix: ensure bad `#[test]` invocs retain correct AST) - #110089 (sync::mpsc: synchronize receiver disconnect with initialization) - #110103 (Report overflows gracefully with new solver) - #110122 (Fix x check --stage 1 when download-ci-llvm=false) - #110133 (Do not use ImplDerivedObligationCause for inherent impl method error reporting) - #110135 (Revert "Don't recover lifetimes/labels containing emojis as character literals") - #110235 (Fix `--extend-css` option) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12Rollup merge of #110103 - compiler-errors:new-solver-overflows, r=lcnrMatthias Krüger-4/+9
Report overflows gracefully with new solver avoid reporting overflows as ambiguity errors, so that the error message is clearer. r? ```@lcnr```
2023-04-12Auto merge of #110249 - matthiaskrgr:rollup-7iig04q, r=matthiaskrgrbors-9/+9
Rollup of 8 pull requests Successful merges: - #110153 (Fix typos in compiler) - #110165 (rustdoc: use CSS `overscroll-behavior` instead of JavaScript) - #110175 (Symbol cleanups) - #110203 (Remove `..` from return type notation) - #110205 (rustdoc: make settings radio and checks thicker, less contrast) - #110222 (Improve the error message when forwarding a matched fragment to another macro) - #110237 (Split out a separate feature gate for impl trait in associated types) - #110241 (tidy: Issue an error when UI test limits are too high) Failed merges: - #110218 (Remove `ToRegionVid`) r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12Rollup merge of #110153 - DaniPopes:compiler-typos, r=NilstriebMatthias Krüger-9/+9
Fix typos in compiler I ran [`typos -w compiler`](https://github.com/crate-ci/typos) to fix typos in the `compiler` directory. Refs #110150
2023-04-12Rollup merge of #110210 - nnethercote:DescriptionCtx-cleanups, r=davidtwcoMatthias Krüger-118/+79
`DescriptionCtx` cleanups Best reviewed one commit at a time. r? `@davidtwco`
2023-04-12`#[must_use]` for fns returning a list of errorslcnr-0/+3
2023-04-12region error cleanuplcnr-179/+144
- require `TypeErrCtxt` to always result in an error - move `resolve_regions_and_report_errors` to the `ObligationCtxt` - merge `process_registered_region_obligations` into `resolve_regions`
2023-04-12Inline and remove `msg_span_from_early_bound_and_free_regions`.Nicholas Nethercote-42/+32
For similar reasons to the previous commit.
2023-04-12Inline and remove `DescriptionCtx::from_early_bound_and_free_regions`.Nicholas Nethercote-67/+44
It has a single call site, and the code is clearer with all region kinds handled in one function, instead of splitting the handling across two functions. The commit also changes `DescriptionCtx::new` to use a more declarative style, instead of creating a default `DescriptionCtx` and modifying it, which I find easier to read.
2023-04-12Inline and remove `DescriptionCtx::add_to`.Nicholas Nethercote-8/+4
It has a single callsite.
2023-04-11Allow the elaborator to only filter to real supertraitsMichael Goulet-15/+26
2023-04-11Split implied and super predicate queriesMichael Goulet-1/+1
2023-04-11Split super_predicates_that_define_assoc_type query from super_predicates_ofMichael Goulet-4/+2
2023-04-11Remove the unused `anon_num_here` error.Nicholas Nethercote-2/+0
2023-04-10Fix typos in compilerDaniPopes-9/+9
2023-04-10Auto merge of #108698 - IntQuant:issue-100717-infer-6, r=davidtwcobors-347/+698
Migrating rustc_infer to session diagnostics (part 5) `@rustbot` label +A-translation cc https://github.com/rust-lang/rust/issues/100717
2023-04-10Report overflows gracefully with new solverMichael Goulet-4/+9
2023-04-09Auto merge of #110031 - compiler-errors:generic-elaboration, r=b-naberbors-97/+112
Make elaboration generic over input Combines all the `elaborate_*` family of functions into just one, which is an iterator over the same type that you pass in (e.g. elaborating `Predicate` gives `Predicate`s, elaborating `Obligation`s gives `Obligation`s, etc.)
2023-04-06Remove u32 on BoundTyKind::AnonJack Huey-1/+1
2023-04-06Remove index from BrAnonJack Huey-7/+7
2023-04-06Don't use BrAnon index in diagnosticsJack Huey-5/+4
2023-04-06Use BoundTy and BoundRegion instead of kind of PlaceholderTy and ↵Jack Huey-27/+43
PlaceholderRegion
2023-04-06Get rid of elaborate_trait_ref{s} tooMichael Goulet-17/+7
2023-04-06Make elaborator genericMichael Goulet-92/+117
2023-04-07Rollup merge of #109957 - fmease:fix-109905, r=petrochenkovMatthias Krüger-1/+4
diagnostics: account for self type when looking for source of unsolved type variable Fixes #109905. When searching for the source of an unsolved infer var inside of a list of generic args, we look through the `tcx.generics_of(…).own_substs(…)` which *skips* the self type if present. However, the computed `argument_index` is later[^1] used to index into `tcx.generics_of(…).params` which may still contain the self type. In such case, we are off by one when indexing into the parameters. From now on, we account for this immediately after calling `own_substs` which keeps things local. This also fixes the wrong output in the preexisting UI test `inference/need_type_info/concrete-impl.rs` which was overlooked. It used to claim that the *type of type parameter `Self`* couldn't be inferred in `<Struct as Ambiguous<_>>::method()` which of course isn't true: `Self` equals `Struct` here, `A` couldn't be inferred. `@rustbot` label A-diagnostics [^1]: https://github.com/rust-lang/rust/blob/f98a2718141593fbb8dbad10acc537786d748156/compiler/rustc_infer/src/infer/error_reporting/need_type_info.rs#L471
2023-04-05account for self type when looking for source of unsolved ty varLeón Orell Valerian Liehr-1/+4
2023-04-04Rollup merge of #109913 - scottmcm:index-slice, r=WaffleLapkinMichael Goulet-1/+1
Doc-comment `IndexVec::from_elem` and use it in a few more places Since this PR is a reply to https://github.com/rust-lang/rust/pull/109819#discussion_r1156128164, r? ``@WaffleLapkin``
2023-04-04Now passes testsIQuant-1/+2
2023-04-04Rename tuple_wrap_err_subdiag to suggest_wrap_to_build_a_tuple, making it ↵IQuant-4/+4
more consistent with similar functions
2023-04-04Extract suggest_specify_actual_length into a separate functionIQuant-59/+61
2023-04-04A more general implementation of `IntoDiagnosticArg` for `Binder` (Also ↵IQuant-13/+5
removes `DiagArg`, as it's no longer necessary)
2023-04-04Renamed TypeErrorAdditionalDiags (was Error0308Subdiags) and ↵IQuant-48/+52
ObligationCauseFailureCode (was FailureCodeDiagnostics)
2023-04-04Move and document escape_literal functionIQuant-19/+22
2023-04-04Update compiler/rustc_infer/src/infer/error_reporting/suggest.rsIQuant-1/+1
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2023-04-04Migrate (most of) report_and_explain_type_errorIQuant-228/+374
2023-04-04FailureCode::Error0038 is unreachable, so can be removedIQuant-6/+0
2023-04-04Migrate TupleTrailingCommaSuggestionIQuant-14/+27
2023-04-04Migrate SuggestTuplePatternIQuant-23/+50
2023-04-04Migrate SuggestBoxingForReturnImplTrait, Fix typo in infer_fn_consider_castingIQuant-21/+35
2023-04-04Migrate SuggestAccessingFieldIQuant-22/+33