]> git.lizzy.rs Git - rust.git/commitdiff
Merge #2406
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Tue, 26 Nov 2019 13:18:03 +0000 (13:18 +0000)
committerGitHub <noreply@github.com>
Tue, 26 Nov 2019 13:18:03 +0000 (13:18 +0000)
2406: Add hygiene information to SourceAnalyzer r=matklad a=edwin0cheng

This should fix https://github.com/rust-analyzer/rust-analyzer/pull/2392#issuecomment-557964686

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
1  2 
crates/ra_hir/src/source_binder.rs
crates/ra_ide_api/src/call_info.rs

Simple merge
index d0283e4103373ff067150fc53ae92a077468f7fc,7ebdfc585a18fe52afd59becb227618a2157f70c..d559dc4d0e9632dcf9e2af9d8b38d52d1742da0e
@@@ -18,16 -18,13 +18,13 @@@ pub(crate) fn call_info(db: &RootDataba
      // Find the calling expression and it's NameRef
      let calling_node = FnCallNode::with_node(&syntax, position.offset)?;
      let name_ref = calling_node.name_ref()?;
+     let name_ref = hir::Source::new(position.file_id.into(), name_ref.syntax());
  
-     let analyzer = hir::SourceAnalyzer::new(
-         db,
-         hir::Source::new(position.file_id.into(), name_ref.syntax()),
-         None,
-     );
+     let analyzer = hir::SourceAnalyzer::new(db, name_ref, None);
      let (mut call_info, has_self) = match &calling_node {
          FnCallNode::CallExpr(expr) => {
 -            //FIXME: don't poke into Ty
 -            let (callable_def, _subst) = analyzer.type_of(db, &expr.expr()?)?.as_callable()?;
 +            //FIXME: Type::as_callable is broken
 +            let callable_def = analyzer.type_of(db, &expr.expr()?)?.as_callable()?;
              match callable_def {
                  hir::CallableDef::FunctionId(it) => {
                      let fn_def = it.into();