about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2022-09-13rebaseb-naber-1/+1
2022-09-13use ty::Unevaluated<'tcx, ()> in type systemb-naber-9/+9
2022-09-13Auto merge of #101615 - compiler-errors:rpitit-perf, r=oli-obkbors-1/+1
Make `compare_predicate_entailment` no longer a query Make `compare_predicate_entailment` so it's no longer a query (again), and splits out the new logic (that equates the return types to infer RPITITs) into its own query. This means that this new query (now called `collect_trait_impl_trait_tys`) is no longer executed for non-RPITIT cases. This should improve perf (https://github.com/rust-lang/rust/pull/101224#issuecomment-1241682203), though in practice we see that these some crates remain from the primary regressions list on the original report... They are all <= 0.43% regression and seemingly only on the incr-full scenario for all of them. I am at a loss for what might be causing this regression other than what I fixed here, since we don't introduce much new non-RPITIT logic except for some `def_kind` query calls in some places, for example, like projection. Maybe that's it? ---- Originally this PR was opened to test enabling `cache_on_disk` (62164aaaa11) but that didn't turn out to be very useful (https://github.com/rust-lang/rust/pull/101615#issuecomment-1242403205), so that led me to just split the query (and rename the PR).
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-1/+1
2022-09-12Remove unused argument from `visit_poly_trait_ref`.Nicholas Nethercote-1/+1
2022-09-12Fix ICE in opt_suggest_box_spanMichael Goulet-1/+2
2022-09-10Auto merge of #98559 - jackh726:remove-reempty, r=oli-obkbors-114/+256
Remove ReEmpty r? rust-lang/types
2022-09-10split compare_predicate_entailment and collect_trait_impl_trait_tys outMichael Goulet-1/+1
2022-09-09Fix documentation lint failuresMichael Goulet-1/+1
2022-09-09Adjust pretty printing of RPITITsMichael Goulet-0/+14
2022-09-09Handle generic parameters.Camille GILLOT-1/+1
2022-09-08Combine logic from lubs into lub_empty functionJack Huey-65/+46
2022-09-08Make some functions pub(super)Jack Huey-14/+14
2022-09-08Remove ReEmptyJack Huey-103/+6
2022-09-08Don't construct ReEmpty regions in resolve_varJack Huey-5/+102
2022-09-08Create VarValue::EmptyJack Huey-20/+181
2022-09-08Don't use reempty as an implicit_outlives_regionJack Huey-2/+2
2022-09-08Auto merge of #98900 - lcnr:region-stuff, r=jackh726bors-12/+8
const_generics: correctly deal with bound variables removes the hack in `resolve` which was needed because we evaluated constants without caring about their bound variables. Each commit should be fairly self-contained, even if they build on each other r? `@jackh726`
2022-09-08don't evaluate with escaping bound varslcnr-6/+2
2022-09-08generalize: no need to cache errorslcnr-6/+6
2022-09-08Rollup merge of #101153 - IntQuant:issue-100717-infer-2, r=davidtwcoDylan DPC-395/+745
Migrate another part of rustc_infer to session diagnostic Probably will migrate another file before marking this one as ready-to-merge. `@rustbot` label +A-translation r? rust-lang/diagnostics cc https://github.com/rust-lang/rust/issues/100717
2022-09-07Rollup merge of #101503 - spastorino:add-debug-calls, r=compiler-errorsMatthias Krüger-2/+4
Add debug calls `@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller. r? `@oli-obk` `@cjgillot`
2022-09-07Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnrbors-27/+29
Shrink `PredicateS` r? `@ghost`
2022-09-07Add instrument and debug callsSantiago Pastorino-2/+4
2022-09-06Whoops forgot a spaceNikita Tomashevich-1/+1
2022-09-06Replace manual impl with a derive macro as multipart suggestions are now ↵Nikita Tomashevich-44/+55
supported by them
2022-09-06Slightly more concise commentIQuant-4/+1
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2022-09-06Use untranslated messages for nowNikita Tomashevich-11/+24
2022-09-06Remove a comment and use IntoDiagnosticArg instead of add_to() where feasibleNikita Tomashevich-14/+17
2022-09-06Address some commentsNikita Tomashevich-73/+61
2022-09-06Mugrate mismatched_static_lifetime.rsNikita Tomashevich-20/+272
2022-09-06Migrate E0623Nikita Tomashevich-119/+205
2022-09-06Rollup merge of #101445 - TaKO8Ki:suggest-introducing-explicit-lifetime, ↵Guillaume Gomez-9/+19
r=oli-obk Suggest introducing an explicit lifetime if it does not exist Fixes #101027
2022-09-06Rollup merge of #101434 - ↵Guillaume Gomez-7/+7
JhonnyBillM:replace-session-for-handler-in-into-diagnostic, r=davidtwco Update `SessionDiagnostic::into_diagnostic` to take `Handler` instead of `ParseSess` Suggested by the team in [this Zulip Topic](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler). `Handler` already has almost all the capabilities of `ParseSess` when it comes to diagnostic emission, in this migration we only needed to add the ability to access `source_map` from the emitter in order to get a `Snippet` and the `start_point`. Not sure if adding these two methods [`span_to_snippet_from_emitter` and `span_start_point_from_emitter`] is the best way to address this gap. P.S. If this goes in the right direction, then we probably may want to move `SessionDiagnostic` to `rustc_errors` and rename it to `DiagnosticHandler` or something similar. r? `@davidtwco` r? `@compiler-errors`
2022-09-05Auto merge of #101261 - TaKO8Ki:separate-receiver-from-arguments-in-hir, ↵bors-5/+5
r=cjgillot Separate the receiver from arguments in HIR Related to #100232 cc `@cjgillot`
2022-09-05separate the receiver from arguments in HIRTakayuki Maeda-5/+5
2022-09-05suggest introducing an explicit lifetime if it does not existTakayuki Maeda-9/+19
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-7/+7
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-09-05Pack `Term` in the same way as `GenericArg`.Nicholas Nethercote-27/+29
This shrinks the `PredicateS` type, which is instanted frequently.
2022-09-05Make `hir::PathSegment::hir_id` non-optional.Nicholas Nethercote-3/+3
2022-09-05Make `hir::PathSegment::res` non-optional.Nicholas Nethercote-11/+6
2022-09-01tracing::instrument cleanupOli Scherer-40/+18
2022-09-01Directly use the `instrument` macro instead of its full pathOli Scherer-7/+7
2022-08-31Fix a bunch of typoDezhi Wu-3/+3
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31Rollup merge of #101192 - TaKO8Ki:remove-path-string, r=compiler-errorsYuki Okushi-13/+13
Remove path string
2022-08-30Rollup merge of #100473 - compiler-errors:normalize-the-fn-def-sig-plz, r=lcnrDylan DPC-0/+33
Attempt to normalize `FnDef` signature in `InferCtxt::cmp` Stashes a normalization callback in `InferCtxt` so that the signature we get from `tcx.fn_sig(..).subst(..)` in `InferCtxt::cmp` can be properly normalized, since we cannot expect for it to have normalized types since it comes straight from astconv. This is kind of a hack, but I will say that `@jyn514` found the fact that we present unnormalized types to be very confusing in real life code, and I agree with that feeling. Though altogether I am still a bit unsure about whether this PR is worth the effort, so I'm open to alternatives and/or just closing it outright. On the other hand, this isn't a ridiculously heavy implementation anyways -- it's less than a hundred lines of changes, and half of that is just miscellaneous cleanup. This is stacked onto #100471 which is basically unrelated, and it can be rebased off of that when that lands or if needed. --- The code: ```rust trait Foo { type Bar; } impl<T> Foo for T { type Bar = i32; } fn foo<T>(_: <T as Foo>::Bar) {} fn needs_i32_ref_fn(f: fn(&'static i32)) {} fn main() { needs_i32_ref_fn(foo::<()>); } ``` Before: ``` = note: expected fn pointer `fn(&'static i32)` found fn item `fn(<() as Foo>::Bar) {foo::<()>}` ``` After: ``` = note: expected fn pointer `fn(&'static i32)` found fn item `fn(i32) {foo::<()>}` ```
2022-08-30Rollup merge of #99928 - compiler-errors:issue-99914, r=oli-obkDylan DPC-3/+14
Do not leak type variables from opaque type relation The "root cause" is that we call `InferCtxt::resolve_vars_if_possible` (3d9dd681f520d1d59f38aed0056cf9474894cc74) on the types we get back in `TypeError::Sorts` since I added a call to it in `InferCtxt::same_type_modulo_infer`. However if this `TypeError` comes from a `InferCtxt::commit_if_ok`, then it may reference type variables that do not exist anymore, which is problematic. We avoid this by substituting the `TypeError` with the types we had before being generalized while handling opaques. This is kinda gross, and I feel like we can get the same issue from other places where we generalize type/const inference variables. Maybe not? I don't know. Fixes #99914 Fixes #99970 Fixes #100463
2022-08-30remove path stringTakayuki Maeda-13/+13
2022-08-30Auto merge of #101183 - Dylan-DPC:rollup-6kewixv, r=Dylan-DPCbors-25/+38
Rollup of 9 pull requests Successful merges: - #95376 (Add `vec::Drain{,Filter}::keep_rest`) - #100092 (Fall back when relating two opaques by substs in MIR typeck) - #101019 (Suggest returning closure as `impl Fn`) - #101022 (Erase late bound regions before comparing types in `suggest_dereferences`) - #101101 (interpret: make read-pointer-as-bytes a CTFE-only error with extra information) - #101123 (Remove `register_attr` feature) - #101175 (Don't --bless in pre-push hook) - #101176 (rustdoc: remove unused CSS selectors for `.table-display`) - #101180 (Add another MaybeUninit array test with const) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-30Rollup merge of #101022 - compiler-errors:issue-101020, r=jackh726Dylan DPC-1/+4
Erase late bound regions before comparing types in `suggest_dereferences` Fixes #101020