mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
internal: Treat the self param as different from patterns when lowering
This commit is contained in:
parent
0931361b8f
commit
458f4a2960
18 changed files with 256 additions and 144 deletions
|
@ -219,11 +219,10 @@ impl SourceAnalyzer {
|
|||
pub(crate) fn type_of_self(
|
||||
&self,
|
||||
db: &dyn HirDatabase,
|
||||
param: &ast::SelfParam,
|
||||
_param: &ast::SelfParam,
|
||||
) -> Option<Type> {
|
||||
let src = InFile { file_id: self.file_id, value: param };
|
||||
let pat_id = self.body_source_map()?.node_self_param(src)?;
|
||||
let ty = self.infer.as_ref()?[pat_id].clone();
|
||||
let binding = self.body()?.self_param?;
|
||||
let ty = self.infer.as_ref()?[binding].clone();
|
||||
Some(Type::new_with_resolver(db, &self.resolver, ty))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue