about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2023-07-05Add some extra information to opaque type cycle errorsOli Scherer-0/+4
2023-07-05Don't require associated types with `Self: Sized` bounds in `dyn Trait` objectsOli Scherer-0/+4
2023-07-05Winnow specializing implsMichael Goulet-2/+2
2023-07-04include `host_effect_index` in `Generics`Deadbeef-0/+3
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-37/+45
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-42/+114
2023-07-04enforce context effects in typeckDeadbeef-0/+15
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-22/+4
2023-07-03Remove chalk from the compilerMichael Goulet-413/+2
2023-07-03use `deeply_normalize` for `assumed_wf_types`lcnr-1/+1
2023-07-03fix structurally relate for weak aliaseslcnr-11/+15
2023-07-02Auto merge of #112718 - oli-obk:SIMD-destructure_mir_const, r=cjgillotbors-19/+10
Make simd_shuffle_indices use valtrees This removes the second-to-last user of the `destructure_mir_constant` query. So in a follow-up we can remove the query and just move the query provider function directly into pretty printing (which is the last user). cc `@rust-lang/clippy` there's a small functional change, but I think it is correct?
2023-07-01Put `FnAbiError` behind reference to shrink resultNilstrieb-18/+10
The `FnAbi` is just a pointer, so the error type should not be bigger.
2023-07-01Put `LayoutError` behind reference to shrink resultNilstrieb-19/+34
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's shrink that.
2023-06-30Fix comment of `fn_can_unwind`Gary Guo-11/+5
2023-06-29Rollup merge of #112670 - petrochenkov:typriv, r=eholkMatthias Krüger-16/+19
privacy: Type privacy lints fixes and cleanups See individual commits. Follow up to https://github.com/rust-lang/rust/pull/111801.
2023-06-28Rollup merge of #112867 - compiler-errors:more-impl-source-nits, r=lcnrDylan DPC-37/+2
More `ImplSource` nits Even more clean-ups, I'll put this up in parallel with the `select_in_new_trait_solver` PR. r? ``@lcnr``
2023-06-28Auto merge of #112708 - flip1995:clippy-freezing-pc-with-ice, r=oli-obkbors-5/+10
Avoid calling queries during query stack printing This has the side effect, that when Clippy should ICE (during an EarlyPass?) it will fill up the RAM with 2 GB/s and then freezes my Laptop. This is blocking the Clippy sync and might give some people really bad experiences, so this should be merged ASAP. r? `@cjgillot` cc `@Zoxc` I only commented this on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60try_print_query_stack.60.20has.20.60ImplicitCtx.60.20during.20.60EarlyPass.60/near/363926180). I should've left a comment on the PR as well. My bad.
2023-06-28Rustdoc nit: refer to macro from docsOli Scherer-1/+1
2023-06-27Auto merge of #113105 - matthiaskrgr:rollup-rci0uym, r=matthiaskrgrbors-5/+18
Rollup of 8 pull requests Successful merges: - #112207 (Add trustzone and virtualization target features for aarch32.) - #112454 (Make compiletest aware of targets without dynamic linking) - #112628 (Allow comparing `Box`es with different allocators) - #112692 (Provide more context for `rustc +nightly -Zunstable-options` on stable) - #112972 (Make `UnwindAction::Continue` explicit in MIR dump) - #113020 (Add tests impl via obj unless denied) - #113084 (Simplify some conditions) - #113103 (Normalize types when applying uninhabited predicate.) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-27Rollup merge of #113103 - cjgillot:normalize-inhabited, r=compiler-errorsMatthias Krüger-1/+12
Normalize types when applying uninhabited predicate. Fixes https://github.com/rust-lang/rust/issues/112997
2023-06-27Rollup merge of #113084 - WaffleLapkin:less_map_or, r=NilstriebMatthias Krüger-3/+4
Simplify some conditions r? `@Nilstrieb` Some things taken out of my `is_none_or` pr.
2023-06-27Rollup merge of #112972 - nbdd0121:mir, r=davidtwcoMatthias Krüger-1/+2
Make `UnwindAction::Continue` explicit in MIR dump Makes it easier to spot unwinding related issues in MIR by making `UnwindAction::Continue` explicit, just like all other `UnwindAction`s.
2023-06-27Normalize types when applying uninhabited predicate.Camille GILLOT-1/+12
2023-06-27Avoid calling queries during query stack printingOli Scherer-4/+9
2023-06-27`thir`: Add `Become` expression kindMaybe Waffle-0/+5
2023-06-27Simplify some conditionsMaybe Waffle-3/+4
2023-06-27Auto merge of #112938 - compiler-errors:clause-3, r=oli-obkbors-115/+100
Migrate `TyCtxt::predicates_of` and `ParamEnv::caller_bounds` to `Clause` The last big change in the series. I will follow-up with additional filed issues once this PR lands: - [ ] Investigate making `TypeFoldable<TyCtxt<'tcx>> for ty::Clause<'tcx>` implementation less weird: https://github.com/rust-lang/rust/blob/2efe09170530fa18e42ff05b8d9dd23f00b5c430/compiler/rustc_middle/src/ty/structural_impls.rs#L672 - [ ] Clean up the elaborator since it should only be emitting child clauses, not predicates - [ ] Rename identifiers like `pred` and `predicates` to `clause` if they're actually clauses around the codebase - [ ] Validate that all of the `ToPredicate` impls are acutally still needed, or prune them if they're not r? `@ghost` until the other branch lands
2023-06-27Auto merge of #112693 - ericmarkmartin:use-more-placeref, r=spastorinobors-7/+4
Use PlaceRef abstractions more often Associated issue: https://github.com/rust-lang/rust/issues/80647 r? `@spastorino`
2023-06-26TypeWellFormedInEnvMichael Goulet-17/+17
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-98/+83
2023-06-26Assert that we don't convert unevaluated MIR promoteds to unevaluated type ↵Oli Scherer-2/+1
constants
2023-06-26Make simd_shuffle_indices use valtreesOli Scherer-17/+9
2023-06-25use PlaceRef abstractions more consistentlyEric Mark Martin-7/+4
2023-06-23Auto merge of #112891 - oli-obk:impl_trait_in_assoc_tys_cleanup, ↵bors-0/+6
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-23Rollup merge of #112870 - compiler-errors:clause-2, r=oli-obkMatthias Krüger-21/+90
Migrate `item_bounds` to `ty::Clause` Should be simpler than the next PR that's coming up. Last three commits are the relevant ones. r? ``@oli-obk`` or ``@lcnr``
2023-06-23Rollup merge of #112810 - compiler-errors:dont-ice-on-bad-layout, r=wesleywiserMatthias Krüger-1/+7
Don't ICE on unnormalized struct tail in layout computation 1. We try to compute a `SizeSkeleton` even if a layout error occurs, but we really only need to do this if we get `LayoutError::Unknown`, since that means our type is too polymorphic to actually compute the full layout. If we have other errors, like `LayoutError::NormalizationError` or `LayoutError::Cycle`, then we can't really make any progress, since this represents an actual error. 2. Avoid using `normalize_erasing_regions` and `struct_tail_erasing_lifetimes` since those ICE on normalization errors, and since we may call `layout_of` in HIR typeck, we don't know for certain that we're on the happy path. Fixes #112736
2023-06-23Make `UnwindAction::Continue` explicit in MIR dumpGary Guo-1/+2
2023-06-22migrate inferred_outlives_of to ClauseMichael Goulet-19/+9
2023-06-22Expect clause moreMichael Goulet-5/+2
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-11/+93
2023-06-22Move `opaque_type_origin_unchecked` onto `TyCtxt` and re-use it where it was ↵Oli Scherer-0/+6
open coded
2023-06-22Auto merge of #112695 - nnethercote:inline-before-merging-cgus, r=wesleywiserbors-11/+9
Inline before merging cgus Because CGU merging relies on CGU sizes, but the CGU sizes before inlining aren't accurate. This change doesn't have much effect on compile perf, but it makes follow-on changes that involve more sophisticated reasoning about CGU sizes much easier. r? `@wesleywiser`
2023-06-22Tweak CGU size estimate code.Nicholas Nethercote-7/+9
- Rename `create_size_estimate` as `compute_size_estimate`, because that makes more sense for the second and subsequent calls for each CGU. - Change `CodegenUnit::size_estimate` from `Option<usize>` to `usize`. We can still assert that `compute_size_estimate` is called first. - Move the size estimation for `place_mono_items` inside the function, for consistency with `merge_codegen_units`.
2023-06-21Print def_id on EarlyBoundRegion debugSantiago Pastorino-1/+1
2023-06-22Inline before merging CGUs.Nicholas Nethercote-4/+0
Because CGU merging relies on CGU sizes, but the CGU sizes before inlining aren't accurate. This requires tweaking how the sizes are updated during merging: if CGU A and B both have an inlined function F, then `size(A + B)` will be a little less than `size(A) + size(B)`, because `A + B` will only have one copy of F. Also, the minimum CGU size is increased because it now has to account for inlined functions. This change doesn't have much effect on compile perf, but it makes follow-on changes that involve more sophisticated reasoning about CGU sizes much easier.
2023-06-21Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnrNilstrieb-122/+186
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-21Rollup merge of #112759 - cjgillot:closure-names, r=oli-obkNilstrieb-76/+26
Make closure_saved_names_of_captured_variables a query. As we will start removing debuginfo during MIR optimizations, we need to keep them somewhere.
2023-06-21Auto merge of #112119 - zirconium-n:issue-113072-merge-borrow-kind, r=lcnrbors-36/+27
Merge `BorrowKind::Unique` into `BorrowKind::Mut` Fixes #112072 Might have conflict with #112070 r? `@lcnr` I'm not sure what's the suitable change in a couple places.
2023-06-20yeet upcast_trait_def_id from ImplSourceObjectDataMichael Goulet-6/+2