Skip to content

Do not mix normalized and unnormalized caller bounds when constructing param-env for receiver_is_dispatchable #138941

New issue

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

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

Already on GitHub? # to your account

Merged

Conversation

compiler-errors
Copy link
Member

See comments in code and in test I added.

r? @BoxyUwU since you reviewed the last PR, or reassign

Fixes #138937

@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. labels Mar 25, 2025
@cyrgani
Copy link
Contributor

cyrgani commented Mar 25, 2025

did you forget to commit that test?

@compiler-errors
Copy link
Member Author

probably :)

@compiler-errors compiler-errors force-pushed the receiver-is-dispatchable-bounds branch from 086e683 to cd7c99b Compare March 25, 2025 22:42
// after normalizing `<PF as TraitC>::Value = <PF as TraitD>::Scalar`. Since
// `normalize_param_env_or_error` ends up re-elaborating `PF: TraitD`, we'd
// end up with both versions of this predicate (normalized and unnormalized).
// Since these projections preds are not equal, we'd fail with ambiguity.
Copy link
Member

@BoxyUwU BoxyUwU Mar 25, 2025

Choose a reason for hiding this comment

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

its during normalize_param_env_or_error that we error due to there being two candidates? or is this a weird case where it doesnt wind up actually normalizing like it should

Copy link
Member Author

@compiler-errors compiler-errors Mar 25, 2025

Choose a reason for hiding this comment

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

We error during normalize_param_env_or_error b/c we have two candidates for normalizing <PF as TraitC>::Value, which shows up in the supertrait TraitB<Self::Value>. The first candidate comes from normalizing the param-env the first time in the param_env query, and the second comes from the second time we normalize it.

@BoxyUwU BoxyUwU added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 26, 2025
@compiler-errors compiler-errors force-pushed the receiver-is-dispatchable-bounds branch from cd7c99b to 4f2baaa Compare March 30, 2025 02:39
@compiler-errors
Copy link
Member Author

k i added a comment

@BoxyUwU
Copy link
Member

BoxyUwU commented Apr 1, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 1, 2025

📌 Commit 4f2baaa has been approved by BoxyUwU

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 1, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 2, 2025
Rollup of 14 pull requests

Successful merges:

 - rust-lang#135295 (Check empty SIMD vector in inline asm)
 - rust-lang#138003 (Add the new `amx` target features and the `movrs` target feature)
 - rust-lang#138823 (rustc_target: RISC-V: add base `I`-related important extensions)
 - rust-lang#138913 (Remove even more instances of `@ts-expect-error` from search.js)
 - rust-lang#138941 (Do not mix normalized and unnormalized caller bounds when constructing param-env for `receiver_is_dispatchable`)
 - rust-lang#139060 (replace commit placeholder in vendor status with actual commit)
 - rust-lang#139102 (coverage: Avoid splitting spans during span extraction/refinement)
 - rust-lang#139191 (small opaque type/borrowck cleanup)
 - rust-lang#139200 (Skip suggest impl or dyn when poly trait is not a real trait)
 - rust-lang#139208 (fix dead link netbsd.md)
 - rust-lang#139210 (chore: remove redundant backtick)
 - rust-lang#139212 (Update mdbook to 0.4.48)
 - rust-lang#139214 (Tell rustfmt to use the 2024 edition in ./x.py fmt)
 - rust-lang#139225 (move autodiff from EnzymeAD/Enzyme to our rust-lang/Enzyme soft-fork)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7812409 into rust-lang:master Apr 2, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 2, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 2, 2025
Rollup merge of rust-lang#138941 - compiler-errors:receiver-is-dispatchable-bounds, r=BoxyUwU

Do not mix normalized and unnormalized caller bounds when constructing param-env for `receiver_is_dispatchable`

See comments in code and in test I added.

r? `@BoxyUwU` since you reviewed the last PR, or reassign

Fixes rust-lang#138937
@compiler-errors
Copy link
Member Author

#140019

@rustbot label: +beta-nominated

@rustbot rustbot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 18, 2025
@compiler-errors compiler-errors deleted the receiver-is-dispatchable-bounds branch April 19, 2025 15:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
beta-nominated Nominated for backporting to the compiler in the beta channel. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A "cannot infer type" compilation error appeared from 1.87.0-nightly (249cb84 2025-03-12)
5 participants