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

Don't pick T: FnPtr nested goals as the leaf goal in diagnostics for new solver #135866

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Jan 22, 2025

r? @lcnr

See tests/ui/traits/next-solver/diagnostics/dont-pick-fnptr-bound-as-leaf.rs for a minimized example of what code this affects the diagnostics off. The output of running nightly -Znext-solver on that test is the following:

error[E0277]: the trait bound `Foo: Trait` is not satisfied
  --> src/lib.rs:14:20
   |
14 |     requires_trait(Foo);
   |     -------------- ^^^ the trait `FnPtr` is not implemented for `Foo`
   |     |
   |     required by a bound introduced by this call
   |
note: required for `Foo` to implement `Trait`
  --> src/lib.rs:7:16
   |
7  | impl<T: FnPtr> Trait for T {}
   |         -----  ^^^^^     ^
   |         |
   |         unsatisfied trait bound introduced here
note: required by a bound in `requires_trait`
  --> src/lib.rs:11:22
   |
11 | fn requires_trait<T: Trait>(_: T) {}
   |                      ^^^^^ required by this bound in `requires_trait`

Part of rust-lang/trait-system-refactor-initiative#148

@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 Jan 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 22, 2025

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@lcnr
Copy link
Contributor

lcnr commented Jan 22, 2025

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 22, 2025

📌 Commit 3ef506f has been approved by lcnr

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 Jan 22, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2025
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#133372 (Refactor dyn-compatibility error and suggestions)
 - rust-lang#134396 (AIX: use align 8 for byval parameter)
 - rust-lang#135156 (Make our `DIFlags` match `LLVMDIFlags` in the LLVM-C API)
 - rust-lang#135816 (Use `structurally_normalize` instead of manual `normalizes-to` goals in alias relate errors)
 - rust-lang#135823 (make UI tests that use `--test` work on panic=abort targets)
 - rust-lang#135850 (Update the `wasm-component-ld` tool)
 - rust-lang#135858 (rustdoc: Finalize dyn compatibility renaming)
 - rust-lang#135866 (Don't pick `T: FnPtr` nested goals as the leaf goal in diagnostics for new solver)
 - rust-lang#135874 (Enforce that all spans are lowered in ast lowering)
 - rust-lang#135875 (Remove `Copy` bound from `enter_forall`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 318466a into rust-lang:master Jan 22, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants