-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Implement use
associated items of traits
#134754
base: master
Are you sure you want to change the base?
Implement use
associated items of traits
#134754
Conversation
This comment has been minimized.
This comment has been minimized.
cc @petrochenkov as this PR has some non-trivial resolve changes. |
dc2bdee
to
6905a19
Compare
This comment has been minimized.
This comment has been minimized.
6905a19
to
8606eb3
Compare
8606eb3
to
72bc889
Compare
Ok(binding) if binding.is_importable() => { | ||
Ok(binding) | ||
if binding.is_importable() | ||
|| binding.is_assoc_const_or_fn() | ||
&& this.tcx.features().import_trait_associated_functions() => | ||
{ |
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.
I think is_importable
should just stop rejecting assoc const and fn. Instead, within this match arm, emit the feature error unconditionally if it is either of those two (and the feature wasn't enabled). That's how we handle feature gating where possible/feasible: just go through as if the feature gate was already enabled, but emit an error if it wasn't.
This PR implements #134691.