about summary refs log tree commit diff
path: root/compiler/rustc_infer
AgeCommit message (Collapse)AuthorLines
2023-01-09Assert defining anchor is set in take_opaque_typesMichael Goulet-9/+7
2023-01-09Rollup merge of #106389 - compiler-errors:no-canonicalized, r=lcnrfee1-dead-10/+9
Simplify some canonical type alias names * delete the `Canonicalized<'tcx>` type alias in favor for `Canonical<'tcx>` * `CanonicalizedQueryResponse` -> `CanonicalQueryResponse` I don't particularly care about the latter, but it should be consistent. We could alternatively delete the first alias and rename the struct to `Canonicalized`, and then keep the name of `CanonicalizedQueryResponse` untouched.
2023-01-09Rollup merge of #106164 - compiler-errors:check-region-tweak, r=oli-obkfee1-dead-21/+18
Move `check_region_obligations_and_report_errors` to `TypeErrCtxt` Makes sense for this function to live with its sibling `resolve_regions_and_report_errors`, around which it's basically just a wrapper.
2023-01-08Rollup merge of #106131 - compiler-errors:not-ptrs, r=davidtwcoMichael Goulet-16/+51
Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible Fixes #80929 Fixes #67296
2023-01-08Mention signature rather than fn pointers when comparing impl/trait methodsMichael Goulet-16/+51
2023-01-08remove unreachable error code `E0313`Ezra Shaw-42/+0
2023-01-07Rollup merge of #101936 - IntQuant:issue-100717-infer-4, r=compiler-errorsMatthias Krüger-326/+671
Migrating rustc_infer to session diagnostics (part 3) ``@rustbot`` label +A-translation r? rust-lang/diagnostics cc https://github.com/rust-lang/rust/issues/100717 Seems like a part of static_impl_trait.rs emits suggestions in a loop, and note.rs needs to have two instances of the same subdiagnostic, so these will need to wait until we have eager translation/list support. Other than that, there is only error_reporting/mod.rs left to migrate.
2023-01-06Auto merge of #105805 - yanchen4791:issue-105227-fix, r=estebankbors-7/+71
Suggest adding named lifetime when the return contains value borrowed from more than one lifetimes of function inputs fix for #105227. The problem: The suggestion of adding an explicit `'_` lifetime bound is **incorrect** when the function's return type contains a value which could be borrowed from more than one lifetimes of the function's inputs. Instead, a named lifetime parameter can be introduced in such a case. The solution: Checking the number of elided lifetimes in the function signature. If more than one lifetimes found in the function inputs when the suggestion of adding explicit `'_` lifetime, change it to using named lifetime parameter `'a` instead.
2023-01-05Suggests adding named lifetime when the return contains value borrowed from ↵yanchen4791-7/+71
more than one lifetimes of the function's inputs
2023-01-05Use `BottomUpFolder`Esteban Küber-1/+1
2023-01-04Rollup merge of #106403 - compiler-errors:rename-hir-methods, r=cjgillotMichael Goulet-37/+34
Rename `hir::Map::{get_,find_}parent_node` to `hir::Map::{,opt_}parent_id`, and add `hir::Map::{get,find}_parent` The `hir::Map::get_parent_node` function doesn't return a `Node`, and I think that's quite confusing. Let's rename it to something that sounds more like something that gets the parent hir id => `hir::Map::parent_id`. Same with `find_parent_node` => `opt_parent_id`. Also, combine `hir.get(hir.parent_id(hir_id))` and similar `hir.find(hir.parent_id(hir_id))` function into new functions that actually retrieve the parent node in one call. This last commit is the only one that might need to be looked at closely.
2023-01-04Address commentsMichael Goulet-49/+43
2023-01-04Simplify some iterator combinatorsMichael Goulet-55/+36
2023-01-04get_parent and find_parentMichael Goulet-36/+33
2023-01-04rename get_parent_node to parent_idMichael Goulet-3/+3
2023-01-03Move check_region_obligations_and_report_errors to TypeErrCtxtMichael Goulet-21/+18
2023-01-03Simplify some canonical type alias namesMichael Goulet-10/+9
2022-12-29Rollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, ↵Matthias Krüger-5/+5
r=compiler-errors Rename `Rptr` to `Ref` in AST and HIR The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28Address review commentsMichael Goulet-35/+29
2022-12-28Make trait/impl where clause mismatch on region error a bit more actionableMichael Goulet-39/+90
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-5/+5
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28Auto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwUbors-6/+11
Some `compare_method` tweaks 1. Make some of the comparison functions' names more regular 2. Reduce pub scope of some of the things in `compare_method` ~3. Remove some unnecessary opaque type handling code -- `InferCtxt` already is in a mode that doesn't define opaque types~ * moved to a different PR 4. Bubble up `ErrorGuaranteed` for region constraint errors in `compare_method` - Improves a redundant error message in one unit test. 5. Move the `compare_method` module to have a more general name, since it's more like `compare_impl_item` :) 6. Rename `collect_trait_impl_trait_tys`
2022-12-28eager is the default nowNikita Tomashevich-1/+1
2022-12-28Fix formattingNikita Tomashevich-2/+1
2022-12-28Fix broken rebaseNikita Tomashevich-1/+1
2022-12-28Fix nitsNikita Tomashevich-7/+4
2022-12-28Made ty_or_sig and trait_path use their actual types instead of StringNikita Tomashevich-77/+118
2022-12-28Split infer_explicit_lifetime_required into several diagsNikita Tomashevich-29/+43
2022-12-28Address changes of pr 103345Nikita Tomashevich-46/+46
2022-12-28Rename subdiagnostic fields that do not need to be unique nowNikita Tomashevich-17/+7
2022-12-28Use eager translationNikita Tomashevich-11/+27
2022-12-28Split into several messagesNikita Tomashevich-31/+195
2022-12-28More descriptive names for ActualImplExplNotes variantsNikita Tomashevich-6/+6
2022-12-28Rebase and fixNikita Tomashevich-14/+14
2022-12-28Partial work on static_impl_trait.rsNikita Tomashevich-111/+169
2022-12-28Migrate trait_impl_difference.rsNikita Tomashevich-27/+51
2022-12-28Migrate placeholder_error.rsNikita Tomashevich-126/+158
2022-12-28Migrate named_anon_conflict.rsNikita Tomashevich-26/+36
2022-12-28Rollup merge of #106205 - compiler-errors:oopsy, r=fee1-deadfee1-dead-630/+0
Remove some totally duplicated files in `rustc_infer` I have no idea why or how I duplicated these files from `compiler/rustc_infer/src/infer/error_reporting/note.rs`, but I did by accident, and nothing caught it :facepalm:
2022-12-28Remove some totally duplicated filesMichael Goulet-630/+0
2022-12-28Rename module compare_method -> compare_impl_itemMichael Goulet-1/+1
2022-12-27Account for `match` expr in single lineEsteban Küber-2/+2
When encountering `match Some(42) { Some(x) => x, None => "" };`, output ``` error[E0308]: `match` arms have incompatible types --> f53.rs:2:52 | 2 | let _ = match Some(42) { Some(x) => x, None => "" }; | -------------- - ^^ expected integer, found `&str` | | | | | this is found to be of type `{integer}` | `match` arms have incompatible types ```
2022-12-24Bubble up ErrorGuaranteed from region constraints in method item compareMichael Goulet-5/+10
2022-12-24Rename some compare_method functionsMichael Goulet-1/+1
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-2/+2
rustc: Remove needless lifetimes
2022-12-23Rollup merge of #105661 - lcnr:evaluate-new, r=compiler-errorsnils-1/+5
implement the skeleton of the updated trait solver cc ```@rust-lang/initiative-trait-system-refactor``` This is mostly following the architecture discussed in the types team meetup. After discussing the desired changes for the trait solver, we encountered cyclic dependencies between them. Most notably between changing evaluate to be canonical and returning inference constraints. We cannot canonicalize evaluate without returning inference constraints due to coinductive cycles. However, caching inference constraints also relies on canonicalization. Implementing both of these changes at once in-place is not feasible. This somewhat closely mirrors the current `evaluate` implementation with the following notable differences: - it moves `project` into the core solver, allowing us to correctly deal with coinductive projections (will be required for implied bounds, perfect derive) - it changes trait solver overflow to be non-fatal (required to backcompat breakage from changes to the iteration order of nested goals, deferred projection equality, generally very useful) - it returns inference constraints and canonicalizes inputs and outputs (required for a lot things, most notably merging fulfill and evaluate, and deferred projection equality) - it is implemented to work with lazy normalization A lot of things aren't yet implemented, but the remaining FIXMEs should all be fairly self-contained and parallelizable. If the architecture looks correct and is what we want here, I would like to quickly merge this and then split the work. r? ```@compiler-errors``` / ```@rust-lang/types``` :3
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
2022-12-20Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obkbors-6/+4
Improve syntax of `newtype_index` This makes it more like proper Rust and also makes the implementation a lot simpler. Mostly just turns weird flags in the body into proper attributes. It should probably also be converted to an attribute macro instead of function-like, but that can be done in a future PR.
2022-12-20Auto merge of #105575 - compiler-errors:impl-wf-lint, r=oli-obkbors-2/+7
Add `IMPLIED_BOUNDS_ENTAILMENT` lint Implements a lint (#105572) version of the hard-error introduced in #105483. Context is in that PR. r? `@lcnr` cc `@oli-obk` who had asked for this to be a lint first Not sure if this needs to be an FCP, since it's a lint for now.
2022-12-19Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorinobors-6/+5
Address some `EarlyBinder` nits