Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #113357

Closed
wants to merge 29 commits into from
Closed

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

lcnr and others added 29 commits July 4, 2023 11:51
This effectively inlines most of `FunctionCx::codegen_coverage` into the LLVM
implementation of `CoverageInfoBuilderMethods`.
…d it

These methods are only ever called from within `rustc_codegen_llvm`, so they
can just be declared there as well.
…li-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`
…iler-errors

`TypeParameterDefinition` always require a `DefId`

the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc rust-lang#113310
…etrochenkov,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.
…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 rust-lang#113325, only the second and third commits needs reviewing
…new-solver, r=lcnr

Reveal opaques in new solver

We were testing against the wrong reveal mode 😨

Also a couple of misc commits that I don't want to really put in separate prs

r? `@lcnr`
…-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`
Move most coverage code out of `rustc_codegen_ssa`

*This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.*

The backend implementation of coverage instrumentation was originally split between SSA and LLVM, perhaps in the hopes that it could be used by other backends.

In practice, this split mostly just makes the coverage implementation harder to navigate and harder to modify. It seems unlikely that any backend will actually implement coverage instrumentation in the foreseeable future, especially since many parts of the existing implementation (outside the LLVM backend) are heavily tied to the specific details of LLVM's coverage instrumentation features.

The current shared implementation of `codegen_coverage` is heavily tied to the details of `StatementKind::Coverage`, which makes those details difficult to change. I have reason to want to change those details as part of future fixes/improvements, so this will reduce the amount of interface churn caused by those later changes.

---

This is intended to be a pure refactoring change, with no changes to actual behaviour. All of the “added” code has really just been moved from other files.
@rustbot rustbot added the A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) label Jul 5, 2023
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) rollup A PR which is a rollup labels Jul 5, 2023
@Dylan-DPC
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jul 5, 2023

📌 Commit e1c2844 has been approved by Dylan-DPC

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 5, 2023
@bors
Copy link
Contributor

bors commented Jul 5, 2023

⌛ Testing commit e1c2844 with merge 929317e42bd63134769dd453dee962223f155d71...

@rust-log-analyzer
Copy link
Collaborator

The job dist-i586-gnu-i586-i686-musl failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

24 LL | | fn main() {}
25    | |____________^
26 
- error[E0391]: cycle detected when computing type of `make_dyn_star::{opaque#0}`
-   --> $DIR/param-env-region-infer.rs:14:60
-    |
- LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
-    |
-    |
- note: ...which requires type-checking `make_dyn_star`...
-   --> $DIR/param-env-region-infer.rs:14:1
-    |
- LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-    = note: ...which requires computing layout of `make_dyn_star::{opaque#0}`...
-    = note: ...which requires normalizing `make_dyn_star::{opaque#0}`...
-    = note: ...which again requires computing type of `make_dyn_star::{opaque#0}`, completing the cycle
- note: cycle used when checking item types in top-level module
-   --> $DIR/param-env-region-infer.rs:8:1
-    |
- LL | / #![feature(dyn_star, pointer_like_trait)]
- LL | | #![allow(incomplete_features)]
- LL | |
- LL | | use std::fmt::Debug;
- LL | |
- LL | | fn main() {}
-    | |____________^
- 
---
56 


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/dyn-star/param-env-region-infer.next/param-env-region-infer.next.stderr
To only update this specific test, also pass `--test-args dyn-star/param-env-region-infer.rs`

error in revision `next`: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/dyn-star/param-env-region-infer.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=i586-unknown-linux-gnu" "--cfg" "next" "-C" "incremental=/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/dyn-star/param-env-region-infer.next/param-env-region-infer.inc" "-Z" "incremental-verify-ich" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--remap-path-prefix=/checkout/tests/ui=fake-test-src-base" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/dyn-star/param-env-region-infer.next" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/i586-unknown-linux-gnu/native/rust-test-helpers" "-Clinker=i586-unknown-linux-gnu-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/dyn-star/param-env-region-infer.next/auxiliary" "-Ztrait-solver=next"
stdout: none
--- stderr -------------------------------
error[E0391]: cycle detected when computing type of `make_dyn_star::{opaque#0}`
##[error]  --> fake-test-src-base/dyn-star/param-env-region-infer.rs:14:60
   |
LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
   |
   |
note: ...which requires type-checking `make_dyn_star`...
  --> fake-test-src-base/dyn-star/param-env-region-infer.rs:14:1
   |
LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: ...which requires computing layout of `make_dyn_star::{opaque#0}`...
   = note: ...which requires normalizing `make_dyn_star::{opaque#0}`...
   = note: ...which again requires computing type of `make_dyn_star::{opaque#0}`, completing the cycle
note: cycle used when checking item types in top-level module
  --> fake-test-src-base/dyn-star/param-env-region-infer.rs:8:1
   |
LL | / #![feature(dyn_star, pointer_like_trait)]
LL | | #![allow(incomplete_features)]
LL | | use std::fmt::Debug;
...  |
LL | |
LL | | fn main() {}

@bors
Copy link
Contributor

bors commented Jul 5, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 5, 2023
@Dylan-DPC Dylan-DPC deleted the rollup-ubwhara branch July 6, 2023 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants