Commit Graph

5401 Commits

Author SHA1 Message Date
bors
c44324a4fe Auto merge of #113677 - bryangarza:unevaluated-const-ice_issue-110892, r=davidtwco
Safe Transmute: Fix ICE (due to UnevaluatedConst)

This patch updates the code that looks at the `Assume` type when evaluating if transmutation is possible. An ICE was being triggered in the case that the `Assume` parameter contained an unevaluated const (in this test case, due to a function with missing parameter names).

Fixes #110892
2023-07-18 09:07:32 +00:00
Michael Goulet
05f6890b3e Rename arg_iter to iter_instantiated 2023-07-17 21:04:12 +00:00
Bryan Garza
ef50e204f3 Safe Transmute: Fix ICE (due to UnevaluatedConst)
This patch updates the code that looks at the `Assume` type when evaluating if
transmutation is possible. An ICE was being triggered in the case that the
`Assume` parameter contained an unevaluated const (in this test case, due to a
function with missing parameter names).

Fixes #110892
2023-07-17 09:43:35 -07:00
Camille GILLOT
fdc93f307f Do not fetch HIR in native_libs. 2023-07-17 07:37:03 +00:00
bors
6f65ef5717 Auto merge of #113562 - saethlin:larger-incr-comp-offset, r=nnethercote
Use u64 for incr comp allocation offsets

Fixes https://github.com/rust-lang/rust/issues/76037
Fixes https://github.com/rust-lang/rust/issues/95780
Fixes https://github.com/rust-lang/rust/issues/111613

These issues are all reporting ICEs caused by using `u32` to store offsets to allocations in the incremental compilation cache. This PR aims to lift that limitation by changing the offset type in question to `u64`.

There are two perf runs in this PR. The first reports a regression, and the second does not. The changes are the same in both. I rebased the PR then did the second perf run because I noticed that the primary regression in it was very commonly seen in spurious regression reports.

I do not know what the perf run will report when this is merged. I would not be surprised to see regression or neutral, but the cachegrind diffs for the regression point at `try_mark_previous_green` which is a common source of inexplicable regressions and I don't think should be perturbed by this PR.

I'm not opposed to adding a regression test such as
```rust
fn main() {
    println!("{}", [37; 1 << 30].len());
}
```
But that program takes 1 minute to compile and consumes 4.6 GB of memory then writes that much to disk. Is that a concerning amount of resource use for a test?

r? `@nnethercote`
2023-07-17 04:45:10 +00:00
bors
299179e694 Auto merge of #113772 - nnethercote:streamline-size-estimates-2, r=wesleywiser
Streamline size estimates (take 2)

This was merged in #113684 but then [something happened](https://github.com/rust-lang/rust/pull/113684#issuecomment-1636811985):

> There has been a bors issue that lead to the merge commit of this PR getting purged from master.
> You'll have to make a new PR to reapply it.

So this is exactly the same changes.

`@bors` r=wesleywiser
2023-07-17 02:56:10 +00:00
bors
4c7af429f3 Auto merge of #113336 - compiler-errors:new-solver-iat, r=lcnr
Add support for inherent projections in new solver

Not hard to support these, and it cuts out a really big chunk of failing UI tests with `--compare-mode=next-solver`

r? `@lcnr` (feel free to reassign, anyone can review this)
2023-07-17 01:06:36 +00:00
Nicholas Nethercote
005a70e303 Remove instance_def_size_estimate query.
It doesn't seem worthwhile now that `MonoItem::size_estimate` is called
much less often.
2023-07-17 08:44:48 +10:00
Nicholas Nethercote
edd1f3827e Store item size estimate in MonoItemData.
This means we call `MonoItem::size_estimate` (which involves a query)
less often: just once per mono item, and then once more per inline item
placement. After that we can reuse the stored value as necessary. This
means `CodegenUnit::compute_size_estimate` is cheaper.
2023-07-17 08:44:48 +10:00
Nicholas Nethercote
b52f9eb6ca Introduce MonoItemData.
It replaces `(Linkage, Visibility)`, making the code nicer. Plus the
next commit will add another field.
2023-07-17 08:44:48 +10:00
Matthias Krüger
2b4c194234
Rollup merge of #113539 - agnarrarendelle:master, r=workingjubilee
fixed typo

Hi, I have fixed a few typos in commands. Please review my pr.
2023-07-17 00:14:05 +02:00
Camille GILLOT
a4a5e5b4ae Querify unused trait check. 2023-07-16 21:51:00 +00:00
Michael Goulet
085ae9e8b4 Add support for inherent projections 2023-07-16 21:14:38 +00:00
bors
7a17f577b3 Auto merge of #112157 - erikdesjardins:align, r=nikic
Resurrect: rustc_target: Add alignment to indirectly-passed by-value types, correcting the alignment of byval on x86 in the process.

Same as #111551, which I [accidentally closed](https://github.com/rust-lang/rust/pull/111551#issuecomment-1571222612) :/

---

This resurrects PR #103830, which has sat idle for a while.

Beyond #103830, this also:
- fixes byval alignment for types containing vectors on Darwin (see `tests/codegen/align-byval-vector.rs`)
- fixes byval alignment for overaligned types on x86 Windows (see `tests/codegen/align-byval.rs`)
- fixes ABI for types with 128bit requested alignment on ARM64 Linux (see `tests/codegen/aarch64-struct-align-128.rs`)

r? `@nikic`

---

`@pcwalton's` original PR description is reproduced below:

Commit 88e4d2c from five years ago removed
support for alignment on indirectly-passed arguments because of problems with
the `i686-pc-windows-msvc` target. Unfortunately, the `memcpy` optimizations I
recently added to LLVM 16 depend on this to forward `memcpy`s. This commit
attempts to fix the problems with `byval` parameters on that target and now
correctly adds the `align` attribute.

The problem is summarized in [this comment] by `@eddyb.` Briefly, 32-bit x86 has
special alignment rules for `byval` parameters: for the most part, their
alignment is forced to 4. This is not well-documented anywhere but in the Clang
source. I looked at the logic in Clang `TargetInfo.cpp` and tried to replicate
it here. The relevant methods in that file are
`X86_32ABIInfo::getIndirectResult()` and
`X86_32ABIInfo::getTypeStackAlignInBytes()`. The `align` parameter attribute
for `byval` parameters in LLVM must match the platform ABI, or miscompilations
will occur. Note that this doesn't use the approach suggested by eddyb, because
I felt it was overkill to store the alignment in `on_stack` when special
handling is really only needed for 32-bit x86.

As a side effect, this should fix #80127, because it will make the `align`
parameter attribute for `byval` parameters match the platform ABI on LLVM
x86-64.

[this comment]: #80822 (comment)
2023-07-15 15:39:53 +00:00
Erik Desjardins
2daacf5af9 i686-windows: make requested alignment > 4 special case apply transitively 2023-07-14 17:48:13 -04:00
Ben Kimock
4e117a9b4e Use u64 for incr comp allocation offsets 2023-07-14 17:03:34 -04:00
Matthias Krüger
0baf4406da
Rollup merge of #113698 - compiler-errors:rpitit-check, r=spastorino
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-14 19:33:29 +02:00
Matthias Krüger
f6dbf7d69b
Rollup merge of #113599 - chenyukang:yukang-fix-use-maybe_body_owned_by, r=cjgillot
Use maybe_body_owned_by for multiple suggestions

This is a continued work from https://github.com/rust-lang/rust/pull/113567

We have several other suggestions not working for closure, this PR use `maybe_body_owned_by` to fix them and add test cases for them.
2023-07-14 19:33:26 +02:00
Michael Goulet
14672eba8b Make it clearer that we're just checking for an RPITIT 2023-07-14 15:18:48 +00:00
Mahdi Dibaiee
e55583c4b8 refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
Michael Woerister
457b787a52 Introduce ExtentUnord trait for collections that can safely consume UnordItems. 2023-07-14 10:10:15 +02:00
Michael Woerister
cfb310939b Enable potential_query_instability lint in rustc_hir_typeck.
Fix linting errors by using FxIndex(Map|Set) and Unord(Map|Set) as appropriate.
2023-07-14 10:10:14 +02:00
bors
fe03b46ee4 Auto merge of #113609 - nnethercote:maybe_lint_level_root_bounded-cache, r=cjgillot
Add a cache for `maybe_lint_level_root_bounded`

`maybe_lint_level_root_bounded` is called many times and traces node sub-paths many times. This PR adds a cache that lets many of these tracings be skipped, avoiding lots of calls to functions like `Map::attrs` and `Map::parent_id`.

r? `@cjgillot`
2023-07-14 05:30:53 +00:00
yukang
bdd04a62f9 fix the issue of shorthand in suggest_cloning 2023-07-14 07:12:38 +08:00
Matthias Krüger
b0eb3c7ee4
Rollup merge of #113570 - lcnr:inspect-format, r=BoxyUwU
refactor proof tree formatting

mostly:
- handle indentation via a separate formatter
- change nested to use a closure

tested it after rebasing on top of #113536 and everything looks good.

r? `````@BoxyUwU`````
2023-07-13 22:33:24 +02:00
lcnr
1b4b2e0230 typo 2023-07-13 11:11:13 +02:00
lcnr
f446894804 refactor proof tree formatting 2023-07-13 11:11:13 +02:00
Mark Rousskov
cc907f80b9 Re-format let-else per rustfmt update 2023-07-12 21:49:27 -04:00
Mark Rousskov
67b0cfc761 Flip cfg's for bootstrap bump 2023-07-12 21:38:55 -04:00
bors
136dab6614 Auto merge of #113569 - RalfJung:miri, r=oli-obk
miri: protect Move() function arguments during the call

This gives `Move` operands a meaning specific to function calls:
- for the duration of the call, the place the operand comes from is protected, making all read and write accesses insta-UB.
- the contents of that place are reset to `Uninit`, so looking at them again after the function returns, we cannot observe their contents

Turns out we can replace the existing "retag return place" hack with the exact same sort of protection on the return place, which is nicely symmetric.

Fixes https://github.com/rust-lang/rust/issues/112564
Fixes https://github.com/rust-lang/miri/issues/2927

This starts with a Miri rustc-push, since we'd otherwise conflict with a PR that recently landed in Miri.
(The "miri tree borrows" commit is an unrelated cleanup I noticed while doing the PR. I can remove it if you prefer.)
r? `@oli-obk`
2023-07-12 10:19:42 +00:00
bors
910be1b3e8 Auto merge of #113573 - lcnr:typeck-results, r=compiler-errors
remove unnecessary `Rc`

the typeck results are already in a `RefCell`, so we don't need to wrap its fields in an `Rc`
2023-07-12 07:50:40 +00:00
Nicholas Nethercote
f234dc3e1c Move maybe_lint_level_root_bounded.
From `TyCtxt` to the MIR `Builder`. This will allow us to add a cache to
`Builder` and use it from `maybe_lint_level_root_bounded`.
2023-07-12 10:02:13 +10:00
bors
993deaa0bf Auto merge of #112984 - BoxyUwU:debug_with_infcx, r=compiler-errors
Introduce `trait DebugWithInfcx` to debug format types with universe info

Seeing universes of infer vars is valuable for debugging but currently we have no way of easily debug formatting a type with the universes of all the infer vars shown. In the future I hope to augment the new solver's proof tree output with a `DebugWithInfcx` impl so that it can show universes but I left that out of this PR as it would be non trivial and this is already large and complex enough.

The goal here is to make the various abstractions taking `T: Debug` able to use the codepath for printing out universes, that way we can do `debug!("{:?}", my_x)` and have `my_x` have universes shown, same for the `write!` macro. It's not possible to put the `Infcx: InferCtxtLike<I>` into the formatter argument to `Debug::fmt` so it has to go into the self ty. For this we introduce the type `OptWithInfcx<I: Interner, Infcx: InferCtxtLike<I>, T>` which has the data `T` optionally coupled with the infcx (more on why it's optional later).

Because of coherence/orphan rules it's not possible to write the impl `Debug for OptWithInfcx<..., MyType>` when `OptWithInfcx` is in a upstream crate. This necessitates a blanket impl in the crate defining `OptWithInfcx` like so: `impl<T: DebugWithInfcx> Debug for OptWithInfcx<..., T>`. It is not intended for people to manually call `DebugWithInfcx::fmt`, the `Debug` impl for `OptWithInfcx` should be preferred.

The infcx has to be optional in `OptWithInfcx` as otherwise we would end up with a large amount of code duplication. Almost all types that want to be used with `OptWithInfcx` do not themselves need access to the infcx so if we were to not optional we would end up with large `Debug` and `DebugWithInfcx` impls that were practically identical other than that when formatting their fields we wrap the field in `OptWithInfcx` instead of formatting it alone.

The only types that need access to the infcx themselves are ty/const/region infer vars, everything else is implemented by having the `Debug` impl defer to `OptWithInfcx` with no infcx available. The `DebugWithInfcx` impl is pretty much just the standard `Debug` impl except that instead of recursively formatting fields with `write!(f, "{x:?}")` we must do `write!(f, "{:?}", opt_infcx.wrap(x))`. This is some pretty rough boilerplate but I could not think of an alternative unfortunately.

`OptWithInfcx::wrap` is an eager `Option::map` because 99% of callsites were discarding the existing data in `OptWithInfcx` and did not need lazy evaluation.

A trait `InferCtxtLike` was added instead of using `InferCtxt<'tcx>` as we need to implement `DebugWithInfcx` for types living in `rustc_type_ir` which are generic over an interner and do not have access to `InferCtxt` since it lives in `rustc_infer`. Additionally I suspect that adding universe info to new solver proof tree output will require an implementation of `InferCtxtLike` for something that is not an `InferCtxt` although this is not the primary motivaton.

---

To summarize:
- There is a type `OptWithInfcx` which bundles some data optionally with an infcx with allows us to pass an infcx into a `Debug` impl. It's optional instead of being there unconditionally so that we can share code for `Debug` and `DebugWithInfcx` impls that don't care about whether there is an infcx available but have fields that might care.
- There is a trait `DebugWithInfcx` which allows downstream crates to add impls of the form `Debug for OptWithInfcx<...>` which would normally be forbidden by orphan rules/coherence.
- There is a trait `InferCtxtLike` to allow us to implement `DebugWithInfcx` for types that live in `rustc_type_ir`

This allows debug formatting various `ty::*` structures with universes shown by using the `Debug` impl for `OptWithInfcx::new(ty, infcx)`

---

This PR does not add `DebugWithInfcx` impls to absolutely _everything_ that should realistically have them, for example you cannot use `OptWithInfcx<Obligation<Predicate>>`. I am leaving this to a future PR to do so as it would likely be a lot more work to do.
2023-07-11 20:54:00 +00:00
Ralf Jung
124fb1490a update Operand::Move docs 2023-07-11 21:59:01 +02:00
agnarrarendelle
dcfcc77282 fixed typos 2023-07-12 01:25:47 +08:00
lcnr
e386d410e0 remove unnecessary Rc 2023-07-11 15:10:21 +02:00
Erik Desjardins
d1e764cb3b aarch64-linux: properly handle 128bit aligned aggregates 2023-07-10 19:19:40 -04:00
Erik Desjardins
7e933b4e26 repr(align) <= 4 should still be byval 2023-07-10 19:19:40 -04:00
Erik Desjardins
00b3eca0df move has_repr to layout, handle repr(transparent) properly 2023-07-10 19:19:39 -04:00
Erik Desjardins
ed317e4a47 i686-windows: pass arguments with requested alignment > 4 indirectly 2023-07-10 19:19:38 -04:00
Santiago Pastorino
20429af7a3
Replace RPITIT current impl with new strategy that lowers as a GAT 2023-07-08 18:21:34 -03:00
bors
9bb6fbe261 Auto merge of #113376 - Nilstrieb:pointer-coercions-are-not-casts-because-that-sounds-way-to-general-aaaa, r=oli-obk
Rename `adjustment::PointerCast` and variants using it to `PointerCoercion`

It makes it sounds like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a little enum variants. Make it clear there these are only coercions and that people who see this and think "why are so many pointer related casts not in these variants" aren't insane.

This enum was added in #59987. I'm not sure whether the variant sharing is actually worth it, but this at least makes it less confusing.

r? oli-obk
2023-07-08 13:48:30 +00:00
Michael Goulet
7a22c7e6f4
Rollup merge of #113467 - nbdd0121:unwind, r=compiler-errors
Fix comment of `fn_can_unwind`

Reopen of #113213
2023-07-07 22:12:19 -07:00
Nilstrieb
2beabbbf6f Rename adjustment::PointerCast and variants using it to PointerCoercion
It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related
casts, when in reality their just used to share a some enum variants. Make it clear there these
are only coercion to make it clear why only some pointer related "casts" are in the enum.
2023-07-07 18:17:16 +02:00
bors
cb80ff132a Auto merge of #113245 - lukas-code:unsizing-sanity-check, r=the8472
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-07 15:42:29 +00:00
Michael Goulet
3f8919c09b get rid of a bit more calls to poly_select 2023-07-06 16:50:12 +00:00
Michael Goulet
52f7384995 Separate select calls that don't need a binder 2023-07-06 16:50:12 +00:00
Lukas Markeffsky
7aa5f39d3b add helper methods for accessing struct tail 2023-07-06 13:15:05 +00:00
Boxy
3fdb443e4e Add a new trait to Debug things with an infcx available 2023-07-06 11:36:39 +01:00
bors
4dd1719b34 Auto merge of #113377 - BoxyUwU:move_ty_ctors_to_ty, r=compiler-errors
Move `TyCtxt::mk_x` to `Ty::new_x` where applicable

Part of rust-lang/compiler-team#616

turns out there's a lot of places we construct `Ty` this is a ridiculously huge PR :S

r? `@oli-obk`
2023-07-06 08:10:42 +00:00
Oli Scherer
deda49e7b7 Fix up doc links 2023-07-06 07:32:08 +00:00
bors
bd8aabef31 Auto merge of #113291 - oli-obk:pretty_print_mir_const, r=RalfJung
Specialize `try_destructure_mir_constant` for its sole user (pretty printing)

We can't remove the query, as we need to invoke it from rustc_middle, but can only implement it in mir interpretation/const eval.

r? `@RalfJung` for a first round.

While we could move all the logic into pretty printing, that would end up duplicating a bit of code with const eval, which doesn't seem great either.
2023-07-06 00:00:38 +00:00
Michael Goulet
6ce1c89d64
Change comment on TyCtxt::mk_ty_from_kind 2023-07-05 13:58:04 -07:00
Boxy
12138b8e5e Move TyCtxt::mk_x to Ty::new_x where applicable 2023-07-05 20:27:07 +01:00
bors
5dac6b320b Auto merge of #113370 - compiler-errors:rollup-8gvyy8e, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #113010 (rust-installer & rls: remove exclusion from rustfmt & tidy )
 - #113317 ( -Ztrait-solver=next: stop depending on old solver)
 - #113319 (`TypeParameterDefinition` always require a `DefId`)
 - #113320 (Add some extra information to opaque type cycle errors)
 - #113321 (Move `ty::ConstKind` to `rustc_type_ir`)
 - #113337 (Winnow specialized impls during selection in new solver)
 - #113355 (Move most coverage code out of `rustc_codegen_ssa`)
 - #113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-05 16:08:43 +00:00
Oli Scherer
e1e04a8bee Document magic boolean 2023-07-05 15:58:19 +00:00
Oli Scherer
8ac1a67d11 Name the destructure_mir_constant query appropriately 2023-07-05 15:54:43 +00:00
Oli Scherer
09b89efa70 Remove a function argument that is always passed with the same value. 2023-07-05 15:54:43 +00:00
Oli Scherer
a0eb348d38 Specialize DestructuredConstant to its one user (pretty printing) 2023-07-05 15:54:43 +00:00
Oli Scherer
4dcf988360 Specialize try_destructure_mir_constant for its sole user 2023-07-05 15:54:43 +00:00
Michael Goulet
c31fe41453
Rollup merge of #113337 - compiler-errors:next-solver-winnow-specializing, r=lcnr
Winnow specialized impls during selection in new solver

We need to be able to winnow impls that are specialized by more specific impls in order for codegen to be able to proceed.

r? ``@lcnr``
2023-07-05 08:45:45 -07:00
Michael Goulet
b2b1a50751
Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obk
Move `ty::ConstKind` to `rustc_type_ir`

Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver.

Rebased on top of #113325, only the second and third commits needs reviewing
2023-07-05 08:45:45 -07:00
Michael Goulet
0334b64cbb
Rollup merge of #113320 - oli-obk:eval_obligation_query, r=petrochenkov,BoxyUwU
Add some extra information to opaque type cycle errors

Plus a bunch of cleanups.

This should help users debug query cycles due to auto trait checking. We'll probably want to fix cycle errors in most (or all?) cases by looking at the current item's hidden types (new solver does this), and by delaying the auto trait checks to after typeck.
2023-07-05 08:45:44 -07:00
bors
e4cd161006 Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obk
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-05 13:42:00 +00:00
Boxy
62174bfe72 Deal with fallout 2023-07-05 09:46:30 +01:00
Boxy
8ac3ffe834 move ConstKind to typeir and move inherent impls to Const 2023-07-05 09:46:30 +01:00
Oli Scherer
9e98feb84c Add some extra information to opaque type cycle errors 2023-07-05 07:43:35 +00:00
Oli Scherer
ca581f9161 Don't require associated types with Self: Sized bounds in dyn Trait objects 2023-07-05 07:42:53 +00:00
Michael Goulet
d2a1803d6f Winnow specializing impls 2023-07-05 06:18:48 +00:00
Deadbeef
58c105af04 include host_effect_index in Generics 2023-07-04 17:21:52 +00:00
Boxy
d30f56dbf2 Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
Boxy
ddbc774e74 Replace mk_const with Const::new_x methods 2023-07-04 14:26:33 +01:00
Deadbeef
8eb3e0bf30 enforce context effects in typeck 2023-07-04 11:47:46 +00:00
Michael Goulet
0c73b41cd6 remove TypeWellFormedFromEnv 2023-07-03 21:40:04 +00:00
Michael Goulet
810fbf086d Remove chalk from the compiler 2023-07-03 21:40:04 +00:00
lcnr
5378f07d64 use deeply_normalize for assumed_wf_types 2023-07-03 09:12:14 +02:00
lcnr
bd0d533d23 fix structurally relate for weak aliases 2023-07-03 09:12:14 +02:00
bors
4c3f8c728b Auto merge of #113256 - matthiaskrgr:rollup-poex8w2, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #113147 (Fix document examples of Vec::from_raw_parts and Vec::from_raw_parts_in)
 - #113202 (std docs: factorize literal in Barrier example)
 - #113228 (Migrate GUI colors test to original CSS color format)
 - #113231 (Fix `dropping_copy_types` lint from linting in match-arm with side-effects)
 - #113233 (Update chalk)
 - #113234 (Don't pass --test-args to `python -m unitest`)
 - #113244 (Make Rust Analyzer tests faster by compiling less code)
 - #113249 (Document tracking issue for rustdoc `show-type-layout`)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-02 10:22:49 +00:00
Matthias Krüger
fda22efbf0
Rollup merge of #113233 - Nilstrieb:chaaalk, r=jackh726
Update chalk

For #109302

r? jackh726
2023-07-02 10:27:21 +02:00
bors
72b2101434 Auto merge of #112718 - oli-obk:SIMD-destructure_mir_const, r=cjgillot
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-02 07:43:36 +00:00
Nilstrieb
4be84771a7 Put FnAbiError behind reference to shrink result
The `FnAbi` is just a pointer, so the error type should not be bigger.
2023-07-01 21:16:27 +02:00
Nilstrieb
3019c1cb2a Put LayoutError behind reference to shrink result
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's
shrink that.
2023-07-01 21:16:25 +02:00
Nilstrieb
e43ec03968 Update chalk 2023-07-01 18:03:36 +02:00
Gary Guo
39c3ef799f Fix comment of fn_can_unwind 2023-06-30 18:38:56 +01:00
Matthias Krüger
42a495da7e
Rollup merge of #112670 - petrochenkov:typriv, r=eholk
privacy: Type privacy lints fixes and cleanups

See individual commits.
Follow up to https://github.com/rust-lang/rust/pull/111801.
2023-06-29 05:48:39 +02:00
Dylan DPC
fc2c587cd0
Rollup merge of #112867 - compiler-errors:more-impl-source-nits, r=lcnr
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-28 18:28:47 +05:30
bors
8882507bc7 Auto merge of #112708 - flip1995:clippy-freezing-pc-with-ice, r=oli-obk
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-28 09:40:07 +00:00
Oli Scherer
7c15779ff1 Rustdoc nit: refer to macro from docs 2023-06-28 07:07:16 +00:00
bors
6b46c996e1 Auto merge of #113105 - matthiaskrgr:rollup-rci0uym, r=matthiaskrgr
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-27 21:31:47 +00:00
Matthias Krüger
4b1d0682a6
Rollup merge of #113103 - cjgillot:normalize-inhabited, r=compiler-errors
Normalize types when applying uninhabited predicate.

Fixes https://github.com/rust-lang/rust/issues/112997
2023-06-27 22:10:16 +02:00
Matthias Krüger
d505582ce2
Rollup merge of #113084 - WaffleLapkin:less_map_or, r=Nilstrieb
Simplify some conditions

r? `@Nilstrieb`

Some things taken out of my `is_none_or` pr.
2023-06-27 22:10:15 +02:00
Matthias Krüger
9ec676dd7f
Rollup merge of #112972 - nbdd0121:mir, r=davidtwco
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-27 22:10:14 +02:00
Camille GILLOT
6f3f878351 Normalize types when applying uninhabited predicate. 2023-06-27 17:10:14 +00:00
Oli Scherer
b0142f603d
Avoid calling queries during query stack printing 2023-06-27 16:12:07 +02:00
Maybe Waffle
c60fb12a35 thir: Add Become expression kind 2023-06-27 09:03:05 +00:00
Maybe Waffle
ef05533c39 Simplify some conditions 2023-06-27 07:40:47 +00:00
bors
b5e51db16d Auto merge of #112938 - compiler-errors:clause-3, r=oli-obk
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: 2efe091705/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-27 03:14:45 +00:00
bors
b9ad9b78a2 Auto merge of #112693 - ericmarkmartin:use-more-placeref, r=spastorino
Use PlaceRef abstractions more often

Associated issue: https://github.com/rust-lang/rust/issues/80647

r? `@spastorino`
2023-06-27 00:34:49 +00:00
Michael Goulet
374173cd99 TypeWellFormedInEnv 2023-06-26 23:12:04 +00:00
Michael Goulet
fbdef58414 Migrate predicates_of and caller_bounds to Clause 2023-06-26 23:12:03 +00:00