summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src
AgeCommit message (Collapse)AuthorLines
2023-07-08Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errorsbors-13/+26
Rollup of 8 pull requests Successful merges: - #113413 (Add needs-triage to all new issues) - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions) - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case) - #113441 (miri: check that assignments do not self-overlap) - #113453 (Remove unused from_method from rustc_on_unimplemented) - #113456 (Avoid calling report_forbidden_specialization for RPITITs) - #113466 (Update cargo) - #113467 (Fix comment of `fn_can_unwind`) r? `@ghost` `@rustbot` modify labels: rollup
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-07Rollup merge of #113427 - compiler-errors:no-variances-of-rpitit-gat, ↵Michael Goulet-9/+3
r=spastorino Remove `variances_of` on RPITIT GATs, remove its one use-case It doesn't make sense to implement variances on a GAT anyways, since we don't relate GATs with variance: https://github.com/rust-lang/rust/blob/85bf07972a1041b9e25393b803d0e006bec3eaaf/compiler/rustc_middle/src/ty/relate.rs#L569-L579 r? ``@spastorino``
2023-07-08Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errorsbors-1/+20
Require TAITs to be mentioned in the signatures of functions that register hidden types for them r? `@lcnr` `@compiler-errors` This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164).
2023-07-07Don't ICE in resolve_bound_vars when associated return-type bounds are in ↵Michael Goulet-2/+12
bad positions
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-07Require TAITs to be mentioned in the signatures of functions that register ↵Oli Scherer-1/+20
hidden types for them
2023-07-07Remove variances_of on RPITIT gats, remove its one use-caseMichael Goulet-9/+3
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-199/+239
2023-07-05Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obkbors-5/+25
Effects/keyword generics MVP This adds `feature(effects)`, which adds `const host: bool` to the generics of const functions, const traits and const impls. This will be used to replace the current logic around const traits. r? `@oli-obk`
2023-07-05Only use a single loop over the associated typesOli Scherer-5/+2
2023-07-05Prefer `retain` over hand-rolling an inefficient version of itOli Scherer-7/+3
2023-07-05tidy: move a large function out of an even larger fileOli Scherer-406/+418
2023-07-05Lint now-unnecessary associated type boundsOli Scherer-4/+30
2023-07-05Don't require associated types with `Self: Sized` bounds in `dyn Trait` objectsOli Scherer-0/+10
2023-07-04include `host_effect_index` in `Generics`Deadbeef-5/+21
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-11/+11
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-13/+15
2023-07-04add testDeadbeef-2/+6
2023-07-04Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnrbors-6/+3
Remove chalk support from the compiler Removes chalk (`-Ztrait-solver=chalk`) from the compiler and prunes any dead code resulting from this, mainly: * Remove the chalk compatibility layer in `compiler/rustc_traits/src/chalk` * Remove the chalk flag `-Ztrait-solver=chalk` and its `TraitEngine` implementation * Remove `TypeWellFormedFromEnv` (and its many `bug!()` match arms) * Remove the chalk migration mode from compiletest * Remove the `chalkify` UI tests (do we want to keep any of these, but migrate them to `-Ztrait-solver=next`??) Fulfills rust-lang/types-team#93. r? `@jackh726`
2023-07-04Auto merge of #113215 - compiler-errors:rpitit-predicates-tweaks, r=spastorinobors-3/+16
Make RPITITs assume/require their parent method's predicates Removes a FIXME from the `param_env` query where we were manually adding the parent function's predicates to the RPITIT's assumptions. r? `@spastorino`
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-6/+3
2023-07-03Rollup merge of #113286 - fmease:iat-dont-select-if-not-enabled, ↵Guillaume Gomez-5/+9
r=compiler-errors Don't perform selection if inherent associated types are not enabled Fixes #113265. As discussed r? `@compiler-errors`
2023-07-03Don't perform selection if IATs are not enabledLeón Orell Valerian Liehr-5/+9
2023-07-03use `deeply_normalize` for `assumed_wf_types`lcnr-21/+27
2023-07-01Rollup merge of #113182 - compiler-errors:rpit-stricter-captures, r=oli-obkMatthias Krüger-32/+116
Error when RPITITs' hidden types capture more lifetimes than their trait definitions This implements a stricter set of captures rules for RPITITs. They now may only capture: 1. Lifetimes from the impl header (both the self type and any trait substs -- we may want to restrict just to the self type's lifetimes, but the PR makes that easy to do, too) 2. Lifetimes mentioned by the `impl Trait` in the trait method's definition. Namely, they may not mention lifetimes from the method (early or late) that are not mentioned in the `impl Trait`. cc #105258 which I think was trying to do this too, though I'm not super familiar with what exactly differs from that or why that one was broken. cc #112194 (doesn't fix this issue per se, because it's still an open question, but I think this is objectively better than the status quo, and gets us closer to resolving that issue.) Technically is a fix for the ICE in #108580, but it turns that issue into an error now. We can decide separately whether or not nested RPITITs should capture lifetimes from their parents. r? ``@oli-obk``
2023-07-01Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errorsbors-3/+3
change snapshot tracking in fulfillment contexts use the exact snapshot number to prevent misuse even when created inside of a snapshot
2023-06-30RPITITs inherit method predicatesMichael Goulet-2/+14
2023-06-30use explicit predicatesMichael Goulet-1/+2
2023-06-30Rollup merge of #113171 - spastorino:new-rpitit-25, r=compiler-errorsMatthias Krüger-9/+15
Properly implement variances_of for RPITIT GAT This fixes some of the issues found by crater run in https://github.com/rust-lang/rust/pull/112988#issuecomment-1610019572 r? ``@compiler-errors``
2023-06-30Rollup merge of #113071 - ↵Matthias Krüger-6/+74
compiler-errors:no-parent-non-lifetime-args-in-apit, r=eholk Account for late-bound vars from parent arg-position impl trait We should be reporting an error like we do for late-bound args coming from a parent APIT. Fixes #113016
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-29Properly implement variances_of for RPITIT GATSantiago Pastorino-9/+15
2023-06-29Add bidirectional where clauses on RPITIT synthesized GATsSantiago Pastorino-2/+56
2023-06-29Intern OpaqueTy on ItemKind::OpaqueTySantiago Pastorino-6/+6
2023-06-29Extract compute_bidirectional_outlives_predicates fnSantiago Pastorino-33/+51
2023-06-29change snapshot tracking in fulfillment contextslcnr-3/+3
2023-06-28Auto merge of #112629 - compiler-errors:atb-imply, r=jackh726bors-101/+84
Make associated type bounds in supertrait position implied `trait A: B<Assoc: C> {}` should be able to imply both `Self: B` and `<Self as B>::Assoc: C`. Adjust the way that we collect implied predicates to do so. Fixes #112573 Fixes #112568
2023-06-27Rollup merge of #113084 - WaffleLapkin:less_map_or, r=NilstriebMatthias Krüger-5/+5
Simplify some conditions r? `@Nilstrieb` Some things taken out of my `is_none_or` pr.
2023-06-27pass PredicateFilter to compute_boundsMichael Goulet-72/+51
2023-06-27Make associated type bounds in supertrait position impliedMichael Goulet-50/+54
2023-06-27Simplify some conditionsMaybe Waffle-5/+5
2023-06-26TypeWellFormedInEnvMichael Goulet-3/+5
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-196/+139
2023-06-26migrate lifetime tooMichael Goulet-6/+11
2023-06-26Account for late-bound vars from parent arg-position impl traitMichael Goulet-0/+63