diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-02 15:07:17 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-02 15:07:17 +0100 |
commit | f39f72db57a78b7f92f99377be0e05ec3db6dc98 (patch) | |
tree | 789f733506520663e6cb5f99eec7d56c1a443831 /crates/ra_syntax | |
parent | 6ecb36740a81445cf103577c3f9e9e6f831d0a1b (diff) | |
parent | f92177cfb5088809892455262841e24cf1ecf5b6 (diff) |
Merge #1737
1737: Report type mismatches in analysis-stats r=matklad a=flodiebold
Only the number usually; each one individually when running with `-v`.
Getting the file/line locations for the exprs was really annoying and I had to make some stuff public (that I didn't remember why it would be `pub(crate)`); maybe I missed some easier way? It would be nice to have some general way for mapping locations :thinking:
This reports 1768 mismatches on RA currently; from skimming, this seems to be mostly various kinds of coercions, though there were also some other things.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/src/ptr.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_syntax/src/ptr.rs b/crates/ra_syntax/src/ptr.rs index 992034ef0..80e55d2aa 100644 --- a/crates/ra_syntax/src/ptr.rs +++ b/crates/ra_syntax/src/ptr.rs | |||
@@ -15,9 +15,8 @@ impl SyntaxNodePtr { | |||
15 | SyntaxNodePtr { range: node.text_range(), kind: node.kind() } | 15 | SyntaxNodePtr { range: node.text_range(), kind: node.kind() } |
16 | } | 16 | } |
17 | 17 | ||
18 | pub fn to_node(self, root: &SyntaxNode) -> SyntaxNode { | 18 | pub fn to_node(self, parent: &SyntaxNode) -> SyntaxNode { |
19 | assert!(root.parent().is_none()); | 19 | successors(Some(parent.clone()), |node| { |
20 | successors(Some(root.clone()), |node| { | ||
21 | node.children().find(|it| self.range.is_subrange(&it.text_range())) | 20 | node.children().find(|it| self.range.is_subrange(&it.text_range())) |
22 | }) | 21 | }) |
23 | .find(|it| it.text_range() == self.range && it.kind() == self.kind) | 22 | .find(|it| it.text_range() == self.range && it.kind() == self.kind) |