mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
fix: Honor ref expressions for compute_ref_match completions
This commit is contained in:
parent
6c379b9f4b
commit
1f8daa180f
4 changed files with 75 additions and 23 deletions
|
@ -34,6 +34,7 @@ pub trait TyExt {
|
|||
fn callable_sig(&self, db: &dyn HirDatabase) -> Option<CallableSig>;
|
||||
|
||||
fn strip_references(&self) -> &Ty;
|
||||
fn strip_reference(&self) -> &Ty;
|
||||
|
||||
/// If this is a `dyn Trait`, returns that trait.
|
||||
fn dyn_trait(&self) -> Option<TraitId>;
|
||||
|
@ -182,6 +183,10 @@ impl TyExt for Ty {
|
|||
t
|
||||
}
|
||||
|
||||
fn strip_reference(&self) -> &Ty {
|
||||
self.as_reference().map_or(self, |(ty, _, _)| ty)
|
||||
}
|
||||
|
||||
fn impl_trait_bounds(&self, db: &dyn HirDatabase) -> Option<Vec<QuantifiedWhereClause>> {
|
||||
match self.kind(Interner) {
|
||||
TyKind::OpaqueType(opaque_ty_id, subst) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue