about summary refs log tree commit diff
path: root/compiler/rustc_middle
AgeCommit message (Collapse)AuthorLines
2023-03-21query_keys_local is conditional on separate_provide_if_externMichael Goulet-15/+14
2023-03-21LocalCrate keyMichael Goulet-7/+13
2023-03-21AsLocalKey traitMichael Goulet-312/+47
2023-03-21IdentitySubsts::identity_for_item takes Into<DefId>Michael Goulet-6/+6
2023-03-21Use LocalDefId in ItemCtxtMichael Goulet-4/+4
2023-03-21Use local key in providersMichael Goulet-147/+262
2023-03-21new solver cleanup + coherencelcnr-6/+5
2023-03-21Rollup merge of #109408 - RalfJung:retags, r=compiler-errorsnils-1/+2
not *all* retags might be explicit in Runtime MIR In https://github.com/rust-lang/rust/pull/105317 I made Miri treat `Rvalue::Ref/AddrOf` as implicit retagging sites. This updates the MIR docs accordingly. For `Rvalue::Ref` I think this makes a lot more sense: creating a new reference is their entire point, so we can avoid bloating the MIR with retags. Also this seems to be the best way to handle cases like `*ptr = &[mut] ...`, where doing a retag is somewhat questionable since maybe `*ptr` points to another place now? For `Rvalue::AddrOf`, Stacked Borrows needs this because even raw ptrs need some retagging, but Tree Borrows doesn't do ant retagging here and I hope we'll end up with a model where raw pointers don't get retagged.
2023-03-21Rollup merge of #109390 - cbeuw:aggregate-lit, r=oli-obknils-1/+1
Custom MIR: Support aggregate expressions Add support for tuple, array and ADT expressions in custom mir r? `````@oli-obk````` or `````@tmiasko````` or `````@JakobDegen`````
2023-03-21Rollup merge of #109240 - compiler-errors:dont-binder-twice, r=oli-obknils-14/+1
Walk un-shifted nested `impl Trait` in trait when setting up default trait method assumptions Fixes a double subtraction in some binder math in return-position `impl Trait` in trait handling code. Fixes #109239
2023-03-21Deduplicate fn trait compatibility checksOli Scherer-1/+13
2023-03-21remove some trait solver helperslcnr-0/+14
they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
2023-03-20Enforce non-lifetime-binders in supertrait preds are not object safeMichael Goulet-2/+11
2023-03-20not *all* retags might be explicit in Runtime MIRRalf Jung-1/+2
2023-03-20Fix off-by-one in mir syntax docAndy Wang-1/+1
2023-03-20Remove Ty::is_region_ptrMu42-6/+1
2023-03-20Update some names and commentsMichael Goulet-3/+5
2023-03-20drive-by: Fix a comment in TyCtxt::fold_regions and remove an unused methodMichael Goulet-14/+1
2023-03-18Implement FixedSizeEncoding for UnusedGenericParams.Camille GILLOT-0/+14
2023-03-18Rollup merge of #109234 - tmiasko:overflow-checks, r=cjgillotMatthias Krüger-12/+8
Tweak implementation of overflow checking assertions Extract and reuse logic controlling behaviour of overflow checking assertions instead of duplicating it three times. r? `@cjgillot`
2023-03-17Remove VecMapMichael Goulet-5/+4
2023-03-17Rollup merge of #109198 - compiler-errors:new-rpitit-default-body, r=spastorinoMatthias Krüger-7/+18
Install projection from RPITIT to default trait method opaque correctly 1. For new lowering strategy `-Zlower-impl-trait-in-trait-to-assoc-ty`, install the correct default trait method projection predicates (RPITIT -> opaque). This makes default trait body tests pass! 2. Fix two WF-checking bugs -- first, we want to make sure that we're always looking for an opaque type in `check_return_position_impl_trait_in_trait_bounds`. That's because the RPITIT projections are normalized to opaques during wfcheck. Second, fix RPITIT's param-envs by not adding the projection predicates that we install on trait methods to make default RPITITs work -- I left a comment why. 3. Also, just a small drive-by for `rustc_on_unimplemented`. Not sure if it affects any tests, but can't hurt. r? ````@spastorino,```` based off of #109140
2023-03-17Rollup merge of #108958 - clubby789:unbox-the-hir, r=compiler-errorsMatthias Krüger-2/+0
Remove box expressions from HIR After #108516, `#[rustc_box]` is used at HIR->THIR lowering and this is no longer emitted, so it can be removed. This is based on top of #108471 to help with conflicts, so 43490488ccacd1a822e9c621f5ed6fca99959a0b is the only relevant commit (sorry for all the duplicated pings!) ````@rustbot```` label +S-blocked
2023-03-16Tweak implementation of overflow checking assertionsTomasz Miąsko-12/+8
Extract and reuse logic controlling behaviour of overflow checking assertions instead of duplicating it three times.
2023-03-16Auto merge of #108944 - cjgillot:clear-local-info, r=oli-obkbors-44/+37
Wrap the whole LocalInfo in ClearCrossCrate. MIR contains a lot of information about locals. The primary purpose of this information is the quality of borrowck diagnostics. This PR aims to drop this information after MIR analyses are finished, ie. starting from post-cleanup runtime MIR.
2023-03-16Rollup merge of #109180 - gimbles:master, r=compiler-errorsMatthias Krüger-9/+9
Unequal → Not equal Fixes #109168
2023-03-16Rollup merge of #109151 - compiler-errors:debug-assert-alias, r=WaffleLapkinMatthias Krüger-0/+7
Assert def-kind is correct for alias types Make sure we're not constructing alias types for the wrong def-kind, at least for debug cases :sweat_smile:
2023-03-15Auto merge of #108282 - cjgillot:mir-checked-sh, r=tmiaskobors-16/+12
Implement checked Shl/Shr at MIR building. This does not require any special handling by codegen backends, as the overflow behaviour is entirely determined by the rhs (shift amount). This allows MIR ConstProp to remove the overflow check for constant shifts. ~There is an existing different behaviour between cg_llvm and cg_clif (cc `@bjorn3).` I took cg_llvm's one as reference: overflow if `rhs < 0 || rhs > number_of_bits_in_lhs_ty`.~ EDIT: `cg_llvm` and `cg_clif` implement the overflow check differently. This PR uses `cg_llvm`'s implementation based on a `BitAnd` instead of `cg_clif`'s one based on an unsigned comparison.
2023-03-15Feed is_type_alias_impl_trait for RPITITs on the trait sideSantiago Pastorino-0/+1
2023-03-15ImplTraitPlaceholder -> is_impl_trait_in_traitSantiago Pastorino-1/+5
2023-03-15unequal → not equalgimbles-9/+9
2023-03-15Make impl_trait_in_trait_container consider newly generated RPITITsSantiago Pastorino-4/+10
2023-03-15Rename impl_trait_in_trait_parent to impl_trait_in_trait_parent_fnSantiago Pastorino-2/+2
2023-03-15Rollup merge of #109109 - compiler-errors:polymorphize-foreign, r=NilstriebDylan DPC-2/+2
Use `unused_generic_params` from crate metadata Due to the way that `separate_provide_extern` interacted with the implementation of `<ty::InstanceDef<'tcx> as Key>::query_crate_is_local`, we actually never hit the foreign provider for `unused_generic_params`. Additionally, since the *local* provider of `unused_generic_params` calls `should_polymorphize`, which always returns false if the def-id is foreign, this means that we never actually polymorphize monomorphic instances originating from foreign crates. We don't actually encode `unused_generic_params` for items where all generics are used, so I had to tweak the foreign provider to fall back to `ty::UnusedGenericParams::new_all_used()` to avoid more ICEs when the above bugs were fixed.
2023-03-15Auto merge of #109089 - compiler-errors:opt_rpitit_info-follow-up, r=spastorinobors-0/+1
Encode `opt_rpitit_info` for associated types Follow-up, only last commit matters r? `@spastorino` This needs a perf run after the parent pr lands
2023-03-14Don't make projection tys out of anon constsMichael Goulet-1/+1
2023-03-14Assert def-kind is correct for alias typesMichael Goulet-0/+7
2023-03-14Encode opt_rpitit_info for associated typesMichael Goulet-0/+1
2023-03-14ICE when checking LocalInfo on runtime MIR.Camille GILLOT-18/+13
2023-03-14Remove LocalKind::Var.Camille GILLOT-5/+1
2023-03-14Make is_block_tail a variant of LocalInfo.Camille GILLOT-18/+5
2023-03-14Wrap the whole LocalInfo in ClearCrossCrate.Camille GILLOT-14/+29
2023-03-14Remove box expressions from HIRclubby789-2/+0
2023-03-14Rollup merge of #109101 - compiler-errors:layout-err, r=michaelwoeristerMatthias Krüger-1/+5
Fall back to old metadata computation when type references errors Projection is a bit too aggressive normalizing `<dyn Trait<[type error]> as Pointee>::Metadata` to `[type error]`, rather than to `DynMetadata<..>`. Side-step that by just falling back to the old structural metadata computation. Fixes #109078
2023-03-14Use `unused_generic_params` from crate metadataMichael Goulet-2/+2
2023-03-14Remove some direct calls to local_def_id_to_hir_id on diagnosticsSantiago Pastorino-2/+2
2023-03-14Auto merge of #109057 - compiler-errors:rpitit-info-again, r=spastorinobors-11/+20
Don't `opt_rpitit_info` as a separate query ... another attempt to undo regressions r? `@ghost`
2023-03-13Layout of `&dyn Trait<[type error]>` is still wideMichael Goulet-1/+5
2023-03-13Rollup merge of #109058 - tmiasko:is-checkable, r=jackh726Matthias Krüger-0/+3
Document BinOp::is_checkable
2023-03-13Don't opt_rpitit_info as a separate queryMichael Goulet-11/+20