-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc: Make the trait_map
of TyCtxt private
#44162
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
Conversation
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/ty/context.rs
Outdated
@@ -1997,3 +1999,13 @@ impl<T, R, E> InternIteratorElement<T, R> for Result<T, E> { | |||
Ok(f(&iter.collect::<Result<AccumulateVec<[_; 8]>, _>>()?)) | |||
} | |||
} | |||
|
|||
fn in_scope_traits<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) |
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'm worried about the proliferation of providers, but I think making trait_map
public to rustc::ty
would be worse.
src/librustc/ty/context.rs
Outdated
|
||
fn in_scope_traits<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) | ||
-> Option<Rc<Vec<TraitCandidate>>> | ||
{ |
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 don't like the proliferation of provide
methods, but I think making trait_map
public in all of rustc::ty
would be worse.
Basically LGTM, but there's a travis blip and I suspect the primary use-case of rust/src/librustc_typeck/check/method/probe.rs Lines 662 to 678 in faf477a
hasn't been updated. |
4632351
to
73076fb
Compare
Ok I think I handled that case (still waiting on a local compile) I also switched this over to being keyed on a |
This map is calculated in resolve, but we want to be sure to track it for incremental compliation. Hide it behind a query to get more refactorings later.
73076fb
to
32d35e6
Compare
Ok I've also pushed up a commit which hides the re-r? @arielb1 also cc @nikomatsakis |
This map, like `trait_map`, is calculated in resolve, but we want to be sure to track it for incremental compliation. Hide it behind a query to get more refactorings later.
07f8198
to
942c8dc
Compare
@bors r+ |
📌 Commit 942c8dc has been approved by |
This map is calculated in resolve, but we want to be sure to track it for
incremental compliation. Hide it behind a query to get more refactorings later.
cc #44137