-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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? 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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//@ check-pass | ||
|
||
// Regression test for <https://github.com/rust-lang/rust/issues/138937>. | ||
|
||
// Previously, we'd take the normalized param env's clauses which included | ||
// `<PF as TraitC>::Value = i32`, which comes from the supertraits of `TraitD` | ||
// 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its during There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We error during |
||
|
||
trait TraitB<T> {} | ||
|
||
trait TraitC: TraitB<Self::Value> { | ||
type Value; | ||
} | ||
|
||
trait TraitD: TraitC<Value = Self::Scalar> { | ||
type Scalar; | ||
} | ||
|
||
trait TraitE { | ||
fn apply<PF: TraitD<Scalar = i32>>(&self); | ||
} | ||
|
||
fn main() {} |
Uh oh!
There was an error while loading. Please reload this page.