mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 19:33:16 +00:00
Make ExpOrPatId private
This commit is contained in:
parent
79f61dcb0e
commit
1578375b89
@ -56,7 +56,7 @@ pub fn infer(db: &impl HirDatabase, func: Function) -> Arc<InferenceResult> {
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum ExprOrPatId {
|
||||
enum ExprOrPatId {
|
||||
Expr(ExprId),
|
||||
Pat(PatId),
|
||||
}
|
||||
@ -93,8 +93,11 @@ impl InferenceResult {
|
||||
pub fn field_resolution(&self, expr: ExprId) -> Option<StructField> {
|
||||
self.field_resolutions.get(&expr).map(|it| *it)
|
||||
}
|
||||
pub fn assoc_resolutions(&self, id: ExprOrPatId) -> Option<ImplItem> {
|
||||
self.assoc_resolutions.get(&id).map(|it| *it)
|
||||
pub fn assoc_resolutions_for_expr(&self, id: ExprId) -> Option<ImplItem> {
|
||||
self.assoc_resolutions.get(&id.into()).map(|it| *it)
|
||||
}
|
||||
pub fn assoc_resolutions_for_pat(&self, id: PatId) -> Option<ImplItem> {
|
||||
self.assoc_resolutions.get(&id.into()).map(|it| *it)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ pub(crate) fn reference_definition(
|
||||
|
||||
if let Some(res) = source_map
|
||||
.node_expr(expr)
|
||||
.and_then(|it| infer_result.assoc_resolutions(it.into()))
|
||||
.and_then(|it| infer_result.assoc_resolutions_for_expr(it.into()))
|
||||
{
|
||||
return Exact(NavigationTarget::from_impl_item(db, res));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user