about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
AgeCommit message (Collapse)AuthorLines
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
2022-12-19Make fast-path for implied wf lint betterMichael Goulet-71/+92
2022-12-19Add IMPLIED_BOUNDS_ENTAILMENT lintMichael Goulet-5/+70
2022-12-18Rollup merge of #105873 - matthiaskrgr:clippy_fmt, r=NilstriebMatthias Krüger-1/+1
use &str / String literals instead of format!()
2022-12-18A few small cleanups for `newtype_index`Nilstrieb-2/+2
Remove the `..` from the body, only a few invocations used it and it's inconsistent with rust syntax. Use `;` instead of `,` between consts. As the Rust syntax gods inteded.
2022-12-18Make `#[custom_encodable]` an attribute for `newtype_index`Nilstrieb-1/+1
Makes the syntax a little more rusty.
2022-12-18use &str / String literals instead of format!()Matthias Krüger-1/+1
2022-12-18remove redundant fn params that were only "used" in recursionMatthias Krüger-4/+3
2022-12-17Rollup merge of #105711 - compiler-errors:rpitit-references-errors, r=eholkMatthias Krüger-0/+2
bail in `collect_trait_impl_trait_tys` if signatures reference errors Fixes #105290
2022-12-16Auto merge of #105717 - compiler-errors:anonymize, r=jackh726bors-1/+1
always use `anonymize_bound_vars` Unless this is perf-sensitive, it's probably best to always use one anonymize function that does the right thing for all bound vars. r? types
2022-12-15Rollup merge of #104592 - ComputerDruid:async_check, r=compiler-errorsMatthias Krüger-0/+43
Ensure async trait impls are async (or otherwise return an opaque type) As a workaround for the full `#[refine]` semantics not being implemented yet, forbit returning a concrete future type like `Box<dyn Future>` or a manually implemented Future. `-> impl Future` is still permitted; while that can also cause accidental refinement, that's behind a different feature gate (`return_position_impl_trait_in_trait`) and that problem exists regardless of whether the trait method is async, so will have to be solved more generally. Fixes https://github.com/rust-lang/rust/issues/102745
2022-12-14Ensure async trait impls are async (or otherwise return an opaque type)Dan Johnson-0/+43
As a workaround for the full `#[refine]` semantics not being implemented yet, forbit returning a concrete future type like `Box<dyn Future>` or a manually implemented Future. `-> impl Future` is still permitted; while that can also cause accidental refinement, that's behind a different feature gate (`return_position_impl_trait_in_trait`) and that problem exists regardless of whether the trait method is async, so will have to be solved more generally. Fixes #102745
2022-12-14always use anonymize_bound_varsMichael Goulet-1/+1
2022-12-14bail in collect_trait_impl_trait_tys if signatures reference errorsMichael Goulet-0/+2
2022-12-14Remove TraitRef::newOli Scherer-2/+2
2022-12-14Prevent the creation of `TraitRef` without dedicated methodsOli Scherer-2/+2
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-3/+3
2022-12-14Guard `AliasTy` creation against passing the wrong number of substsOli Scherer-5/+2
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-51/+42
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias` Implements https://github.com/rust-lang/types-team/issues/79. This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so: ``` enum AliasKind { Projection, Opaque, } struct AliasTy<'tcx> { def_id: DefId, substs: SubstsRef<'tcx>, } ``` Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example: ```diff match ty.kind() { - ty::Opaque(..) => + ty::Alias(ty::Opaque, ..) => {} _ => {} } ``` This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically. r? `@ghost`
2022-12-13Rollup merge of #105628 - spastorino:small-doc-fixes, r=compiler-errorsMatthias Krüger-9/+6
Small doc fixes r? `@compiler-errors`
2022-12-13Address a few more nitsMichael Goulet-5/+6
2022-12-13Address nitsMichael Goulet-1/+1
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-12-13Combine identical alias armsMichael Goulet-6/+2
2022-12-13Combine projection and opaque into aliasMichael Goulet-17/+17
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-8/+8
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-31/+25
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-4/+4