Commit Graph

252001 Commits

Author SHA1 Message Date
bors
2805aedf9f Auto merge of #123631 - oli-obk:fail_slow, r=jieyouxu
Ensure we do not accidentally insert new early aborts in the analysis passes

pulling the infallible part out into a separate function makes sure that someone needs to change the signature in order to regress this.

We only want to stop compilation in the presence of errors after all analyses are done, but before we start running lints.

per-item we can still stop doing work if previous queries returned errors, but that's a separate story.
2024-04-09 10:08:01 +00:00
bors
bb78dba64c Auto merge of #123272 - saethlin:reachable-mono-cleanup, r=cjgillot
Only collect mono items from reachable blocks

Fixes the wrong comment pointed out in: https://github.com/rust-lang/rust/pull/121421#discussion_r1537378431
Moves the analysis to use the worklist strategy: https://github.com/rust-lang/rust/pull/121421#discussion_r1501840823
Also fixes https://github.com/rust-lang/rust/issues/85836, using the same reachability analysis
2024-04-09 07:41:34 +00:00
bors
86b603cd79 Auto merge of #123663 - matthiaskrgr:rollup-1qnj9j3, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #122768 (Use the more informative generic type inference failure error on method calls on raw pointers)
 - #123620 (sanitizers: Create the rustc_sanitizers crate)
 - #123624 ([rustdoc] [GUI tests] Make theme switching closer to reality)
 - #123636 (Update books)
 - #123647 (rustdoc: slightly clean up the synthesis of blanket impls)
 - #123648 (Avoid ICEing without the pattern_types feature gate)
 - #123649 (KCFI: Use legal charset in shim encoding)
 - #123652 (Fix UI tests with dist-vendored dependencies)
 - #123655 (Remove unimplemented!() from BinOp::ty() function)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-09 05:07:38 +00:00
Matthias Krüger
9ea1063a12
Rollup merge of #123655 - celinval:smir-fix-binop-ty, r=compiler-errors
Remove unimplemented!() from BinOp::ty() function

To reduce redundancy, we now internalize the BinOp instead of duplicating the `ty()` function body.
2024-04-09 06:02:24 +02:00
Matthias Krüger
7e9eaba52b
Rollup merge of #123652 - cuviper:ui-vendor, r=jieyouxu
Fix UI tests with dist-vendored dependencies

There is already a workaround in `compiletest` to deal with custom
`CARGO_HOME` using `-Zignore-directory-in-diagnostics-source-blocks={}`.
A similar need exists when dependencies come from the local `vendor`
directory, which distro builds often use, so now we ignore that too.

Also, `issue-21763.rs` was normalizing `hashbrown-` paths, presumably
expecting a version suffix, but the vendored path doesn't include the
version. Now that matches `[\\/]hashbrown` instead.
2024-04-09 06:02:24 +02:00
Matthias Krüger
55e0668fea
Rollup merge of #123649 - maurer:kcfi-v0, r=compiler-errors
KCFI: Use legal charset in shim encoding

To separate `ReifyReason::FnPtr` from `ReifyReason::VTable`, we hyphenated the shims. Hyphens are not actually legal, but underscores are, so use those instead.

r? `@compiler-errors`
2024-04-09 06:02:24 +02:00
Matthias Krüger
727c31a797
Rollup merge of #123648 - oli-obk:pattern_types_syntax, r=compiler-errors
Avoid ICEing without the pattern_types feature gate

fixes  #123643
2024-04-09 06:02:23 +02:00
Matthias Krüger
f3b4412809
Rollup merge of #123647 - fmease:rustdoc-clean-up-blanket-impls-synth, r=camelid
rustdoc: slightly clean up the synthesis of blanket impls

Small follow-up to #123340 as promised in https://github.com/rust-lang/rust/pull/123340#discussion_r1546918604. No functional changes whatsoever.

* inline the over-engineered “type namespace” (struct) `BlanketImplFinder` just like I did with `AutoTraitFinder` in #123340
* use the new `synthesize_*` terminology over the old nondescript / misleading `get_*` one
* inline a `use super::*;` (not super modular, lead to `clean/mod.rs` (!) accumulating cruft)
* use `tracing` properly

r? GuillaumeGomez or rustdoc
2024-04-09 06:02:23 +02:00
Matthias Krüger
6146bdb900
Rollup merge of #123636 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

23 commits in 19c40bfd2d57641d962f3119a1c343355f1b3c5e..3131aa4642c627a24f523c82566b94a7d920f68c
2024-04-05 22:09:59 UTC to 2024-03-27 18:14:05 UTC

- Correct the description of Listing 5-6 (rust-lang/book#3878)
- Minor text improvements (rust-lang/book#3790)
- Update full code reference main.rs in ch20-03 (rust-lang/book#3857)
- Make Note text in ch. 20 consistent with other notes (rust-lang/book#3876)
- Consistency fix: start note sentence with a capital (rust-lang/book#3652)
- Update README.md (rust-lang/book#3656)
- Update panic! formatting style for Guess example (rust-lang/book#3767)
- Small correction in ch13-01 (rust-lang/book#3780)
- Fix a wording typo in ch07 (rust-lang/book#3694)
- Fix a typo: remove an extra 's' from ch. 18.01 (rust-lang/book#3874)
- Remove redundant words (rust-lang/book#3672)
- Fix #3703 (rust-lang/book#3704)
- Update loop to Result: 10 (rust-lang/book#3711)
- Added "--" between run and args on ch12-03-l12 (rust-lang/book#3726)
- Add  maintenance time section in  appendix-07-nightly-rust.md  (rust-lang/book#3859)
- Update the link to the farsi translation repository (rust-lang/book#3839)
- Update README to use --locked for installing mdbook (rust-lang/book#3830)
- Reword "`union`s" to "a `union`" (rust-lang/book#3738)
- Fix two typos in 04-03 and 07-03 (rust-lang/book#3849)
- Fix typo in Chapter 7 Section 3 (rust-lang/book#3743)
- Improve ch03-05-control-flow collection looping wording (rust-lang/book#3758)
- Fix missing column separator (rust-lang/book#3855)
- Update compiler message (rust-lang/book#3856)

## rust-lang/edition-guide

3 commits in 98b33e9a441457b0a491fe1be90e7de64eafc3e5..eb3eb80e106d03250c1fb7c5666b1c8c59672862
2024-03-27 20:44:27 UTC to 2024-03-26 19:26:15 UTC

- some mdbook conveniences (rust-lang/edition-guide#297)
- typo (rust-lang/edition-guide#296)
- Clean up the `editions/index.md` page (rust-lang/edition-guide#294)

## rust-embedded/book

1 commits in 2e95fc2fd31d669947e993aa07ef10dc9828bee7..aa7d4b0b4653ddb47cb1de2036d090ec2ba9dab1
2024-04-05 07:42:54 UTC to 2024-04-05 07:42:54 UTC

- Dependencies: changed "qemu-arch-extra" to "qemu-system-arm" on arch section (rust-embedded/book#368)

## rust-lang/nomicon

2 commits in 6bc2415218d4dd0cb01433d8320f5ccf79c343a1..0d5f88475fe285affa6dbbc806e9e44d730797c0
2024-04-06 13:51:11 UTC to 2024-04-03 02:23:07 UTC

- chore: fix typo (rust-lang/nomicon#448)
- add link to reference about undefined behavior (rust-lang/nomicon#447)

## rust-lang/reference

3 commits in 984b36eca4b9293df04d5ba4eb5c4f77db0f51dc..55694913b1301cc809f9bf4a1ad1b3d6920efbd9
2024-04-03 21:31:14 UTC to 2024-04-01 19:56:13 UTC

- Add the `#[diagnostic]` attribute namespace and the `#[diagnostic::on_unimplemented]` feature to the reference (rust-lang/reference#1449)
- type-layout: be more specific about 32-bit alignments (rust-lang/reference#1393)
- Fix clippy warning in procedural macro example (rust-lang/reference#1488)

## rust-lang/rust-by-example

1 commits in 7601e0c5ad29d5bd3b518700ea63fddfff5915a7..60d34b5fd33db1346f9aabfc0c9d0bda6c8e42be
2024-04-07 13:00:53 UTC to 2024-04-07 13:00:53 UTC

- chore: fix some typos (rust-lang/rust-by-example#1833)

## rust-lang/rustc-dev-guide

11 commits in ffa246b7fd95a96e1cd54883e613aed42c32547d..b77a34bd46399687b4ce6a17198e9f316c988794
2024-04-06 20:41:09 UTC to 2024-03-27 08:49:05 UTC

- Explicitly mention compiletest directives are supported in rmake.rs (rust-lang/rustc-dev-guide#1949)
- Add docs for sharded descriptions (rust-lang/rustc-dev-guide#1959)
- Add basic docs for the new `aux-bin` header (rust-lang/rustc-dev-guide#1942)
- Add needs-threads header command (rust-lang/rustc-dev-guide#1943)
- Fix some broken links under bootstrapping. (rust-lang/rustc-dev-guide#1958)
- Replace -Zno-parallel-llvm with -Zno-parallel-backend (rust-lang/rustc-dev-guide#1957)
- Rewrite the `Parameter Environments` chapter (rust-lang/rustc-dev-guide#1953)
- Add quickstart for how to build and run the compiler (rust-lang/rustc-dev-guide#1951)
- Delete length check (rust-lang/rustc-dev-guide#1952)
- Fix some comments (rust-lang/rustc-dev-guide#1950)
- add opaque-types-region-inference-restrictions (rust-lang/rustc-dev-guide#1948)
2024-04-09 06:02:22 +02:00
Matthias Krüger
9531606bed
Rollup merge of #123624 - GuillaumeGomez:theme-switch-tests, r=notriddle
[rustdoc] [GUI tests] Make theme switching closer to reality

Better to actually perform actions user do rather than only testing the change through local storage.

As for `browser-ui-test` update: I updated `puppeteer` version (to `0.19.4`) and fixed a bug when displaying the file if it came from an `include`.

r? `@notriddle`
2024-04-09 06:02:22 +02:00
Matthias Krüger
b809c4264b
Rollup merge of #123620 - rcvalle:rust-create-rustc-sanitizers, r=davidtwco
sanitizers: Create the rustc_sanitizers crate

Create the `rustc_sanitizers` crate and move the source code for the CFI and KCFI sanitizers to it. The tracking issue for reviewing and moving sanitizers into a compiler crate is #123619. This is part of our work to organize and stabilize support for the sanitizers. (See our roadmap at https://hackmd.io/`@rcvalle/S1Ou9K6H6.)`
2024-04-09 06:02:21 +02:00
Matthias Krüger
643dee7573
Rollup merge of #122768 - oli-obk:why_is_E0699_so_bad, r=WaffleLapkin
Use the more informative generic type inference failure error on method calls on raw pointers
2024-04-09 06:02:21 +02:00
bors
bd12986fd6 Auto merge of #123099 - oli-obk:span_tcx, r=petrochenkov
Replace some `CrateStore` trait methods with hooks.

Just like with the `CrateStore` trait, this avoids the cyclic definition issues with `CStore` being
defined after TyCtxt, but needing to be used in TyCtxt.
2024-04-09 03:04:20 +00:00
bors
59c808fcd9 Auto merge of #122387 - DianQK:re-enable-early-otherwise-branch, r=cjgillot
Re-enable the early otherwise branch optimization

Closes #95162. Fixes #119014.

This is the first part of #121397.

An invalid enum discriminant can come from anywhere. We have to check to see if all successors contain the discriminant statement. This should have a pass to hoist instructions.

r? cjgillot
2024-04-09 01:02:29 +00:00
bors
b234e44944 Auto merge of #122077 - oli-obk:eager_opaque_checks4, r=lcnr
Pass list of defineable opaque types into canonical queries

This eliminates `DefiningAnchor::Bubble` for good and brings the old solver closer to the new one wrt cycles and nested obligations. At that point the difference between `DefiningAnchor::Bind([])` and `DefiningAnchor::Error` was academic. We only used the difference for some sanity checks, which actually had to be worked around in places, so I just removed `DefiningAnchor` entirely and just stored the list of opaques that may be defined.

fixes #108498
fixes https://github.com/rust-lang/rust/issues/116877

* [x] run crater
  - https://github.com/rust-lang/rust/pull/122077#issuecomment-2013293931
2024-04-08 23:01:50 +00:00
Celina G. Val
0a4f4a3e29 Remove unimplemented!() from BinOp::ty() function
To reduce redundancy, we now internalize the BinOp instead of
duplicating the `ty()` function body.
2024-04-08 15:47:37 -07:00
Josh Stone
f7b2e37f72 Fix UI tests with dist-vendored dependencies
There is already a workaround in `compiletest` to deal with custom
`CARGO_HOME` using `-Zignore-directory-in-diagnostics-source-blocks={}`.
A similar need exists when dependencies come from the local `vendor`
directory, which distro builds often use, so now we ignore that too.

Also, `issue-21763.rs` was normalizing `hashbrown-` paths, presumably
expecting a version suffix, but the vendored path doesn't include the
version. Now that matches `[\\/]hashbrown` instead.
2024-04-08 15:04:44 -07:00
Matthew Maurer
233d94e72f KCFI: Use legal charset in shim encoding
To separate `ReifyReason::FnPtr` from `ReifyReason::VTable`, we
hyphenated the shims. Hyphens are not actually legal, but underscores
are, so use those instead.
2024-04-08 21:21:38 +00:00
Oli Scherer
24ee9b9423 Avoid ICEing without the pattern_types feature gate 2024-04-08 21:02:13 +00:00
León Orell Valerian Liehr
31a69d968d
rustdoc: slightly clean up the synthesis of blanket impls 2024-04-08 22:55:58 +02:00
Oli Scherer
07310e21d4 Set the correct tracking issue for pattern types 2024-04-08 20:53:05 +00:00
bors
ab5bda1aa7 Auto merge of #123645 - matthiaskrgr:rollup-yd8d7f1, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #122781 (Fix argument ABI for overaligned structs on ppc64le)
 - #123367 (Safe Transmute: Compute transmutability from `rustc_target::abi::Layout`)
 - #123518 (Fix `ByMove` coroutine-closure shim (for 2021 precise closure capturing behavior))
 - #123547 (bootstrap: remove unused pub fns)
 - #123564 (Don't emit divide-by-zero panic paths in `StepBy::len`)
 - #123578 (Restore `pred_known_to_hold_modulo_regions`)
 - #123591 (Remove unnecessary cast from `LLVMRustGetInstrProfIncrementIntrinsic`)
 - #123632 (parser: reduce visibility of unnecessary public `UnmatchedDelim`)
 - #123635 (CFI: Fix ICE in KCFI non-associated function pointers)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-04-08 20:31:08 +00:00
Matthias Krüger
0520200a9c
Rollup merge of #123635 - maurer:kcfi-no-assoc, r=compiler-errors
CFI: Fix ICE in KCFI non-associated function pointers

We oddly weren't testing the more usual case of casting non-methods to function pointers. The KCFI shim insertion logic would ICE on these due to asking for an irrefutable associated item if we cast a function to a function pointer without needing a traditional shim.

r? `@compiler-errors`
2024-04-08 22:06:24 +02:00
Matthias Krüger
c0ac5d84a0
Rollup merge of #123632 - ohno418:fix-UnmatchedDelim-visibility, r=compiler-errors
parser: reduce visibility of unnecessary public `UnmatchedDelim`

`lexer::UnmatchedDelim` struct in `rustc_parse` is unnecessary public outside of the crate. This commit reduces the visibility to `pub(crate)`.

Beside, this removes unnecessary field `expected_delim` that causes warnings after changing the visibility.
2024-04-08 22:06:24 +02:00
Matthias Krüger
a38911a876
Rollup merge of #123591 - Zalathar:useless-cast, r=cuviper
Remove unnecessary cast from `LLVMRustGetInstrProfIncrementIntrinsic`

(Noticed while reviewing #123409.)

This particular cast appears to have been copied over from clang, but there are plenty of other call sites in clang that don't bother with a cast here, and it works fine without one.

For context, `llvm::Intrinsic::ID` is a typedef for `unsigned`, and `llvm::Intrinsic::instrprof_increment` is a member of `enum IndependentIntrinsics : unsigned`.

---

The formatting change in `unwrap(M)` is the result of manually running `clang-format` on this file, and then reverting all changes other than the ones affecting these lines.
2024-04-08 22:06:23 +02:00
Matthias Krüger
984767e500
Rollup merge of #123578 - lqd:regression-123275, r=compiler-errors
Restore `pred_known_to_hold_modulo_regions`

As requested by `@lcnr` in https://github.com/rust-lang/rust/issues/123275#issuecomment-2031885563 this PR restores `pred_known_to_hold_modulo_regions` to fix that "unexpected unsized tail" beta regression.

This also adds the reduced repro from https://github.com/rust-lang/rust/issues/123275#issuecomment-2041222851 as a sub-optimal test is better than no test at all, and it'll also cover #108721. It still ICEs on master, even though https://github.com/phlip9/rustc-warp-ice doesn't on nightly anymore, since https://github.com/rust-lang/rust/pull/122493.

Fixes #123275.

r? `@compiler-errors` but feel free to close if you'd rather have a better test instead
cc `@wesleywiser` who had signed up to do the revert

Will need a backport if we go with this PR: `@rustbot` label +beta-nominated
2024-04-08 22:06:23 +02:00
Matthias Krüger
9570ac4d28
Rollup merge of #123564 - scottmcm:step-by-div-zero, r=joboet
Don't emit divide-by-zero panic paths in `StepBy::len`

I happened to notice today that there's actually two such calls emitted in the assembly: <https://rust.godbolt.org/z/1Wbbd3Ts6>

Since they're impossible, hopefully telling LLVM that will also help optimizations elsewhere.
2024-04-08 22:06:22 +02:00
Matthias Krüger
5627497074
Rollup merge of #123547 - klensy:bs-pubs, r=onur-ozkan
bootstrap: remove unused pub fns

Looks dead, remove.
2024-04-08 22:06:22 +02:00
Matthias Krüger
36d1915449
Rollup merge of #123518 - compiler-errors:by-move-fixes, r=oli-obk
Fix `ByMove` coroutine-closure shim (for 2021 precise closure capturing behavior)

This PR reworks the way that we perform the `ByMove` coroutine-closure shim to account for the fact that the upvars of the outer coroutine-closure and the inner coroutine might not line up due to edition-2021 closure capture rules changes.

Specifically, the number of upvars may differ *and/or* the inner coroutine may have additional projections applied to an upvar. This PR reworks the information we pass into the `ByMoveBody` MIR visitor to account for both of these facts.

I tried to leave comments explaining exactly what everything is doing, but let me know if you have questions.

r? oli-obk
2024-04-08 22:06:21 +02:00
Matthias Krüger
0e27c99332
Rollup merge of #123367 - jswrenn:layoutify, r=compiler-errors
Safe Transmute: Compute transmutability from `rustc_target::abi::Layout`

In its first step of computing transmutability, `rustc_transmutability` constructs a byte-level representation of type layout (`Tree`). Previously, this representation was computed for ADTs by inspecting the ADT definition and performing our own layout computations. This process was error-prone, verbose, and limited our ability to analyze many types (particularly default-repr types).

In this PR, we instead construct `Tree`s from `rustc_target::abi::Layout`s. This helps ensure that layout optimizations are reflected our analyses, and increases the kinds of types we can now analyze, including:
- default repr ADTs
- transparent unions
- `UnsafeCell`-containing types

Overall, this PR expands the expressvity of `rustc_transmutability` to be much closer to the transmutability analysis performed by miri. Future PRs will work to close the remaining gaps (e.g., support for `Box`, raw pointers, `NonZero*`, coroutines, etc.).

r? `@compiler-errors`
2024-04-08 22:06:21 +02:00
Matthias Krüger
ecfc3384f1
Rollup merge of #122781 - nikic:ppc-abi-fix, r=cuviper
Fix argument ABI for overaligned structs on ppc64le

When passing a 16 (or higher) aligned struct by value on ppc64le, it needs to be passed as an array of `i128` rather than an array of `i64`. This will force the use of an even starting doubleword.

For the case of a 16 byte struct with alignment 16 it is important that `[1 x i128]` is used instead of `i128` -- apparently, the latter will get treated similarly to `[2 x i64]`, not exhibiting the correct ABI. Add a `force_array` flag to `Uniform` to support this.

The relevant clang code can be found here:
fe2119a7b0/clang/lib/CodeGen/Targets/PPC.cpp (L878-L884)
fe2119a7b0/clang/lib/CodeGen/Targets/PPC.cpp (L780-L784)

I think the corresponding psABI wording is this:

> Fixed size aggregates and unions passed by value are mapped to as
> many doublewords of the parameter save area as the value uses in
> memory. Aggregrates and unions are aligned according to their
> alignment requirements. This may result in doublewords being
> skipped for alignment.

In particular the last sentence. Though I didn't find any wording for Clang's behavior of clamping the alignment to 16.

Fixes https://github.com/rust-lang/rust/issues/122767.

r? `@cuviper`
2024-04-08 22:06:20 +02:00
Ramon de C Valle
1f0f2c4007 sanitizers: Create the rustc_sanitizers crate
Create the rustc_sanitizers crate and move the source code for the CFI
and KCFI sanitizers to it.

Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2024-04-08 12:05:41 -07:00
Guillaume Gomez
9fadad7f6a Manually set cache directory path when running GUI tests 2024-04-08 20:45:30 +02:00
bors
211518e5fb Auto merge of #120614 - DianQK:simplify-switch-int, r=cjgillot
Transforms match into an assignment statement

Fixes #106459.

We should be able to do some similar transformations, like `enum` to `enum`.

r? mir-opt
2024-04-08 18:28:50 +00:00
rustbot
6c19badd76 Update books 2024-04-08 13:01:07 -04:00
Matthew Maurer
284da5d6b4 CFI: Fix ICE in KCFI non-associated function pointers
We oddly weren't testing the more usual case of casting non-methods to
function pointers. The KCFI shim insertion logic would ICE on these due
to asking for an irrefutable associated item if we cast a function to a
function pointer without needing a traditional shim.
2024-04-08 17:00:18 +00:00
bors
537aab7a2e Auto merge of #120131 - oli-obk:pattern_types_syntax, r=compiler-errors
Implement minimal, internal-only pattern types in the type system

rebase of https://github.com/rust-lang/rust/pull/107606

You can create pattern types with `std::pat::pattern_type!(ty is pat)`. The feature is incomplete and will panic on you if you use any pattern other than integral range patterns. The only way to create or deconstruct a pattern type is via `transmute`.

This PR's implementation differs from the MCP's text. Specifically

> This means you could implement different traits for different pattern types with the same base type. Thus, we just forbid implementing any traits for pattern types.

is violated in this PR. The reason is that we do need impls after all in order to make them usable as fields. constants of type `std::time::Nanoseconds` struct are used in patterns, so the type must be structural-eq, which it only can be if you derive several traits on it. It doesn't need to be structural-eq recursively, so we can just manually implement the relevant traits on the pattern type and use the pattern type as a private field.

Waiting on:

* [x] move all unrelated commits into their own PRs.
* [x] fix niche computation (see 2db07f94f44f078daffe5823680d07d4fded883f)
* [x] add lots more tests
* [x] T-types MCP https://github.com/rust-lang/types-team/issues/126 to finish
* [x] some commit cleanup
* [x] full self-review
* [x] remove 61bd325da19a918cc3e02bbbdce97281a389c648, it's not necessary anymore I think.
* [ ] ~~make sure we never accidentally leak pattern types to user code (add stability checks or feature gate checks and appopriate tests)~~ we don't even do this for the new float primitives
* [x] get approval that [the scope expansion to trait impls](https://rust-lang.zulipchat.com/#narrow/stream/326866-t-types.2Fnominated/topic/Pattern.20types.20types-team.23126/near/427670099) is ok

r? `@BoxyUwU`
2024-04-08 16:25:23 +00:00
Jack Wrenn
3aa14e3b2e Compute transmutability from rustc_target::abi::Layout
In its first step of computing transmutability, `rustc_transmutability`
constructs a byte-level representation of type layout (`Tree`). Previously, this
representation was computed for ADTs by inspecting the ADT definition and
performing our own layout computations. This process was error-prone, verbose,
and limited our ability to analyze many types (particularly default-repr types).

In this PR, we instead construct `Tree`s from `rustc_target::abi::Layout`s. This
helps ensure that layout optimizations are reflected our analyses, and increases
the kinds of types we can now analyze, including:
- default repr ADTs
- transparent unions
- `UnsafeCell`-containing types

Overall, this PR expands the expressvity of `rustc_transmutability` to be much
closer to the transmutability analysis performed by miri. Future PRs will work
to close the remaining gaps (e.g., support for `Box`, raw pointers, `NonZero*`,
coroutines, etc.).
2024-04-08 15:36:52 +00:00
Oli Scherer
dc97b1eb58 Ensure the canonical_param_env_cache does not contain inconsistent information about the defining anchor 2024-04-08 15:08:06 +00:00
Oli Scherer
c8dfb59406 bless mir-opt tests 2024-04-08 15:08:06 +00:00
Oli Scherer
cd5ca3c762 Add a FIXME for something that requires touching too much code for this PR 2024-04-08 15:08:06 +00:00
Oli Scherer
cd9453c637 Mark some tests as known-bugs and add the test case from the corresponding issue 2024-04-08 15:08:06 +00:00
Oli Scherer
7cfa521931 Avoid fetching the opaque type origin when only "is this in the defining scope" is actually needed 2024-04-08 15:01:21 +00:00
Oli Scherer
ba5f0418af Shrink the size of ClosureTypeInfo to fit into 64 bytes again 2024-04-08 15:01:20 +00:00
Oli Scherer
2f2350e577 Eliminate DefiningAnchor now that is just a single-variant enum 2024-04-08 15:00:27 +00:00
Oli Scherer
dd72bf922a Scrape extraneous regions from instantiate_nll_query_response_and_region_obligations 2024-04-08 15:00:26 +00:00
Oli Scherer
08e25e4536 Adjust a comment to the new status quo 2024-04-08 15:00:26 +00:00
Oli Scherer
b2b5fa825d Eagerly check for accidentally registered region constraints instead of waiting until borrowck is done 2024-04-08 15:00:26 +00:00
Oli Scherer
19bd91d128 Pass list of defineable opaque types into canonical queries 2024-04-08 15:00:26 +00:00
Oli Scherer
ea44ce059b Make Canonical trait impls more robust 2024-04-08 15:00:03 +00:00