about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/check
AgeCommit message (Collapse)AuthorLines
2023-07-17Rename arg_iter to iter_instantiatedMichael Goulet-4/+4
2023-07-15Check entry type as part of item type checking.Camille GILLOT-1/+282
2023-07-14Rollup merge of #113698 - compiler-errors:rpitit-check, r=spastorinoMatthias Krüger-3/+3
Make it clearer that we're just checking for an RPITIT Tiny nit to use `is_impl_trait_in_trait` more, to make it clearer that we're just checking whether a def-id is an RPITIT, rather than doing something meaningful with the `opt_rpitit_info`. r? `@spastorino`
2023-07-14Make it clearer that we're just checking for an RPITITMichael Goulet-3/+3
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-192/+206
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-8/+5
2023-07-08Replace RPITIT current impl with new strategy that lowers as a GATSantiago Pastorino-17/+1
2023-07-07Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errorsMichael Goulet-2/+11
Avoid calling report_forbidden_specialization for RPITITs Fixes #113438 r? ``@compiler-errors``
2023-07-07Avoid calling report_forbidden_specialization for RPITITsSantiago Pastorino-2/+11
2023-07-07Auto merge of #113245 - lukas-code:unsizing-sanity-check, r=the8472bors-1/+1
sanity check field offsets in unsizeable structs As promised in https://github.com/rust-lang/rust/pull/112062#issuecomment-1567494994, this PR extends the layout sanity checks to ensure that structs fields don't move around when unsizing and prevent issues like https://github.com/rust-lang/rust/issues/112048 in the future. Like most other layout sanity checks, this only runs on compilers with debug assertions enabled. Here is how it looks when it fails: ```text error: internal compiler error: compiler/rustc_ty_utils/src/layout.rs:533:21: unsizing GcNode<std::boxed::Box<i32>> changed field order! Layout { size: Size(32 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: true }, fields: Arbitrary { offsets: [Size(0 bytes), Size(8 bytes), Size(24 bytes)], memory_index: [0, 1, 2] }, largest_niche: Some(Niche { offset: Size(24 bytes), value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), variants: Single { index: 0 } } Layout { size: Size(24 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: false }, fields: Arbitrary { offsets: [Size(16 bytes), Size(0 bytes), Size(24 bytes)], memory_index: [1, 0, 2] }, largest_niche: None, variants: Single { index: 0 } } ``` r? `@the8472`
2023-07-06Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tysSantiago Pastorino-5/+7
2023-07-06add helper methods for accessing struct tailLukas Markeffsky-1/+1
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-88/+105
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-5/+4
2023-07-03use `deeply_normalize` for `assumed_wf_types`lcnr-9/+17
2023-06-30Flip the order of binder instantiation for better diagnosticsMichael Goulet-10/+7
2023-06-30Error for RPITIT hidden tys that capture more than their trait defnMichael Goulet-22/+109
2023-06-29Intern OpaqueTy on ItemKind::OpaqueTySantiago Pastorino-1/+1
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-41/+37
2023-06-25Rollup merge of #113036 - TaKO8Ki:fix-112094, r=compiler-errorsMatthias Krüger-1/+1
Accept `ReStatic` for RPITIT Fixes #112094 Regression in https://github.com/rust-lang/rust/commit/8216b7f22934cea2422c79565df9c30ac8db93e0 If there is a better suggestion, I will go with that.
2023-06-26accept `ReStatic` for RPITITTakayuki Maeda-1/+1
add an ui test for #112094
2023-06-23Auto merge of #112891 - oli-obk:impl_trait_in_assoc_tys_cleanup, ↵bors-4/+4
r=compiler-errors Various impl trait in assoc tys cleanups r? `@compiler-errors` All commits except for the last are pure refactorings. 274dab5bd658c97886a8987340bf50ae57900c39 allows struct fields to participate in deciding whether a function has an opaque in its signature. best reviewed commit by commit
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-5/+3
2023-06-22Move `opaque_type_origin_unchecked` onto `TyCtxt` and re-use it where it was ↵Oli Scherer-4/+4
open coded
2023-06-21Liberate bound vars properly when suggesting missing AFITMichael Goulet-13/+10
2023-06-21Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnrNilstrieb-14/+14
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind` Does two basic things before I put up a more delicate set of PRs (along the lines of #112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`). 1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`. 2. Add a new `Clause` type which is parallel to `Predicate`. * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸 The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that... r? ``@lcnr`` or ``@oli-obk`` [^1]: https://github.com/rust-lang/rust/pull/112714#issuecomment-1595653910
2023-06-19Rollup merge of #112596 - compiler-errors:missing-sig-with-rpitit, r=b-naberMichael Goulet-2/+29
Suggest correct signature on missing fn returning RPITIT/AFIT Add `async` and unpeel the future's output type if the function is async Fixes #108195
2023-06-19s/Clause/ClauseKindMichael Goulet-14/+14
2023-06-17Move ConstEvaluatable to ClauseMichael Goulet-2/+2
2023-06-17Move WF goal to clauseMichael Goulet-4/+8
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-10/+30
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-06-14Error on unconstrained lifetime in RPITITMichael Goulet-21/+38
2023-06-13Suggest correct signature on missing fn returning RPITIT/AFITMichael Goulet-2/+29
2023-06-13Rollup merge of #111885 - compiler-errors:rust-call-abi-sized, r=eholkMatthias Krüger-1/+7
Don't ICE on unsized `extern "rust-call"` call Conceptually builds on #111864, but doesn't depend on it.
2023-06-08Rollup merge of #109953 - thomcc:thomcc/typeid128, r=WaffleLapkinMatthias Krüger-1/+1
Use 128 bits for TypeId hash Preliminary/Draft impl of https://github.com/rust-lang/compiler-team/issues/608 Prior art (probably incomplete list) - https://github.com/rust-lang/rust/pull/75923 - https://github.com/rust-lang/rust/pull/95845
2023-06-07Rollup merge of #112122 - compiler-errors:next-coherence, r=lcnrDylan DPC-1/+1
Add `-Ztrait-solver=next-coherence` Flag that conditionally uses the trait solver *only* during coherence, for more testing and/or eventual partial-migration onto the trait solver (in the medium- to long-term). * This still uses the selection context in some of the coherence methods I think, so it's not "complete". Putting this up for review and/or for further work in-tree. * I probably need to spend a bit more time making sure that we don't sneakily create any other infcx's during coherence that also need the new solver enabled. r? `@lcnr`
2023-06-06Don't ICE on unsized rust-call abi callMichael Goulet-1/+7
2023-06-06Make TraitEngine::new use the right solver, add compare modeMichael Goulet-1/+1
2023-06-06remove `has_error_field` helper methodlcnr-3/+5
2023-06-05Rollup merge of #112322 - ↵Matthias Krüger-1/+1
compiler-errors:no-IMPLIED_BOUNDS_ENTAILMENT-if-errs, r=eholk Don't mention `IMPLIED_BOUNDS_ENTAILMENT` if signatures reference error Fixes #112321
2023-06-05Don't mention IMPLIED_BOUNDS_ENTAILMENT if signatures reference errorMichael Goulet-1/+1
2023-06-05Avoid going through queries if a value of type `AssocItem` is already availableOli Scherer-3/+3
2023-06-04Use 128 bits for TypeId hashThom Chiovoloni-1/+1
- Switch TypeId to 128 bits - Hack around the fact that tracing-subscriber dislikes how TypeId is hashed - Remove lowering of type_id128 from rustc_codegen_llvm - Remove unnecessary `type_id128` intrinsic (just change return type of `type_id`) - Only hash the lower 64 bits of the TypeId - Reword comment
2023-06-02Separate AnonConst from ConstBlock in HIR.Camille GILLOT-1/+1
2023-06-02Rollup merge of #112165 - fee1-dead-contrib:rn-defualtness, r=compiler-errorsMatthias Krüger-2/+2
Rename `impl_defaultness` to `defaultness` Since this isn't just about the `impl`.
2023-06-02Auto merge of #112198 - compiler-errors:rollup-o2xe4of, r=compiler-errorsbors-77/+14
Rollup of 7 pull requests Successful merges: - #111670 (Require that const param tys implement `ConstParamTy`) - #111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - #112030 (Migrate `item_trait_alias` to Askama) - #112150 (Support 128-bit atomics on all x86_64 Apple targets) - #112174 (Fix broken link) - #112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - #112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - #112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-01Implement custom diagnostic for ConstParamTyMichael Goulet-1/+1
2023-06-01Require that const param tys implement ConstParamTyBoxy-77/+14
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-1/+1
2023-06-01Rename `impl_defaultness` to `defaultness`Deadbeef-2/+2