Skip to content

Conversation

@ChayimFriedman2
Copy link
Contributor

Continuation of #146602.

r? lcnr

@lcnr #146602 (comment)

I think we should move this out of assemble_builtin_impl_candidate to avoid ambiguity between e.g. blanket impls and the builtin impl candidate 🤔

Where do you want to put it?

@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 Dec 28, 2025
@ChayimFriedman2 ChayimFriedman2 changed the title Dont bail in error predicate unless self ty is error Dont bail in error predicate unless self ty is error in new solver Dec 28, 2025
@rust-log-analyzer
Copy link
Collaborator

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

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

9 LL | impl const Bar for () {
10    |      +++++
11 
- error[E0277]: the trait bound `{closure@$DIR/call-const-closure.rs:17:6: 17:14}: [const] Fn()` is not satisfied
-   --> $DIR/call-const-closure.rs:17:5
-    |
- LL |     (const || ().foo())();
-    |     ^^^^^^^^^^^^^^^^^^^^^
- 
- error: aborting due to 2 previous errors
+ error: aborting due to 1 previous error
19 
---
To only update this specific test, also pass `--test-args traits/const-traits/call-const-closure.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/const-traits/call-const-closure.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/const-traits/call-const-closure" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021" "-Znext-solver"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `(): [const] Bar` is not satisfied
##[error]  --> /checkout/tests/ui/traits/const-traits/call-const-closure.rs:16:18
   |
LL |     (const || ().foo())();
   |                  ^^^
   |
help: make the `impl` of trait `Bar` `const`
   |
LL | impl const Bar for () {

kind => panic!("expected projection, found {kind:?}"),
};
ecx.instantiate_normalizes_to_term(goal, error_term);
Err(NoSolution)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why still return Err(NoSolution) instead of just succeeding after constraining the term to ty::Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants