about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
AgeCommit message (Collapse)AuthorLines
2023-01-10Rollup merge of #106204 - compiler-errors:no-take-opaques-in-compare, r=oli-obkYuki Okushi-18/+2
No need to take opaques in `check_type_bounds` `InferCtxt` already has its defining use anchor set to err r? ``@oli-obk``
2023-01-09Auto merge of #106637 - fee1-dead-contrib:rollup-ticvmsd, r=fee1-deadbors-10/+16
Rollup of 10 pull requests Successful merges: - #105292 (Change a commit_if_ok call to probe) - #105655 (Remove invalid case for mutable borrow suggestion) - #106047 (Fix ui constant tests for big-endian platforms) - #106061 (Enable Shadow Call Stack for Fuchsia on AArch64) - #106164 (Move `check_region_obligations_and_report_errors` to `TypeErrCtxt`) - #106291 (Fix incorrect suggestion for extra `&` in pattern) - #106389 (Simplify some canonical type alias names) - #106468 (Use FxIndexSet when updating obligation causes in `adjust_fulfillment_errors_for_expr_obligation`) - #106549 (Use fmt named parameters in rustc_borrowck) - #106614 (error-code docs improvements (No. 2)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-09Assert defining anchor is set in take_opaque_typesMichael Goulet-1/+1
2023-01-09No need to take opaques in check_type_boundsMichael Goulet-17/+1
2023-01-09Rollup merge of #106164 - compiler-errors:check-region-tweak, r=oli-obkfee1-dead-10/+16
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-09Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnrbors-31/+26
Don't normalize in AstConv See individual commits. Fixes #101350 Fixes #54940
2023-01-09Auto merge of #106582 - compiler-errors:better-spans-on-bad-tys, r=lcnrbors-40/+25
Improve spans of non-WF implied bound types Fixes #60980
2023-01-08Rollup merge of #106131 - compiler-errors:not-ptrs, r=davidtwcoMichael Goulet-22/+14
Mention "signature" rather than "fn pointer" when impl/trait methods are incompatible Fixes #80929 Fixes #67296
2023-01-08Normalize assumed_wf_types after wfchecking is complete, for better spansMichael Goulet-3/+4
2023-01-08Improve spans of non-WF implied bound typesMichael Goulet-37/+21
2023-01-08Auto merge of #106235 - compiler-errors:rework-bounds-collection, r=davidtwcobors-94/+111
Rework `Bounds` collection I think it's weird for the `Bounds` struct in astconv to store its predicates *almost* converted into real predicates... so we do this eagerly, instead of lazily.
2023-01-08Mention signature rather than fn pointers when comparing impl/trait methodsMichael Goulet-22/+14
2023-01-08Add type flags support for Ty and Const late-bound regionsMichael Goulet-1/+1
2023-01-07introduce AstConv::probe_adtAli MJ Al-Nasrawy-7/+20
2023-01-07don't normalize in astconvAli MJ Al-Nasrawy-30/+12
We delay projection normalization to further stages in order to register user type annotations before normalization in HIR typeck. There are two consumers of astconv: ItemCtxt and FnCtxt. The former already expects unnormalized types from astconv, see its AstConv trait impl. The latter needs `RawTy` for a cleaner interface. Unfortunately astconv still needs the normalization machinery in order to resolve enum variants that have projections in the self type, e.g. `<<T as Trait>::Assoc>::StructVariant {}`. This is why `AstConv::normalize_ty_2` is necessary.
2023-01-07Auto merge of #106283 - JulianKnodt:enum_err, r=cjgillotbors-10/+19
Add help diag. for `const = Enum` missing braces around `Enum` Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces. Thus, add a simple diagnostic that suggests wrapping enum variants in braces. Fixes #105927
2023-01-06Rollup merge of #106533 - ↵Michael Goulet-6/+14
TaKO8Ki:use-smaller-span-for-missing-lifetime/generic-args, r=compiler-errors Use smaller spans for missing lifetime/generic args We can remove ident from suggestions.
2023-01-06use smaller spans for missing lifetime/generic argsTakayuki Maeda-6/+14
fix rustdoc ui test
2023-01-05Correct detection of elided lifetimes in impl-trait.Camille GILLOT-2/+4
2023-01-04Rollup merge of #106403 - compiler-errors:rename-hir-methods, r=cjgillotMichael Goulet-12/+12
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-04Rollup merge of #106200 - compiler-errors:suggest-impl-trait, r=estebankMatthias Krüger-50/+97
Suggest `impl Fn*` and `impl Future` in `-> _` return suggestions Follow-up to #106172, only the last commit is relevant. Can rebase once that PR is landed for easier review. Suggests `impl Future` and `impl Fn{,Mut,Once}` in `-> _` return suggestions. r? `@estebank`
2023-01-03Rollup merge of #106353 - lukas-code:reduce-red-lines-in-my-ide, r=wesleywiserMichael Goulet-3/+3
Reduce spans for `unsafe impl` errors Because huge spans aren't great for IDEs. Prior art: https://github.com/rust-lang/rust/pull/103749
2023-01-04get_parent and find_parentMichael Goulet-7/+7
2023-01-04rename find_parent_node to opt_parent_idMichael Goulet-1/+1
2023-01-04rename get_parent_node to parent_idMichael Goulet-11/+11
2023-01-04Restore Fn trait noteMichael Goulet-3/+3
2023-01-03Move check_region_obligations_and_report_errors to TypeErrCtxtMichael Goulet-10/+16
2023-01-03Suggest more impl Trait on `-> _`Michael Goulet-47/+94
2023-01-03Add note about wrapping in braceskadmin-10/+19
Previously it was not clear why this errored or if it was even supported, as there was no diagnostic that suggested wrapping it in braces. Thus, add a simple diagnostic that suggests wrapping enum variants in braces.
2023-01-01Implement fix for #67535Troy Neubauer-3/+11
2023-01-01reduce spans for `unsafe impl` errorsLukas Markeffsky-3/+3
2022-12-29Rollup merge of #106221 - Nilstrieb:rptr-more-like-ref-actually, ↵Matthias Krüger-4/+4
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-28Rework hir Bounds collectionMichael Goulet-94/+111
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-4/+4
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-12-28Auto merge of #106215 - matthiaskrgr:rollup-53r89ww, r=matthiaskrgrbors-7/+67
Rollup of 6 pull requests Successful merges: - #106028 (docs/test: add UI test and long-form error docs for `E0461`) - #106172 (Suggest `impl Iterator` when possible for `_` return type) - #106173 (Deduplicate `op` methods) - #106176 (Recover `fn` keyword as `Fn` trait in bounds) - #106194 (rustdoc: combine common sidebar background color CSS rules) - #106199 (Silence knock-down errors on `[type error]` bindings) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-28Rollup merge of #106172 - estebank:suggest-impl-trait, r=compiler-errorsMatthias Krüger-7/+67
Suggest `impl Iterator` when possible for `_` return type Address #106096.
2022-12-28Auto merge of #106129 - compiler-errors:compare_method-tweaks, r=BoxyUwUbors-33/+66
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-28better names and a commentMichael Goulet-3/+36
2022-12-28Rename module compare_method -> compare_impl_itemMichael Goulet-14/+14
2022-12-28make some things less pubMichael Goulet-5/+5
2022-12-27Emit fewer errors on invalid `#[repr(transparent)]` on `enum`Esteban Küber-4/+2
Fix #68420.
2022-12-27Shorten type in noteEsteban Küber-6/+7
2022-12-27review commentsEsteban Küber-6/+3
2022-12-26Suggest `impl Iterator` when possible for `_` return typeEsteban Küber-2/+64
Address #106096.
2022-12-27Rollup merge of #106151 - TaKO8Ki:remove-unused-imports, r=jackh726fee1-dead-1/+0
Remove unused imports
2022-12-26remove unused importsTakayuki Maeda-1/+0
2022-12-25fix more clippy::style findingsMatthias Krüger-4/+1
match_result_ok obfuscated_if_else single_char_add writeln_empty_string collapsible_match iter_cloned_collect unnecessary_mut_passed
2022-12-25fix some typosKaDiWa-1/+1
2022-12-24Bubble up ErrorGuaranteed from region constraints in method item compareMichael Goulet-10/+10
2022-12-24Rename some compare_method functionsMichael Goulet-7/+7