about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-8/+8
2023-04-22Auto merge of #109753 - compiler-errors:replenish-region-constraints, r=aliemjaybors-2/+2
Clone region var origins instead of taking them in borrowck Fixes an issue with the new solver where reporting a borrow-checker error ICEs because it calls `InferCtxt::evaluate_obligation`. This also removes a handful of unnecessary `tcx.infer_ctxt().build()` calls that are only there to mitigate this same exact issue, but with the old solver. Fixes compiler-errors/next-solver-hir-issues#12. ---- This implements `@aliemjay's` solution where we just don't *take* the region constraints, but clone them. This potentially makes it easier to write a bug about taking region constraints twice or never at all, but again, not many folks are touching this code.
2023-04-21Break up long function in trait selection error reportingBryan Garza-1/+1
- Move blocks of code into their own functions - Replace a few function argument types with their type aliases
2023-04-21Clone region var origins instead of taking in borrowckMichael Goulet-2/+2
2023-04-20add EarlyBinder to output of explicit_item_bounds; replace ↵Kyle Matsuda-2/+2
bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query
2023-04-20Remove WithOptconstParam.Camille GILLOT-3/+3
2023-04-20Auto merge of #110527 - nnethercote:lazy-graph, r=lqdbors-4/+7
In `LexicalResolver`, don't construct graph unless necessary. A small but easy perf win. r? `@jackh726`
2023-04-20Auto merge of #110399 - cjgillot:infer-variance, r=aliemjaybors-13/+65
Account for opaque variance in outlives Fixes https://github.com/rust-lang/rust/issues/108591 Fixes https://github.com/rust-lang/rust/issues/108592 cc `@aliemjay`
2023-04-19Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwcobors-1/+1
Add `rustc_fluent_macro` to decouple fluent from `rustc_macros` Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-19In `LexicalResolver`, don't construct graph unless necessary.Nicholas Nethercote-4/+7
A small but easy perf win.
2023-04-19Rollup merge of #110476 - compiler-errors:ty-err-ctxt-good-path, r=lcnrMatthias Krüger-2/+1
Delay a good path bug on drop for `TypeErrCtxt` (instead of a regular delayed bug) r? `@lcnr` Perhaps we should just delete the `Drop` impl altogether though? Fixes rust-lang/rust-clippy#10645 `@matthiaskrgr:` I don't know how to make a clippy test for this. Any idea? Clippy's UI tests run with `-D warnings` and I have no idea how to switch it off to make a test that triggers this ICE in the clippy test suite 🤣
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+1
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-18Rollup merge of #110417 - jsoref:spelling-compiler, r=NilstriebGuillaume Gomez-19/+19
Spelling compiler This is per https://github.com/rust-lang/rust/pull/110392#issuecomment-1510193656 I'm going to delay performing a squash because I really don't expect people to be perfectly happy w/ my changes, I really am a human and I really do make mistakes. r? Nilstrieb I'm going to be flying this evening, but I should be able to squash / respond to reviews w/in a day or two. I tried to be careful about dropping changes to `tests`, afaict only two files had changes that were likely related to the changes for a given commit (this is where not having eagerly squashed should have given me an advantage), but, that said, picking things apart can be error prone.
2023-04-18Rollup merge of #110461 - WaffleLapkin:expect_, r=NilstriebMatthias Krüger-10/+2
Use `Item::expect_*` and `ImplItem::expect_*` more r? ``@Nilstrieb``
2023-04-18Delay a good path bug for TypeErrCtxtMichael Goulet-2/+1
2023-04-17Spelling - compilerJosh Soref-19/+19
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-17Use `Item::expect_*` and `ImplItem::expect_*` moreMaybe Waffle-10/+2
2023-04-17Rollup merge of #110394 - scottmcm:less-idx-new, r=WaffleLapkinMatthias Krüger-2/+1
Various minor Idx-related tweaks Nothing particularly exciting here, but a couple of things I noticed as I was looking for more index conversions to simplify. cc https://github.com/rust-lang/compiler-team/issues/606 r? `@WaffleLapkin`
2023-04-16Account for variance in outlives verification.Camille GILLOT-4/+45
2023-04-16Auto merge of #110405 - fee1-dead-contrib:rollup-9rkree6, r=fee1-deadbors-15/+12
Rollup of 4 pull requests Successful merges: - #110397 (Move some utils out of `rustc_const_eval`) - #110398 (use matches! macro in more places) - #110400 (more clippy fixes: clippy::{iter_cloned_collect, unwarp_or_else_defau…) - #110402 (Remove the loop in `Align::from_bytes`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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