Skip to content

Commit 1b26520

Browse files
Add dedicated error for "proc macro not found"
1 parent c66d477 commit 1b26520

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/hir_expand/src/proc_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl ProcMacroExpander {
5050

5151
proc_macro.expander.expand(&tt, None).map_err(mbe::ExpandError::from)
5252
}
53-
None => Err(err!("Unresolved proc macro")),
53+
None => Err(mbe::ExpandError::UnresolvedProcMacro),
5454
}
5555
}
5656
}

crates/mbe/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub enum ExpandError {
3535
ConversionError,
3636
InvalidRepeat,
3737
ProcMacroError(tt::ExpansionError),
38+
UnresolvedProcMacro,
3839
Other(String),
3940
}
4041

@@ -53,6 +54,7 @@ impl fmt::Display for ExpandError {
5354
ExpandError::ConversionError => f.write_str("could not convert tokens"),
5455
ExpandError::InvalidRepeat => f.write_str("invalid repeat expression"),
5556
ExpandError::ProcMacroError(e) => e.fmt(f),
57+
ExpandError::UnresolvedProcMacro => f.write_str("unresolved proc macro"),
5658
ExpandError::Other(e) => f.write_str(e),
5759
}
5860
}

0 commit comments

Comments
 (0)