-
Notifications
You must be signed in to change notification settings - Fork 13.3k
marker_trait_attr: discard eval modulo regions in favor of eval to ok #84922
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
72bf374
to
3675894
Compare
3675894
to
40c714c
Compare
@@ -1494,7 +1494,18 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { | |||
// will then correctly report an inference error, since the | |||
// existence of multiple marker trait impls tells us nothing | |||
// about which one should actually apply. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this cause inference variables to be arbitrarily constrained, as described in the comments above?
e.g. if we had
#[marker]
pub trait F {}
impl F for u32 {}
impl<'a> F for &'a str where 'a: 'static {}
Would this change cause the <_#0t as F>
obligation to unify _#0t
with u32
?
(contrived example because I don't know enough about trait selection/winnowing to provide an uncontrived one)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, because the !needs_infer
condition still applies.
We drop strictly fewer candidates with this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
derp. boolean logic, it's no joke
both the current state and this PR are unsound. Going to close this until we come up with an actually sound approach (cc #84955) |
fixes #84917
cc https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits/topic/marker_trait_attr.20stabilization/near/237371224