hir_expand: propagate expansion errors

This commit is contained in:
Jonas Schievink 2020-11-24 19:00:23 +01:00
parent d2f398cd76
commit d5e9bf80f9
4 changed files with 92 additions and 47 deletions

View file

@ -1,6 +1,6 @@
use std::{fmt, iter::FromIterator, sync::Arc};
use hir::MacroFile;
use hir::{MacroFile, MacroResult};
use ide_db::base_db::{
salsa::debug::{DebugQueryTable, TableEntry},
CrateId, FileId, FileTextQuery, SourceDatabase, SourceRootId,
@ -115,10 +115,12 @@ impl FromIterator<TableEntry<FileId, Parse<ast::SourceFile>>> for SyntaxTreeStat
}
}
impl<M> FromIterator<TableEntry<MacroFile, Option<(Parse<SyntaxNode>, M)>>> for SyntaxTreeStats {
impl<M> FromIterator<TableEntry<MacroFile, MacroResult<(Parse<SyntaxNode>, M)>>>
for SyntaxTreeStats
{
fn from_iter<T>(iter: T) -> SyntaxTreeStats
where
T: IntoIterator<Item = TableEntry<MacroFile, Option<(Parse<SyntaxNode>, M)>>>,
T: IntoIterator<Item = TableEntry<MacroFile, MacroResult<(Parse<SyntaxNode>, M)>>>,
{
let mut res = SyntaxTreeStats::default();
for entry in iter {