Skip to content

proven_via into query response #142953

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

proven_via into query response #142953

wants to merge 2 commits into from

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Jun 24, 2025

quite sus. doesn't handle proof trees, seems to incorrectly handle trait_goal_proven_via if the Trait goal is cyclic 🤔

r? compiler-errors

@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) labels Jun 24, 2025
@lcnr
Copy link
Contributor Author

lcnr commented Jun 24, 2025

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 24, 2025

⌛ Trying commit 724317f with merge defe85d

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 24, 2025
`proven_via` into query response

quite sus. doesn't handle proof trees, seems to incorrectly handle `trait_goal_proven_via` if the `Trait` goal is cyclic 🤔

r? compiler-errors
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 24, 2025
@lcnr lcnr marked this pull request as draft June 24, 2025 08:12
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/sized/coinductive-1.rs#next stdout ----

error in revision `next`: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/sized/coinductive-1.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "next" "--check-cfg" "cfg(test,FALSE,current,next)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/sized/coinductive-1.next" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Znext-solver"
stdout: none
--- stderr -------------------------------
error[E0283]: type annotations needed: cannot satisfy `Vec<()>: Trait<Node<Vec<()>>>`
##[error]  --> /checkout/tests/ui/sized/coinductive-1.rs:16:13
   |
LL |     let _ = Node::<Vec<()>>(Vec::new());
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: cannot satisfy `Vec<()>: Trait<Node<Vec<()>>>`
   = help: the trait `Trait<Node<Vec<()>>>` is not implemented for `Vec<()>`
           but trait `Trait<Node<_>>` is implemented for it
note: required by a bound in `Node`
  --> /checkout/tests/ui/sized/coinductive-1.rs:5:16
   |
LL | struct Node<C: Trait<Self>>(C::Assoc);
   |                ^^^^^^^^^^^ required by this bound in `Node`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0283`.
------------------------------------------


---- [ui] tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/next-solver/cycles/normalizes-to-is-not-productive/normalizes-to-is-not-productive.stderr`
diff of stderr:

- error[E0277]: the trait bound `Foo: Bound` is not satisfied
+ error[E0271]: type mismatch resolving `<Foo as Trait<T>>::Assoc normalizes-to _`
2   --> $DIR/normalizes-to-is-not-productive.rs:42:31
3    |
4 LL |     <Foo as Trait<T>>::Assoc: Bound,

-    |                               ^^^^^ the trait `Bound` is not implemented for `Foo`
---

20 LL | | }
21    | |_^ required by this bound in `Bound`
22 
+ error[E0271]: type mismatch resolving `<Foo as Trait<T>>::Assoc normalizes-to _`
+   --> $DIR/normalizes-to-is-not-productive.rs:42:31
+    |
+ LL |     <Foo as Trait<T>>::Assoc: Bound,
+    |                               ^^^^^ types differ
+ 
23 error[E0277]: the trait bound `Foo: Bound` is not satisfied
24   --> $DIR/normalizes-to-is-not-productive.rs:47:19
25    |

33 LL | fn impls_bound<T: Bound>() {
34    |                   ^^^^^ required by this bound in `impls_bound`
35 
- error: aborting due to 2 previous errors
+ error: aborting due to 3 previous errors
37 
- For more information about this error, try `rustc --explain E0277`.
+ Some errors have detailed explanations: E0271, E0277.
+ For more information about an error, try `rustc --explain E0271`.
39 

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.rs:42:31
+ error[E0271]: type mismatch resolving `<Foo as Trait<T>>::Assoc normalizes-to _`
+    |                               ^^^^^ types differ
+ error[E0271]: type mismatch resolving `<Foo as Trait<T>>::Assoc normalizes-to _`
+   --> $DIR/normalizes-to-is-not-productive.rs:42:31
+    |
+ LL |     <Foo as Trait<T>>::Assoc: Bound,
+    |                               ^^^^^ types differ
+ 
---
To only update this specific test, also pass `--test-args traits/next-solver/cycles/normalizes-to-is-not-productive.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/next-solver/cycles/normalizes-to-is-not-productive" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Znext-solver"
stdout: none
--- stderr -------------------------------
error[E0271]: type mismatch resolving `<Foo as Trait<T>>::Assoc normalizes-to _`
##[error]  --> /checkout/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.rs:42:31
   |
LL |     <Foo as Trait<T>>::Assoc: Bound,
   |                               ^^^^^ types differ
   |
---
LL | |     fn method();
LL | | }
   | |_^ required by this bound in `Bound`

error[E0271]: type mismatch resolving `<Foo as Trait<T>>::Assoc normalizes-to _`
##[error]  --> /checkout/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.rs:42:31
   |
LL |     <Foo as Trait<T>>::Assoc: Bound,
   |                               ^^^^^ types differ

---
   = help: the trait `Bound` is implemented for `u32`
note: required by a bound in `impls_bound`
  --> /checkout/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.rs:27:19
   |
LL | fn impls_bound<T: Bound>() {
   |                   ^^^^^ required by this bound in `impls_bound`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0271, E0277.
For more information about an error, try `rustc --explain E0271`.
------------------------------------------


---- [ui] tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/next-solver/normalize/normalize-param-env-2/normalize-param-env-2.stderr`
diff of stderr:

36 LL | | }
37    | |_^ required by this bound in `A`
38 
- error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc well-formed`
-   --> $DIR/normalize-param-env-2.rs:24:22
-    |
- LL |         Self::Assoc: A<T>,
-    |                      ^^^^
- 
- error[E0275]: overflow evaluating the requirement `(): A<T>`
+ error[E0283]: type annotations needed: cannot satisfy `(): A<T>`
46   --> $DIR/normalize-param-env-2.rs:27:10
47    |
48 LL |         <() as A<T>>::f();

49    |          ^^
+    |
+ note: multiple `impl`s or `where` clauses satisfying `(): A<T>` found
+   --> $DIR/normalize-param-env-2.rs:19:1
+    |
+ LL | impl<T> A<T> for () {
+    | ^^^^^^^^^^^^^^^^^^^
+ ...
+ LL |         Self::Assoc: A<T>,
+    |                      ^^^^
50 
51 error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: A<T>`
52   --> $DIR/normalize-param-env-2.rs:27:9

63 LL |         Self::Assoc: A<T>,
64    |                      ^^^^ required by this bound in `A::f`
65 
---
69 

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:19:1
+ error[E0283]: type annotations needed: cannot satisfy `(): A<T>`
+    |
+ note: multiple `impl`s or `where` clauses satisfying `(): A<T>` found
+   --> $DIR/normalize-param-env-2.rs:19:1
+    |
+ LL | impl<T> A<T> for () {
+    | ^^^^^^^^^^^^^^^^^^^
+ ...
+ LL |         Self::Assoc: A<T>,
+    |                      ^^^^
+ error: aborting due to 5 previous errors
+ Some errors have detailed explanations: E0275, E0283.
+ For more information about an error, try `rustc --explain E0275`.


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/next-solver/normalize/normalize-param-env-2.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/next-solver/normalize/normalize-param-env-2" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Znext-solver"
stdout: none
--- stderr -------------------------------
error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: A<T>`
##[error]  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:24:22
   |
LL |         Self::Assoc: A<T>,
   |                      ^^^^
   |
note: the requirement `<() as A<T>>::Assoc: A<T>` appears on the `impl`'s associated function `f` but not on the corresponding trait's associated function
  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:12:8
   |
LL | trait A<T> {
   |       - in this trait
...
LL |     fn f()
   |        ^ this trait's associated function doesn't have the requirement `<() as A<T>>::Assoc: A<T>`

error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: A<T>`
##[error]  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:24:22
   |
LL |         Self::Assoc: A<T>,
   |                      ^^^^

error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: MetaSized`
##[error]  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:24:22
   |
LL |         Self::Assoc: A<T>,
   |                      ^^^^
   |
note: required by a bound in `A`
  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:9:1
   |
LL | / trait A<T> {
LL | |     type Assoc;
LL | |
LL | |     fn f()
...  |
LL | | }
   | |_^ required by this bound in `A`

error[E0283]: type annotations needed: cannot satisfy `(): A<T>`
##[error]  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:27:10
   |
LL |         <() as A<T>>::f();
   |          ^^
   |
note: multiple `impl`s or `where` clauses satisfying `(): A<T>` found
  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:19:1
   |
LL | impl<T> A<T> for () {
   | ^^^^^^^^^^^^^^^^^^^
...
LL |         Self::Assoc: A<T>,
   |                      ^^^^

error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: A<T>`
##[error]  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:27:9
   |
LL |         <() as A<T>>::f();
   |         ^^^^^^^^^^^^^^^^^
   |
note: required by a bound in `A::f`
  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-2.rs:14:22
   |
---
+    |
+ note: required by a bound in `impls_trait`
+   --> $DIR/normalize-param-env-4.rs:15:19
+    |
+ LL | fn impls_trait<T: Trait>() {}
+    |                   ^^^^^ required by this bound in `impls_trait`
+ 
+ error: aborting due to 4 previous errors
22 
23 For more information about this error, try `rustc --explain E0275`.
24 
---
+    |
+ note: required by a bound in `impls_trait`
+   --> $DIR/normalize-param-env-4.rs:15:19
+    |
+ LL | fn impls_trait<T: Trait>() {}
+    |                   ^^^^^ required by this bound in `impls_trait`
+ 
+ error: aborting due to 4 previous errors


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/next-solver/normalize/normalize-param-env-4.rs`

error in revision `next`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-4.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "next" "--check-cfg" "cfg(test,FALSE,current,next)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/next-solver/normalize/normalize-param-env-4.next" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Znext-solver"
stdout: none
--- stderr -------------------------------
error[E0275]: overflow evaluating the requirement `<T as Trait>::Assoc: Trait`
##[error]  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-4.rs:19:26
   |
---
   |
note: required by a bound in `impls_trait`
  --> /checkout/tests/ui/traits/next-solver/normalize/normalize-param-env-4.rs:15:19
   |
LL | fn impls_trait<T: Trait>() {}
   |                   ^^^^^ required by this bound in `impls_trait`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0275`.
------------------------------------------

@rust-bors
Copy link

rust-bors bot commented Jun 24, 2025

☀️ Try build successful (CI)
Build commit: defe85d (defe85d7304808d28fac47d6260e37bef3c58bcf, parent: 99b18d6c5062449db8e7ccded4cb69b555a239c3)

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 24, 2025

☔ The latest upstream changes (presumably #142956) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (defe85d): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
11.3% [0.1%, 27.7%] 3
Improvements ✅
(primary)
-0.2% [-0.3%, -0.1%] 7
Improvements ✅
(secondary)
-0.7% [-1.2%, -0.1%] 10
All ❌✅ (primary) -0.2% [-0.3%, -0.1%] 7

Max RSS (memory usage)

Results (secondary -0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.3% [0.9%, 3.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-4.6%, -1.4%] 2
All ❌✅ (primary) - - 0

Cycles

Results (primary 1.2%, secondary 11.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.2% [1.2%, 1.2%] 1
Regressions ❌
(secondary)
11.8% [4.3%, 19.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [1.2%, 1.2%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 689.194s -> 690.136s (0.14%)
Artifact size: 371.96 MiB -> 372.00 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 24, 2025
@compiler-errors
Copy link
Member

strange 🤔

@lcnr
Copy link
Contributor Author

lcnr commented Jun 25, 2025

very interesting 😁 I think the issue is that adding proven_via means we no longer get the identity response for trait goal cycles, so they always have to be rerun 🤔 that makes sense to me :x

it feels like it shouldn't be necessary unless the trait goal is actually used as the input of a normalizes-to goal 🤔 unsure how/whether to track this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. 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.

6 participants