Resolve some cases of #132279 by using the right typing mode in the next solver#156141
Conversation
bac5eb5 to
7d76533
Compare
|
Some changes occurred to constck cc @fee1-dead Some changes occurred to the CTFE machinery |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
7d76533 to
a59bc36
Compare
This comment has been minimized.
This comment has been minimized.
|
@rustbot review |
This comment has been minimized.
This comment has been minimized.
a59bc36 to
da70164
Compare
|
@bors r=lcnr |
|
@bors rollupo |
…uwer Rollup of 7 pull requests Successful merges: - #146273 (lint ImproperCTypes: refactor linting architecture (part 2)) - #156173 (Fewer global node_id_to_def_id lookups) - #155961 (Deny warnings in the test for crates that are available on stable) - #156130 (Fold/visit tweaks) - #156131 (Metadata macro/query cleanups) - #156141 (Resolve some cases of #132279 by using the right typing mode in the next solver) - #156202 (llvm: Use correct type for splat mask)
|
This pull request was unapproved. This PR was contained in a rollup (#156238), which was unapproved. |
da70164 to
ef8be30
Compare
This comment has been minimized.
This comment has been minimized.
ef8be30 to
0d65aa2
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ rollup |
Rollup of 5 pull requests Successful merges: - #156141 (Resolve some cases of #132279 by using the right typing mode in the next solver) - #156244 (fix incorrect suggestions in private import diagnostic) - #156306 (Move tests consts) - #156333 (Avoid invalid spans in dotdotdot rest pattern suggestions) - #156337 (rustc-dev-guide subtree update)
Rollup merge of #156141 - jdonszelmann:use-right-typingmode, r=lcnr Resolve some cases of #132279 by using the right typing mode in the next solver r? @lcnr Convert 3 FIXMEs of #132279 to using the right typing mode when we can (`tcx.use_typing_mode_borrowck()`) Also resolves #155093, which I closed
Rollup of 5 pull requests Successful merges: - rust-lang/rust#156141 (Resolve some cases of rust-lang/rust#132279 by using the right typing mode in the next solver) - rust-lang/rust#156244 (fix incorrect suggestions in private import diagnostic) - rust-lang/rust#156306 (Move tests consts) - rust-lang/rust#156333 (Avoid invalid spans in dotdotdot rest pattern suggestions) - rust-lang/rust#156337 (rustc-dev-guide subtree update)
|
While trying to expand new solver testing in CI to keep it working, I've noticed that not only had we regressed building the stdlib (we knew that and now have CI to prevent that from happening before stabilization), we also regressed bootstrapping with the new solver enabled. That issue is still present on the main branch. Building a stage 2 compiler with a stage 1 w/ new solver compiler, or RUSTFLAGS, will ICE very strangely while building error: internal compiler error: compiler/rustc_ty_utils/src/sig_types.rs:114:13: Ctor(Variant, Fn) has not seen any uses of `walk_types` yet, ping oli-obk if you'd like any help
--> ~/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/regex-syntax-0.8.8/src/ast/mod.rs:1134:5
|
1134 | Item(ClassSetItem),
| ^^^^
thread 'rustc' (1986053) panicked at compiler/rustc_ty_utils/src/sig_types.rs:114:13:
(e.g. with I don't really know what's going on, but it looks like weirdness w/ opaque types, during codegen. I've bisected that to 68f9143 from this PR so I wanted to let you and @lcnr know in case you hadn't noticed. |
|
cc @oli-obk :3 |
Codegen ctors in Runtime mir phase https://github.com/rust-lang/rust/pull/156141/changes#diff-f18405dedc545b19aa3ee04cd08b17e1e0fa1b5876e46c6b445eaaa7e54618eaR421 (part of rust-lang#156141) The mir of constructors used to be generated in MirPhase::Built, but are only used during codegen. That means they'd have a weird MirPhase, since all other items have MirPhase::Runtime during codegen. This PR still generates ctor mir in MirPhase::Built, but then immediately does a phase change to Runtime after running no passes. Fixes rust-lang#158037 <summary> Old description of another, worse way to solve this <details> starts using `TypingMode::PostTypeckUntilBorrowck` during mir building with the next solver. This is the right typing mode, and the typing mode contains a list of opaque types. However, previously, we instead just used `TypingMode::Typeck` with an empty list of opaques. That is the wrong typing mode, but it also meant we collected opaque types of slightly fewer things. Now that we do collect their opaque types, we're doing so for items that we've never gathered opaque types for before and get an ICE. There are no tests associated with this change. @lqd tried to reproduce it, but it seems surprisingly hard except by bootstrapping rustc itself. This change makes `RUSTFLAGS_NOT_BOOTSTRAP=-Znext-solver x build compiler --stage 2` work, which I verified locally. See [#t-infra/announcements > Next solver / polonius alpha pre-stabilization CI job](https://rust-lang.zulipchat.com/#narrow/channel/533458-t-infra.2Fannouncements/topic/Next.20solver.20.2F.20polonius.20alpha.20pre-stabilization.20CI.20job/with/602503884) for work towards making bootstraps with the next solver a CI job. </details> </summary> r? @oli-obk
Rollup merge of #158040 - jdonszelmann:fix-crash, r=oli-obk Codegen ctors in Runtime mir phase https://github.com/rust-lang/rust/pull/156141/changes#diff-f18405dedc545b19aa3ee04cd08b17e1e0fa1b5876e46c6b445eaaa7e54618eaR421 (part of #156141) The mir of constructors used to be generated in MirPhase::Built, but are only used during codegen. That means they'd have a weird MirPhase, since all other items have MirPhase::Runtime during codegen. This PR still generates ctor mir in MirPhase::Built, but then immediately does a phase change to Runtime after running no passes. Fixes #158037 <summary> Old description of another, worse way to solve this <details> starts using `TypingMode::PostTypeckUntilBorrowck` during mir building with the next solver. This is the right typing mode, and the typing mode contains a list of opaque types. However, previously, we instead just used `TypingMode::Typeck` with an empty list of opaques. That is the wrong typing mode, but it also meant we collected opaque types of slightly fewer things. Now that we do collect their opaque types, we're doing so for items that we've never gathered opaque types for before and get an ICE. There are no tests associated with this change. @lqd tried to reproduce it, but it seems surprisingly hard except by bootstrapping rustc itself. This change makes `RUSTFLAGS_NOT_BOOTSTRAP=-Znext-solver x build compiler --stage 2` work, which I verified locally. See [#t-infra/announcements > Next solver / polonius alpha pre-stabilization CI job](https://rust-lang.zulipchat.com/#narrow/channel/533458-t-infra.2Fannouncements/topic/Next.20solver.20.2F.20polonius.20alpha.20pre-stabilization.20CI.20job/with/602503884) for work towards making bootstraps with the next solver a CI job. </details> </summary> r? @oli-obk
View all comments
r? @lcnr
Convert 3 FIXMEs of #132279 to using the right typing mode when we can (
tcx.use_typing_mode_borrowck())Also resolves #155093, which I closed