about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
AgeCommit message (Collapse)AuthorLines
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
2022-12-24Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholkMatthias Krüger-27/+27
rustc: Remove needless lifetimes
2022-12-22Rollup merge of #106010 - oli-obk:tait_coherence_diagnostic, r=compiler-errorsMatthias Krüger-8/+15
Give opaque types a better coherence error
2022-12-21Auto merge of #105613 - Nilstrieb:rename-assert_uninit_valid, r=RalfJungbors-4/+4
Rename `assert_uninit_valid` intrinsic It's not about "uninit" anymore but about "filling with 0x01 bytes" so the name should at least try to reflect that. This is actually not fully correct though, as it does still panic for all uninit with `-Zstrict-init-checks`. I'm not sure what the best way is to deal with that not causing confusion. I guess we could just remove the flag? I don't think having it makes a lot of sense anymore with the direction that we have chose to go. It could be relevant again if #100423 lands so removing it may be a bit over eager. r? `@RalfJung`
2022-12-21Give opaque types a better coherence errorOli Scherer-8/+15
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-27/+27
2022-12-20Auto merge of #105880 - Nilstrieb:make-newtypes-less-not-rust, r=oli-obkbors-3/+3
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-12/+98
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-9/+5
Address some `EarlyBinder` nits